[Pkg] The Trunk: Kernel-eem.1097.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Apr 18 18:41:16 UTC 2017
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1097.mcz
==================== Summary ====================
Name: Kernel-eem.1097
Author: eem
Time: 18 April 2017, 11:41:03.658215 am
UUID: 716aef28-aea7-408d-9720-a0371de009d7
Ancestors: Kernel-dtl.1096
Add the primitive implementation to the two hashMultiply methods.
=============== Diff against Kernel-dtl.1096 ===============
Item was changed:
----- Method: LargePositiveInteger>>hashMultiply (in category 'bit manipulation') -----
hashMultiply
+ "This is a multiplication by by 1664525 mod 2^28 written to avoid overflowing into large integers.
+ The primitive is able to perform the operation with modulo arihmetic."
+ <primitive: 159>
"Truncate to 28 bits and try again"
-
^(self bitAnd: 16rFFFFFFF) hashMultiply!
Item was changed:
----- Method: SmallInteger>>hashMultiply (in category 'bit manipulation') -----
hashMultiply
+ "This is a multiplication by by 1664525 mod 2^28 written to avoid overflowing into large integers.
+ The primitive is able to perform the operation with modulo arihmetic."
+ <primitive: 159>
- "Multiply by 1664525 mod 2^28 without overflowing into large integers."
| low |
low := self bitAnd: 16383.
^(16r260D * low + ((16r260D * (self bitShift: -14) + (16r0065 * low) bitAnd: 16383) * 16384))
bitAnd: 16r0FFFFFFF!
More information about the Packages
mailing list