Questions about FloatArrays
Luciano Esteban Notarfrancesco
lnotarfr at dc.uba.ar
Fri Jun 12 13:56:12 UTC 1998
I continue working on FloatArrays, and I have some implementation questions.
Squeak's Floats are 64 bits C doubles in the PowerPC ordering. In some
plataforms (Intel for instance) the doubles are word-swapped, i.e. the
lower 32 bits are swapped with the upper. I implemented FloatArray as a
variableWord subclass of ArrayedCollection. I want to see FloatArrays
as 'double *' from translated primitives... so I need to keep them in the
ordering of the plataform in which Squeak is running. To handle this, I
do the following:
1) I keep a class variable in FloatArray (SwapWords) that says
whether I need to swap words when storing and retriving Floats.
2) I added to the method SystemDictionary|processStartUpList a
line doing
FloatArray startUp
3) I implemented FloatArray class|startUp this way:
((self with: 1.0) * 2.0) first = 2.0
ifFalse: [SwapWords _ SwapWords not.
self allInstancesDo: [ :each |
each swap]].
4) and I implemented FloatAray|swap as it's ovious.
What do you think about this scheme. Is all this right? Is there another
way to do this, more close to the Squeak spirit?
Having access to 'double *' from translated primitives alows doing sound
analysis, high-quality speech synthesis and speech recognition... that's
way all this is too important to me.
Thanks in advance,
Luciano.-
More information about the Squeak-dev
mailing list
|