[squeak-dev] Re: x86 sarl curiosity...
ncellier at ifrance.com
Wed Jan 21 20:38:57 UTC 2009
Eliot Miranda <eliot.miranda <at> gmail.com> writes:
> Hi All,
> anyone know the x86/IA32 really well? If so, read on. Otherwise save
yourself the yawn.
> I just tried to save an instruction in Cog;s generated bitShift: primitive.
It seems to me that SARL (shift arithmetic right long) should set the sign flag
based on the result, in fact it says as much in the manual; I quote from IA-32
Intel® Architecture Software Developer's Manual Volume 2B: Instruction Set
Reference, N-Z p 4-192
I guess you are adressing case of SmallInteger, otherwise I would understand
optimize as using some MMX 64 or 128 bits arithmetic (like PSRLLQ).
If relevant, check my trivial optimizations for large ints at
More information about the Squeak-dev