[squeak-dev] COG-VM Float endianness problems

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Mon Jun 21 18:58:41 UTC 2010


2010/6/21 Eliot Miranda <eliot.miranda at gmail.com>:
>
>
> 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

OK, thanks, the Float at: at:put: basicAt: basicAt:put: are not in
Andreas image and must be filed in indeed.

Nicolas

>>
>> Nicolas
>>
>
>
>
>
>



More information about the Squeak-dev mailing list