[Vm-dev] Spur Object 64 bit format

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue Nov 12 11:45:24 UTC 2013


I'm not sure I totally understand the post of Igor, since I was in the
process of responding to Eliot, I need more time :)

Concerning single precision Float, they all can be represented losslessly
in such immediate double (but Nan and Inf),
so it might be better to let the VM as simple as possible like strongly
suggested by Igor, and let experiments occur at image side.

Of course, I'm pretty convinced that Character MUST be in the immediate
zoo, it's an obvious optimization given that so many algorithms suffers
from human interaction and must deal with text at one moment or another :)


2013/11/12 Igor Stasenko <siguctua at gmail.com>

>
> And let me remind you what i proposed back then:
>
> :)
> ===========
> About immediates zoo.
>
> Keep in mind, that the more immediates we have, the more complex
> implementation
> tends to be.
>
> I would just keep 2 data types:
>  - integers
>  - floats
>
> and third, special 'arbitrary' immediate , which seen by VM as a 60-bit
> value.
> The interpretation of this value depends on lookup in range-table,
> where developer specifying the correspondence between the value
> interval and class:
> [min .. max] -> class
>
> intervals, of course, cannot overlap.
> Determining a class of such immediate might be slower - O(log2(n)) at
> best (where n is size of range table), but from other side,
> how many different kinds of immediates you can fit into 60-bit value?
> Right, it is 2^60. Much more than proposed 8 isn't? :)
>
> And this extra cost can be mitigated completely by inline cache.
> - in case of regular reference, you must fetch the object's class and
> then compare it with one, stored in cache.
> - in case of immediate reference, you compare immediate value with min
> and max stored in cache fields.
> And if value is in range, you got a cache hit, and free to proceed.
> So, its just 1 extra comparison comparing to 'classic' inline cache.
>
> And, after thinking how inline cache is organized, now you can scratch
> the first my paragraph related to  immediates!
> We really don't need to discriminate between small integers/floats/rest!!
> They could also be nothing more than just one of a range(s) defined in
> our zoo of 'special' immediates!
>
> So, at the end we will have just two kinds of references:
>  - zero bit == 0 -- an object pointer
>  - zero bit == 1 -- an immediate
>
> Voila!.
>
> We can have real zoo of immediates, and simple implementation to support
> them.
> And not saying that range-table is provided by language-side, so we're
> free to rearrange them at any moment.
>
> And of course, it doesn't means that VM could not reserve some of the
> ranges for own 'contracted'
> immediates, like Characters, and even class reference for example.
> Think about it :)
>
>
>
> On 12 November 2013 11:56, Henrik Johansen <henrik.s.johansen at veloxit.no>wrote:
>
>>
>>
>> On 12 Nov 2013, at 11:55 , Henrik Johansen <henrik.s.johansen at veloxit.no>
>> wrote:
>>
>> nterest ~= time and: [skills]
>>
>>
>> OT: I swear, missing parenthesis will be the death of me!
>>
>>
>
>
> --
> Best regards,
> Igor Stasenko.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20131112/b7c70a92/attachment.htm


More information about the Vm-dev mailing list