[Vm-dev] Re: [squeak-dev] Spur with Immediate Floating Point
Support implies a break
Eliot Miranda
eliot.miranda at gmail.com
Thu Dec 4 02:22:42 UTC 2014
Hi Levente,
On Wed, Dec 3, 2014 at 3:08 PM, Levente Uzonyi <leves at elte.hu> wrote:
> On Mon, 1 Dec 2014, Eliot Miranda wrote:
>
> I was assuming that any of add or subtract positive or negative zero, or
>> multiply or divide by 1.0 would do the trick. Why wouldn't this be
>> adequate?
>>
>
> I think "x + 0.0" is adequate, but unnatural. It reminds me of
> javascript's typecast hacks.
>
> Ah, I see. Hang on. There is no support for SmallFloat64 on 32-bit Spur.
>> Only in a 64-bit image/on a 64-bit Spur VM will you be able to create
>> instances of SmallFloat64. And so far I only have this working in the VM
>> simulator. I've yet to try and create a real VM, and even then it will
>> only be a Stack VM.
>>
>
> Wouldn't it be possible to support them in a 32-bit VM? Aren't object
> headers the same in both VMs? Or is it because of the difference in
> alignment?
SmallFloat64 is an immediate tagged representation, like SmallInteger, so
they fit within an object pointer and have no header. In 64-bit Spur there
is a 3-bit tag, leaving 61 bits. SmallFoat64 steals 3 bits from the 11-bit
exponent to donate to the tags, representing a full double precision
floating-point value that is restricted to the ~ +/-10^+/-38 range.
There's really no practical way to shoe-horn a usable range of 64-bit float
into a 30-bit value. Its possible but so few values would fit that the
effort would be counter-productive. DOes this make sense now?
>
> Levente
>
>
>
--
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20141203/ae26cb38/attachment.htm
More information about the Squeak-dev
mailing list
|