<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 19, 2016 at 7:04 AM, Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-05-19 9:49 GMT+02:00  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Tim Felgentreff uploaded a new version of VMMaker to project VM Maker:<br>
<a href="http://source.squeak.org/VMMaker/VMMaker.oscog-tfel.1862.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/VMMaker/VMMaker.oscog-tfel.1862.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: VMMaker.oscog-tfel.1862<br>
Author: tfel<br>
Time: 19 May 2016, 9:49:06.672041 am<br>
UUID: ee2580a0-a9df-a945-ab7d-26865d302201<br>
Ancestors: VMMaker.oscog-tfel.1861<br>
<br>
Use SmallInteger maxVal and minVal in Integer&gt;&gt;signedIntFromLong for the benefit of VMs that can fit more than 30bit into a signed integer<br>
<br>
=============== Diff against VMMaker.oscog-eem.1860 ===============<br>
<br>
Item was changed:<br>
  ----- Method: Integer&gt;&gt;signedIntFromLong (in category &#39;*VMMaker-interpreter simulator&#39;) -----<br>
  signedIntFromLong<br>
        &quot;Self is a signed or unsigned 32-bit integer&quot;<br>
<br>
        | bits |<br>
+       (self &gt;= SmallInteger minVal and: [self &lt;= SmallInteger maxVal]) ifTrue: &quot;These are known to be SmallIntegers...&quot;<br>
-       (self &gt;= -1073741824 and: [self &lt;= 1073741823]) ifTrue: &quot;These are known to be SmallIntegers...&quot;<br></blockquote><div><br></div><div>Hi Tim,<br></div><div>this does not look correct to me.<br></div><div>if maxVal is 1&lt;&lt;60-1, and self is 1&lt;&lt;40, then self won&#39;t be truncated to 32 low bits as it should...<br></div></div></div></div></blockquote><div><br></div><div>+1.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>Above test is just a fast-up.<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                [^self].<br>
        bits := self bitAnd: 16rFFFFFFFF.<br>
        (bits digitAt: 4) &lt;= 16r7F ifTrue: [^bits].<br>
        ^bits - 16r100000000!<br></blockquote></div></div></div></blockquote><div> </div></div><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>