[Vm-dev] Re: VM Maker: VMMaker.oscog-tfel.1862.mcz
timfelgentreff
timfelgentreff at gmail.com
Fri May 20 11:17:16 UTC 2016
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.
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 <
> commits at .squeak
> >:
>>
>>>
>>> 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.
More information about the Vm-dev
mailing list