[squeak-dev] 30 bit unboxed floats

Levente Uzonyi leves at elte.hu
Mon Oct 18 21:08:58 UTC 2010


On Mon, 18 Oct 2010, Eliot Miranda wrote:

> On Mon, Oct 18, 2010 at 11:31 AM, Jecel Assumpcao Jr.
> <jecel at merlintec.com>wrote:
>
>> 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?
>>
>
> I think immediate characters are much more generally useful, especially
> considering unicode.  The current implementation of only codes 0 to 255
> being == is error-prone.  The problem 30 bit floats have is that they're not
> a useful subset of Float.  A 60-bit immediate float is a different beast
> altogether.  You really need the number of bits to be sihnificanty greater
> than the size of the mantissa.  With 30 bits it is still 23 bits short.
>
> 2?
> Eliot

+1


Levente

>
>>
>> -- Jecel
>>
>>
>>
>



More information about the Squeak-dev mailing list