[squeak-dev] COG-VM Float endianness problems

Eliot Miranda eliot.miranda at gmail.com
Mon Jun 21 18:42:36 UTC 2010


On Mon, Jun 21, 2010 at 10:46 AM, Nicolas Cellier <
nicolas.cellier.aka.nice at gmail.com> wrote:

> Hi,
> I'm using windows COG VM + image provided by Andreas.
> I note a few problems related to the change of endianness of Float.
>
> One of it is Float negativeZero sign = 1, instead of -1.
>
> Float>>sign
>        "Answer 1 if the receiver is greater than 0, -1 if less than 0, else
> 0.
>        Handle IEEE-754 negative-zero by reporting a sign of -1"
>
>        self > 0 ifTrue: [^ 1].
>        (self < 0 or: [((self at: 1) bitShift: -31) = 1]) ifTrue: [^ -1].
>        ^ 0
>
> Does the image miss a few changes ?
>

Looks like it.  In my image I get -1 as expected.  make sure you've filed in
NecessaryImageChangesForCogToWork.1.cs or updated to latest trunk.

The underlying issue is that because Cog holds floats in platform order
internally one has to use special versions of Float at: basicAt: at:put: and
basicAt:put: that hide the reordering from Squeak.  These are
in NecessaryImageChangesForCogToWork.1.cs and latest trunk.

cheers,
Eliot


> Nicolas
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20100621/9f1fa614/attachment.htm


More information about the Squeak-dev mailing list