Marcel Taeumel uploaded a new version of Kernel to project The Trunk: http://source.squeak.org/trunk/Kernel-mt.1545.mcz
==================== Summary ====================
Name: Kernel-mt.1545 Author: mt Time: 21 December 2023, 5:35:58.67902 pm UUID: fcde1fb1-0264-7a40-9117-67d9fdd740de Ancestors: Kernel-mt.1544
Propose different fallback for mixed int-float arithmetics to use VM-backed mixed float-int arithmetics for + - * / . Speed-up is about 7x on my machine.
=============== Diff against Kernel-mt.1544 ===============
Item was changed: ----- Method: SmallInteger>>* (in category 'arithmetic') ----- * aNumber "Primitive. Multiply the receiver by the argument and answer with the result if it is a SmallInteger. Fail if the argument or the result is not a SmallInteger. Essential. No Lookup. See Object documentation whatIsAPrimitive."
<primitive: 9> + ^ aNumber isFloat + ifTrue: [aNumber * self "exploit mixed arithmetic in float primitives"] + ifFalse: [super * aNumber]! - ^ super * aNumber!
Item was changed: ----- Method: SmallInteger>>+ (in category 'arithmetic') ----- + aNumber "Primitive. Add the receiver to the argument and answer with the result if it is a SmallInteger. Fail if the argument or the result is not a SmallInteger Essential No Lookup. See Object documentation whatIsAPrimitive."
<primitive: 1> + ^ aNumber isFloat + ifTrue: [aNumber + self "exploit mixed arithmetic in float primitives"] + ifFalse: [super + aNumber]! - ^ super + aNumber!
Item was changed: ----- Method: SmallInteger>>- (in category 'arithmetic') ----- - aNumber "Primitive. Subtract the argument from the receiver and answer with the result if it is a SmallInteger. Fail if the argument or the result is not a SmallInteger. Essential. No Lookup. See Object documentation whatIsAPrimitive."
<primitive: 2> + ^ aNumber isFloat + ifTrue: [aNumber negated + self "exploit mixed arithmetic in float primitives"] + ifFalse: [super - aNumber]! - ^super - aNumber!
Item was changed: ----- Method: SmallInteger>>/ (in category 'arithmetic') ----- / aNumber "Primitive. This primitive (for /) divides the receiver by the argument and returns the result if the division is exact. Fail if the result is not a whole integer. Fail if the argument is 0 or is not a SmallInteger. Optional. No Lookup. See Object documentation whatIsAPrimitive."
<primitive: 10> + ^ aNumber isFloat + ifTrue: [(1.0 / aNumber) * self "exploit mixed arithmetic in float primitives"] + ifFalse: [super / aNumber]! - ^super / aNumber!
squeak-dev@lists.squeakfoundation.org