[Vm-dev] VM Maker: VMMaker.oscog-tfel.1862.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Thu May 19 14:04:45 UTC 2016


2016-05-19 9:49 GMT+02:00 <commits at source.squeak.org>:

>
> Tim Felgentreff uploaded a new version of VMMaker to project VM Maker:
> http://source.squeak.org/VMMaker/VMMaker.oscog-tfel.1862.mcz
>
> ==================== Summary ====================
>
> Name: VMMaker.oscog-tfel.1862
> Author: tfel
> Time: 19 May 2016, 9:49:06.672041 am
> UUID: ee2580a0-a9df-a945-ab7d-26865d302201
> Ancestors: VMMaker.oscog-tfel.1861
>
> Use SmallInteger maxVal and minVal in Integer>>signedIntFromLong for the
> benefit of VMs that can fit more than 30bit into a signed integer
>
> =============== Diff against VMMaker.oscog-eem.1860 ===============
>
> Item was changed:
>   ----- Method: Integer>>signedIntFromLong (in category
> '*VMMaker-interpreter simulator') -----
>   signedIntFromLong
>         "Self is a signed or unsigned 32-bit integer"
>
>         | bits |
> +       (self >= SmallInteger minVal and: [self <= SmallInteger maxVal])
> ifTrue: "These are known to be SmallIntegers..."
> -       (self >= -1073741824 and: [self <= 1073741823]) ifTrue: "These are
> known to be SmallIntegers..."
>

Hi Tim,
this does not look correct to me.
if maxVal is 1<<60-1, and self is 1<<40, then self won't be truncated to 32
low bits as it should...
Above test is just a fast-up.


>                 [^self].
>         bits := self bitAnd: 16rFFFFFFFF.
>         (bits digitAt: 4) <= 16r7F ifTrue: [^bits].
>         ^bits - 16r100000000!
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160519/6c2a4995/attachment-0001.htm


More information about the Vm-dev mailing list