[squeak-dev] The Trunk: Kernel-nice.1015.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Apr 23 22:02:09 UTC 2016


Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.1015.mcz

==================== Summary ====================

Name: Kernel-nice.1015
Author: nice
Time: 24 April 2016, 12:01:32.68707 am
UUID: e62fa41e-9258-4cf7-a855-fd85b2070131
Ancestors: Kernel-mt.1014

Accelerate bitAnd: in case of negative small integer receiver and LargePositiveInteger operand.

The timings on CogSpur32 r3684 before and after the change are:

[(-1234 bitAnd: 5678)] bench.
	161,000,000 per second. 6.22 nanoseconds per run.
	161,000,000 per second. 6.2 nanoseconds per run.
[(-1234 bitAnd: 5678125641253)] bench.
	1,120,000 per second. 892 nanoseconds per run.
	5,020,000 per second. 199 nanoseconds per run.
[(-1234 bitAnd: -5678125641253)] bench.
	1,830,000 per second. 547 nanoseconds per run.
	1,790,000 per second. 557 nanoseconds per run.
[(-1234 bitAnd: 567812564128976768553)] bench.
	984,000 per second. 1.02 microseconds per run.
	2,320,000 per second. 431 nanoseconds per run.
[(-1234 bitAnd: -567812564128976768553)] bench.
	1,790,000 per second. 559 nanoseconds per run.
	1,690,000 per second. 593 nanoseconds per run.

=============== Diff against Kernel-mt.1014 ===============

Item was changed:
  ----- Method: SmallInteger>>bitAnd: (in category 'bit manipulation') -----
  bitAnd: arg 
  	"Primitive. Answer an Integer whose bits are the logical OR of the
  	receiver's bits and those of the argument, arg.
  	Numbers are interpreted as having 2's-complement representation.
  	Essential.  See Object documentation whatIsAPrimitive."
  
  	<primitive: 14>
  	self >= 0 ifTrue: [^ arg bitAnd: self].
+ 	^ arg < 0
+ 		ifTrue: [(arg bitInvert bitOr: self bitInvert) bitInvert]
+ 		ifFalse: [arg bitClear: self bitInvert]!
- 	^ (self bitInvert bitOr: arg bitInvert) bitInvert!



More information about the Squeak-dev mailing list