gb at clozure.com
Mon Oct 14 11:57:32 EDT 2002
On 14 Oct 2002, Marco Baringer wrote:
> ? (lisp-implementation-version)
> "Version (Beta: Darwin) 0.13"
> ? (let ((i #xffffffff)) (declare (type (unsigned-byte 32) i)) (ash i -24))
> > Error: NIL : value doesn't match constraint :U8CONST in template for CCL::U32-SHIFT-RIGHT .
> > While executing: CCL::MATCH-VREG
> > Type :POP to abort.
> Type :? for other options.
> 1 >
> declaring i to be of type (unsigned-byte 33) works as does leaving out
> the declaration all together. yet, (typep #xffffffff '(unsigned-byte
> 32)) is true. this error happens only when the count arg to ash is
> according to my reading of l0-numbers.lisp (bignum-ashift-right
> #xffffffff 8) is what is being called, but calling bignum-ashift-right
> directly results in no errors (and the proper result). all i've been
> able to figure out is that u32-shift-right is being called with count
> and not (- count) as it should be, but i don't see where the call to
> u32-shift-right happens.
The error message is coming from the compiler: CCL::U32-SHIFT-RIGHT is
a "template" that tells it how to generate code to generate a right-shift
of an (UNSIGNED-BYTE 32) argument by a small constant amount.
It -should- ideally just constant-fold this; as is, it tries to generate
code to shift one constant (well, a constant-valued variable) by another.
Aside from the question of whether it should be doing this at all: I can't
reproduce the problem. I get the (correct) answer of 255 both under version
0.13 and under the development version of 0.14 I'm working on.
Could you please try:
? (trace ccl::acode-fixnum-form-p)
? (let ((i #xffffffff)) (declare (type (unsigned-byte 32) i)) (ash i -24))
and send me the output that TRACE generates ?
> Ring the bells that still can ring.
> Forget your perfect offering.
> There is a crack in everything.
> That's how the light gets in.
> -Leonard Cohen
> p.s. - what's the function to delete a directory?
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
Openmcl-devel mailing list
Openmcl-devel at clozure.com
More information about the Openmcl-devel