[squeak-dev] floats

Hans-Martin Mosner hmm at heeg.de
Sun Mar 15 06:48:54 UTC 2009


Jecel Assumpcao Jr schrieb:
>
> Would an immediate float representation for 32 bit VMs be of any
> interest? It seems to me that ...xxxx1 represents SmallIntegers and
> ...xxxx00 represents oops, so ...xxxx10 would be free to use for floats
> with 30 bit precision (what Self has).
>   
That does not work since xxx10 is used as a sentinel value in the
garbage collector.
I think a better approach is to handle floats specially in a JIT, and
keep them unboxed for typical sequences of arithmetic manipulation
within methods.
Of course, using immediate floats does avoid the object creation and
destruction overhead, but you still have some overhead for tagging and
untagging, which on modern architectures is still much higher than the
actual floating point operation costs.

Cheers,
Hans-Martin



More information about the Squeak-dev mailing list