Stef,

    in 32-bit Spur there are only BoxedFloat64 instances.  In 64-bit Spur there are (already) both BoxedFloat64 instances and SmallFloat64 immediates.  In 64-but Spur, if a float's exponent is in the middle 8 bit range of the 11-bit double precision exponent range it is represented as a SmallFloat64 immediate and occupies no space except the slot referencing it, just as with SmallInteger.

There is good documentation of the scheme in VMMaker.oscog.  When time allows I'll write more informative class comments, but look at the SmallInteger comment, that's not detailed either.

_,,,^..^,,,_ (phone)

On Feb 1, 2016, at 11:00 PM, stepharo <stepharo@free.fr> wrote:

Tx nicolas

I read

SmallFloat64: My instances represent 64-bit Floats whose exponent fits in 8 bits as immediate objects.  This representation is only available on 64-bit systems, not 32-bit systems.

BoxedFloat64: My instances hold 64-bit Floats in heap objects.  This is the only representation on 32-bit systems.  But on 64-bit systems SmallFloat64 holds a subset of the full 64-bit double-precision range in immediate objects.

I think that we can improve such comments but I do not have the knowledge.

So do I get that we will have instances of Float and BoxedFloat64?


Le 1/2/16 21:27, Nicolas Cellier a ��crit :
SmallFloat is like SmallInteger: immediate value encoded in oop, and it is only for 64 bits Spur VM.
Boxed is the classical VM Float, two 4-bytes word allocated per Float, and is both for 32 bits VM and Float values not fitting in immediate format (3 bits have been stolen from exponent...).

2016-02-01 20:49 GMT+01:00 stepharo <stepharo@free.fr>:
Hi

I'm updating Pharo by example and the relationship between Float and its subclasses is unclear to me.
Do we only get instances of the subclasses now?

I got that Boxed is only for 64 bits.
But SmallFloat?
The class comment is not really self describing.

Stef