[squeak-dev] 30 bit unboxed floats

Jecel Assumpcao Jr. jecel at merlintec.com
Mon Oct 18 20:32:08 UTC 2010


We have had several discussions about the tags in Squeak. xxxxxx1 is a
SmallInteger and xxxxxx00 is an object pointer, but xxxxxx10 is not
generally used. In one of the previous discussions somebody did mention
a very obscure case in which this is actually used, but I can't find
this email right now and don't remember the details. I do remember that
at the time it seemed to me that it wouldn't be hard to change this to
free up the 10 tag for some other use.

The most interesting use, in my opinion, would be to have unboxed
floating point numbers. A very common reaction here to this is that we
will all be moving to 64 bits anyway so it is not worth the trouble to
make this change.  I might have agreed a few years ago, but today it
looks like we will have to deal with 32 bit Squeak for quite a while
yet. And with 4.2 introducing some important image format changes
anyway, this might be the right time to revisit this issue.

Boxed floats have the disadvantage of requiring an object allocation for
every operation. Their great advantage is being 64 bits, even in 32 bit
images. The unboxed floats would have to be 30 bits, not even 32 bits.
So the fraction size goes from 53 bits to only 21. And while they would
mostly speed things up, the current tag tests would have to go from two
alternatives to three and that would slow them down. The extra tests
would be in what is already a slow path anyway, so it wouldn't hurt as
much as it would initially seem.

Does anybody have any data related to this or any opinions?

-- Jecel




More information about the Squeak-dev mailing list