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

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Fri May 20 12:03:51 UTC 2016


2016-05-20 13:17 GMT+02:00 timfelgentreff <timfelgentreff at gmail.com>:

>
> Sorry, I wasn't careful here and got confused by the method name and
> comment,
> thinking we're talking platform integers here. I updated the method to
> truncate to 32-bit.
>
>
That's why I like having diffs in mailing lists :)
Note that your new code is correct, and the intention might be clearer than
original code.
But it removed the SmallInteger optimization if the host image is 32bits...

+       (self >= -16r80000000 and: [self <= 16r7FFFFFFF])
+               ifTrue: [^self].

above code does imply large integers on those platforms.
I didn't measure if it really has an impact on simulation, maybe not, but
this should be verified first.


>
> Eliot Miranda-2 wrote
> > On Thu, May 19, 2016 at 7:04 AM, Nicolas Cellier <
>
> > nicolas.cellier.aka.nice@
>
> >> wrote:
> >
> >>
> >>
> >>
> >> 2016-05-19 9:49 GMT+02:00 &lt;
>
> > commits at .squeak
>
> > &gt;:
> >>
> >>>
> >>> 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...
> >>
> >
> > +1.
> >
> >
> >> Above test is just a fast-up.
> >>
> >>
> >>>                 [^self].
> >>>         bits := self bitAnd: 16rFFFFFFFF.
> >>>         (bits digitAt: 4) <= 16r7F ifTrue: [^bits].
> >>>         ^bits - 16r100000000!
> >>>
> >>
> > _,,,^..^,,,_
> > best, Eliot
>
>
>
>
>
> --
> View this message in context:
> http://forum.world.st/VM-Maker-VMMaker-oscog-tfel-1862-mcz-tp4895935p4896329.html
> Sent from the Squeak VM mailing list archive at Nabble.com.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160520/bd4a831d/attachment.htm


More information about the Vm-dev mailing list