[Vm-dev] float word order
John M McIntosh
johnmci at smalltalkconsulting.com
Sun Apr 19 18:08:14 UTC 2009
On 19-Apr-09, at 8:37 AM, David T. Lewis wrote:
>> The values in a FloatArray are 32-bit floats, packed into 64-bit
> in the object memory. There are no endian issues to worry about. On
> 32-bit and 64-bit object memories, the values are arranged in the
> of an (int *) access. In other words, they are arrays of 32-bit values
> that just happen to be stuffed onto slots that the object memory
> are 64-bit words.
Well that's not quite true, you have to be careful here because might
people move data in and out of
the FloatArray, but let's see..
MatrixTransform2x3>>at: index put: value
<primitive: 'primitiveAtPut' module: 'FloatArrayPlugin'>
ifTrue:[self basicAt: index put: value asIEEE32BitWord]
ifFalse:[self at: index put: value asFloat].
self unsignedLongAt: 1 put: aValue asFloat asIEEE32BitWord
bigEndian: SmalltalkImage current isBigEndian.
Ok, well the reverseBytesInImage logic I'll assume without looking is
swapping the bytes in the FloatArray at load time so that accessors
use SmalltalkImage current isBigEndian to move data in/out in the
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
More information about the Vm-dev