[Vm-dev] float word order

Eliot Miranda eliot.miranda at gmail.com
Sun Apr 19 02:32:01 UTC 2009


On Sat, Apr 18, 2009 at 6:30 PM, John M McIntosh <
johnmci at smalltalkconsulting.com> wrote:

>
> This collide with reverseBytesInImage ?


yes, but easy to fix:

(fmt = 6 and: [BytesPerWord = 8])
 ifTrue: ["Object contains 32-bit half-words packed into 64-bit machine
words."
 wordAddr := oop + BaseHeaderSize.
 self reverseWordsFrom: wordAddr to: oop + (self sizeBitsOf: oop)]].
=>
(fmt = 6 ifTrue:
[(self fetchClassOfNonInt: oop) = floatClass
ifTrue:
[self swapWordFrom: oop + BaseHeaderSize to: oop + BaseHeaderSize + 8]
ifFalse:
[BytesPerWord = 8]) ifTrue:
["Object contains 32-bit half-words packed into 64-bit machine words."
wordAddr := oop + BaseHeaderSize.
self reverseWordsFrom: wordAddr to: oop + (self sizeBitsOf: oop)]]].

(BTW, is reverseWordsFrom:to: broken for 64-bit images?)


>
> On 18-Apr-09, at 6:15 PM, Eliot Miranda wrote:
>
>  Hi All,
>>
>>    I see that Float 32-bit word order is big-endian (PowerPC) on all
>> platforms.
>>
>
> --
> ===========================================================================
> John M. McIntosh <johnmci at smalltalkconsulting.com>
> Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
> ===========================================================================
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20090418/23d61d9a/attachment.htm


More information about the Vm-dev mailing list