[squeak-dev] Re: [Vm-dev] Spur 64-bits. Ugh, this could be a slog...

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed Nov 19 20:56:25 UTC 2014


Hi Eliot, no time to check but I'm quite sure that many bit-tricks assume
31 bits wide SmallIntegers (check highBit and the like).

Nicolas

2014-11-19 19:26 GMT+01:00 Eliot Miranda <eliot.miranda at gmail.com>:

>
>
> On Tue, Nov 18, 2014 at 8:22 PM, David T. Lewis <lewis at mail.msen.com>
> wrote:
>
>> On Tue, Nov 18, 2014 at 07:12:12PM -0800, Eliot Miranda wrote:
>> >
>> > Hi All,
>> >
>> >     I'm making good progress on 64-bit Spur in the Stack VM simulator.
>> But
>> > I've just noticed an image-level issue which could be indicative of
>> lots of
>> > 32-bit assumptions baked into the Squeal/Pharo/Newspeak systems.
>> >
>> > SmallInteger>>digitAt: n
>> > "Answer the value of an indexable field in the receiver.
>> > LargePositiveInteger uses bytes of base two number, and each is a
>> 'digit'
>> > base 256.  Fail if the argument (the index) is not an Integer or is out
>> of
>> > bounds."
>> > n>4 ifTrue: [^ 0].
>> > self < 0
>> > ifTrue:
>> > [self = SmallInteger minVal ifTrue:
>> > ["Can't negate minVal -- treat specially"
>> > ^ #(0 0 0 64) at: n].
>> > ^ ((0-self) bitShift: (1-n)*8) bitAnd: 16rFF]
>> > ifFalse: [^ (self bitShift: (1-n)*8) bitAnd: 16rFF]
>> >
>> > This assumes that SmallInteger is only ever 4 bytes, which is
>> unacceptably
>> > wasteful for my approach to 64-bits. In 64-bit Spur, SmallIntegers are
>> > 61-bit 2's complement.
>> >
>> > I'm raising this example at this point to see if the community might
>> find
>> > similar issues and bring them to my attention.
>>
>> There will be quite a few issues like this scattered throughout the image.
>>
>> My suggestion would be to focus first on getting the 64-bit Spur image
>> running with no changes to SmallInteger minVal and maxVal. Then, as a
>> separate follow up step, expand the range of SmallInteger in the image
>> and work out all the changes required to support it.
>>
>
> That's just a way of adding to the work.  Going whole hog means less work
> after all.  It is also really important to me to get a full 64-bit system
> working asap.  I'm not interested in a hybrid like the existing 64-bit VM.
> What I am doing though is holding off on the 61-bit Float to SmallFloat
> conversion.  I have to write new primitives for that and that can wait.
>
> Another possible way to attack the problem is to start with a Squeak
>> trunk image in 68002 image format (64-bit image), and work out the
>> issues associated with extending SmallInteger minVal and maxVal to
>> take advantage of the larger immediate integers range. This could be
>> independent of the work you are doing now, so if someone else wanted
>> to work on the "expand range of SmallInteger" aspect of the project,
>> I expect that this can be done in the existing 68002 image, such that
>> the resulting changes would be directly applicable to the format 68019
>> (64-bit) Spur images.
>>
>
> The issues are rather straight-forward.  Further, the bootstrap from a
> 32-bit Spur to a 64-bit Spur image is quite simple.  Right now the
> bootstrap only has 18 methods.  It has been by far the least complex
> bootstrap I've done, and I've done Smalltalk-80 V2 16-bit to BrouHaHa
> 32-bit, VW 32-bit to 64-bit, VW 3 to VW 5, Squeak V3 to Spur 32 bit, Squeak
> BlockContext to Squeak Closures.
>
> --
> best,
> Eliot
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20141119/6a3118c5/attachment-0001.htm


More information about the Squeak-dev mailing list