<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 18, 2014 at 8:22 PM, David T. Lewis <span dir="ltr"><<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Nov 18, 2014 at 07:12:12PM -0800, Eliot Miranda wrote:<br>
><br>
> Hi All,<br>
><br>
> I'm making good progress on 64-bit Spur in the Stack VM simulator. But<br>
> I've just noticed an image-level issue which could be indicative of lots of<br>
> 32-bit assumptions baked into the Squeal/Pharo/Newspeak systems.<br>
><br>
> SmallInteger>>digitAt: n<br>
> "Answer the value of an indexable field in the receiver.<br>
> LargePositiveInteger uses bytes of base two number, and each is a 'digit'<br>
> base 256. Fail if the argument (the index) is not an Integer or is out of<br>
> bounds."<br>
> n>4 ifTrue: [^ 0].<br>
> self < 0<br>
> ifTrue:<br>
> [self = SmallInteger minVal ifTrue:<br>
> ["Can't negate minVal -- treat specially"<br>
> ^ #(0 0 0 64) at: n].<br>
> ^ ((0-self) bitShift: (1-n)*8) bitAnd: 16rFF]<br>
> ifFalse: [^ (self bitShift: (1-n)*8) bitAnd: 16rFF]<br>
><br>
> This assumes that SmallInteger is only ever 4 bytes, which is unacceptably<br>
> wasteful for my approach to 64-bits. In 64-bit Spur, SmallIntegers are<br>
> 61-bit 2's complement.<br>
><br>
> I'm raising this example at this point to see if the community might find<br>
> similar issues and bring them to my attention.<br>
<br>
</div></div>There will be quite a few issues like this scattered throughout the image.<br>
<br>
My suggestion would be to focus first on getting the 64-bit Spur image<br>
running with no changes to SmallInteger minVal and maxVal. Then, as a<br>
separate follow up step, expand the range of SmallInteger in the image<br>
and work out all the changes required to support it.<br></blockquote><div><br></div><div>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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Another possible way to attack the problem is to start with a Squeak<br>
trunk image in 68002 image format (64-bit image), and work out the<br>
issues associated with extending SmallInteger minVal and maxVal to<br>
take advantage of the larger immediate integers range. This could be<br>
independent of the work you are doing now, so if someone else wanted<br>
to work on the "expand range of SmallInteger" aspect of the project,<br>
I expect that this can be done in the existing 68002 image, such that<br>
the resulting changes would be directly applicable to the format 68019<br>
(64-bit) Spur images.<br></blockquote><div><br></div><div>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.</div><div><br></div></div>-- <br><div class="gmail_signature">best,<div>Eliot</div></div>
</div></div>