<div dir="ltr">Hi All,<div><br></div><div>    I&#39;m making good progress on 64-bit Spur in the Stack VM simulator.  But I&#39;ve just noticed an image-level issue which could be indicative of lots of 32-bit assumptions baked into the Squeal/Pharo/Newspeak systems.</div><div><br></div><div>SmallInteger&gt;&gt;digitAt: n <div><span class="" style="white-space:pre">        </span>&quot;Answer the value of an indexable field in the receiver.  LargePositiveInteger uses bytes of base two number, and each is a &#39;digit&#39; base 256.  Fail if the argument (the index) is not an Integer or is out of bounds.&quot;</div><div><span class="" style="white-space:pre">        </span>n&gt;4 ifTrue: [^ 0].</div><div><span class="" style="white-space:pre">        </span>self &lt; 0</div><div><span class="" style="white-space:pre">                </span>ifTrue: </div><div><span class="" style="white-space:pre">                        </span>[self = SmallInteger minVal ifTrue:</div><div><span class="" style="white-space:pre">                                </span>[&quot;Can&#39;t negate minVal -- treat specially&quot;</div><div><span class="" style="white-space:pre">                                </span>^ #(0 0 0 64) at: n].</div><div><span class="" style="white-space:pre">                        </span>^ ((0-self) bitShift: (1-n)*8) bitAnd: 16rFF]</div><div><span class="" style="white-space:pre">                </span>ifFalse: [^ (self bitShift: (1-n)*8) bitAnd: 16rFF]</div><div><br></div><div>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&#39;s complement.</div><div><br></div><div>I&#39;m raising this example at this point to see if the community might find similar issues and bring them to my attention.</div>-- <br><div class="gmail_signature">best,<div>Eliot</div></div>
</div></div>