[squeak-dev] COG-VM Float endianness problems
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:
> 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.
> "Answer 1 if the receiver is greater than 0, -1 if less than 0, else
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev