<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-05-19 9:49 GMT+02:00 <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></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>>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>>signedIntFromLong (in category '*VMMaker-interpreter simulator') -----<br>
signedIntFromLong<br>
"Self is a signed or unsigned 32-bit integer"<br>
<br>
| bits |<br>
+ (self >= SmallInteger minVal and: [self <= SmallInteger maxVal]) ifTrue: "These are known to be SmallIntegers..."<br>
- (self >= -1073741824 and: [self <= 1073741823]) ifTrue: "These are known to be SmallIntegers..."<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<<60-1, and self is 1<<40, then self won't be truncated to 32 low bits as it should...<br></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) <= 16r7F ifTrue: [^bits].<br>
^bits - 16r100000000!<br>
<br>
</blockquote></div><br></div></div>