The Trunk: Kernel-eem.1097.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Kernel-eem.1097.mcz

commits-2
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!