[Vm-dev] VM Maker: VMMaker.oscog-eem.240.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Thu Dec 20 23:37:00 UTC 2012


Oops, sorry, code for #signed64BitIntegerFor: is at
http://code.google.com/p/cog/issues/detail?id=93
both issues are so close...

Nicolas

2012/12/21 Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:
> By the way, value should be declared unsigned too in #signed32BitIntegerFor:
>
> Nicolas
>
> 2012/12/21 Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:
>> 2012/12/20  <commits at source.squeak.org>:
>>>
>>> Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
>>> http://source.squeak.org/VMMaker/VMMaker.oscog-eem.240.mcz
>>>
>>> ==================== Summary ====================
>>>
>>> Name: VMMaker.oscog-eem.240
>>> Author: eem
>>> Time: 20 December 2012, 12:21:03.98 pm
>>> UUID: f72e2cd1-8b0e-45af-acd7-06ba9bbc2a50
>>> Ancestors: VMMaker.oscog-eem.239
>>>
>>
>>>
>>> Remove obsolete use of cCode: 'magnitude >> 32' in the integer
>>> conversion routines signed64BitIntegerFor: et al now that Slang
>>> generates the correct cases for right-shift.
>>>
>>
>> Hi Eliot, did you see code at http://code.google.com/p/cog/issues/detail?id=92 ?
>> My version of signed64BitIntegerFor: is much simpler
>>
>> 1) define magnitude as unsigned
>>         <var: 'magnitude' type: 'usqLong'>,
>>
>> 2) handle SmallInteger positive and negative value during the sign test
>>         integerValue < 0
>>                 ifTrue:[        integerValue >= 16r-40000000 ifTrue: [^self
>> integerObjectOf: integerValue].
>>                                 largeClass := self classLargeNegativeInteger.
>>                                 magnitude := 0 - integerValue]
>>                 ifFalse:[       integerValue <= 16r3FFFFFFF ifTrue: [^self
>> integerObjectOf: integerValue].
>>                                 largeClass := self classLargePositiveInteger.
>>                                 magnitude := integerValue].
>>
>> I think the 3rd change maybe is not worth, it replaces
>>                         (highWord := highWord >> 8) = 0 ifFalse:[sz := sz + 1].
>>                         (highWord := highWord >> 8) = 0 ifFalse:[sz := sz + 1].
>>                         (highWord := highWord >> 8) = 0 ifFalse:[sz := sz + 1]].
>> with:
>>                         (highWord >> 16) = 0 ifFalse:
>>                                 [highWord := highWord >> 16.
>>                                 sz := sz + 2].
>>                         (highWord >> 8) = 0 ifFalse:[sz := sz + 1].
>>
>> Nicolas


More information about the Vm-dev mailing list