[Vm-dev] About primitiveBitAnd / Or / Xor

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue Mar 17 21:38:00 UTC 2015


Hi again,
I've noticed the COG code currently branches on objectMemory wordSize = 8
condition,
to either load self positive64BitValueOf: integerArgument.
or to load self positive32BitValueOf: integerArgument.

Of course, this could be resolved to a single
    integerArgument := self positiveMachineIntegerValueOf: integerArgument
which will care of the branch by itself...
That's what I did.

But maybe the intention was rather to deal with signed64BitValueOf in the
64 bit branch like what was done to primitiveBitShift?

Of course, all this is assuming that the machine uses a 2-complement
implementation, otherwise it won't match the Smalltalk semantic.
That's not so rare ;) - but theoretically not fully portable - contrarily
to actual strategy which is fully portable.
Since other parts of the VM also rely on such specific, maybe we can trade
a little portability tribute for the sake of speed.

Thoughts?

Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20150317/6ef3cb5c/attachment.htm


More information about the Vm-dev mailing list