[LispM-Hackers] hello
Dave Richards
dave@synergy.org
Wed Mar 6 18:19:01 2002
Yep. fixnums are two's complement and bignums are sign magnitude, according
to SSDN2.
> -----Original Message-----
> From: lispm-hackers-admin@lists.unlambda.com
> [mailto:lispm-hackers-admin@lists.unlambda.com]On Behalf Of Tim Moore
> Sent: Wednesday, March 06, 2002 1:15 PM
> To: lispm-hackers@lists.unlambda.com
> Subject: [LispM-Hackers] hello
>
>
> I just came across this project and can't ever resist a good hack. I have
> a lot of coals in the Lisp fires and can't commit to really diving into
> this project, but I do have a lot of Lisp system/compiler experience and
> would love to help out on a low level, perhaps implementing some macro
> instructions.
>
> So, here's a question about what I suspect is a bug. In memobj.cc we
> have:
>
>
> e3s32 memFix::value(void) const
> {
> e3Word me = readMe();
>
> e3u8 sign_bit = me.selectBitsPPSS(24, 1);
> e3u32 magnitude = me.selectBitsPPSS(0, 24);
> e3s32 signed_magnitude = magnitude;
>
> if (sign_bit)
> {
> signed_magnitude *= -1; // Probably should just set sign bit.
> }
>
> return(signed_magnitude);
> }
>
> But a fixnum is in two's complement, right? I suspect this should be
> something like:
>
> e3s32 val = me.getBits();
> return (val << 7) >> 7;
>
> Comments?
>
> Tim
>
>
>
>
> http://lists.unlambda.com/mailman/listinfo/lispm-hackers