[Openmcl-devel] TRAP-UNLESS-LISPTAG= fixnum on ppc64

Gary Byers gb at clozure.com
Fri Jul 15 03:33:06 PDT 2005



On Fri, 15 Jul 2005, James Bielman wrote:

> I think I've bootstrapped everything cleanly from the latest test
> image---while writing some LAP functions I ran into the following:
>
>  (in-package :ccl)
>
>  (defppclapfunction fixnum-trap-test ((n arg_z))
>    (trap-unless-lisptag= arg_z target::tag-fixnum)
>    (blr))
>
>  (fixnum-trap-test nil)
>
>
>> Error in process listener(1): Unknown trap: #xB030000
>>                               xp: #<A Mac Pointer #xF0135798>, fn: #<Compiled-function FIXNUM-TRAP-TEST #x1047B5C6C>, pc: #x10
>> While executing: FIXNUM-TRAP-TEST
>> Type :POP to abort.
> Type :? for other options.
> 1 > (lisp-implementation-version)
> "Version (Alpha: DarwinPPC64) 0.14.3-050714"
>
> (Is this the proper way to require a fixnum in a LAP function?

Yes; it should trap if the low 3 bits (PPC64) of the argument are non-zero.


> There's a few level-0 LAP functions that do this that also signal an
> unknown trap error:)

As does something like

? (svref #(a b c) 2.0)

and similar things that do bounds checking.

This is supposed to be handled in a case in the #+ppc64-target XCMAIN
callback in "ccl:level-1;ppc-trap-support.lisp", but there seems to be
a bug there; it's looking for an RLDICL instruction that rotates left
by 0 bits then clears the left 62 bits of some register, and should be
looking for an RLDICL that clears the left 61 bits.  Fixed in CVS.

>
>  (%get-object (%null-ptr) nil)
>
> This came up while writing some LAP functions to do 32-bit rotates,
> loosely based on the PPC VOPs from SB-ROTATE-BYTE.  If anyone is
> curious the code is at (with an untested ARM version!):
>
>  http://slacknet.com/~jamesjb/rotate.lisp
>
> James
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list