<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">&lt;<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>&gt;</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>
&gt;<br>
&gt; Hi All,<br>
&gt;<br>
&gt;     I&#39;m making good progress on 64-bit Spur in the Stack VM simulator.  But<br>
&gt; I&#39;ve just noticed an image-level issue which could be indicative of lots of<br>
&gt; 32-bit assumptions baked into the Squeal/Pharo/Newspeak systems.<br>
&gt;<br>
&gt; SmallInteger&gt;&gt;digitAt: n<br>
&gt; &quot;Answer the value of an indexable field in the receiver.<br>
&gt; LargePositiveInteger uses bytes of base two number, and each is a &#39;digit&#39;<br>
&gt; base 256.  Fail if the argument (the index) is not an Integer or is out of<br>
&gt; bounds.&quot;<br>
&gt; n&gt;4 ifTrue: [^ 0].<br>
&gt; self &lt; 0<br>
&gt; ifTrue:<br>
&gt; [self = SmallInteger minVal ifTrue:<br>
&gt; [&quot;Can&#39;t negate minVal -- treat specially&quot;<br>
&gt; ^ #(0 0 0 64) at: n].<br>
&gt; ^ ((0-self) bitShift: (1-n)*8) bitAnd: 16rFF]<br>
&gt; ifFalse: [^ (self bitShift: (1-n)*8) bitAnd: 16rFF]<br>
&gt;<br>
&gt; This assumes that SmallInteger is only ever 4 bytes, which is unacceptably<br>
&gt; wasteful for my approach to 64-bits. In 64-bit Spur, SmallIntegers are<br>
&gt; 61-bit 2&#39;s complement.<br>
&gt;<br>
&gt; I&#39;m raising this example at this point to see if the community might find<br>
&gt; 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&#39;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&#39;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 &quot;expand range of SmallInteger&quot; 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&#39;ve done, and I&#39;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>