[Vm-dev] CCode generation of rotatedFloatBitsOf:

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Fri Oct 23 23:07:59 UTC 2015


I have this infamous warning : shift count > width of type

value = (((usqInt) (((usqInt)oop))) >> (3 + 1)) + ((oop & (1 << 3)
    ? *-1 << ((64 - 3) - 1)*
    : 0));

It's true, -1 is an int (32 bits) so the 60 bit shift may not work...

May I suggest Smalltalk code change:

    ^oop asUnsignedInteger >> (self numTagBits + 1)
     + ((oop anyMask: self smallFloatSignBit)
        ifTrue: [-1 *asUnsignedInteger* << (64 - self numTagBits - 1)]
        ifFalse: [0])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20151024/f428d8bd/attachment.htm


More information about the Vm-dev mailing list