Fix fixnum* problem; result was shifted to the right by 3 bits if both input registers were equal
parent
c43690a8fb
commit
26c002d23f
|
@ -261,3 +261,6 @@ TUPLE: id obj ;
|
|||
|
||||
[ 3 ] [ 1 t fixnum-overflow-control-flow-test ] unit-test
|
||||
[ 2 ] [ 1 f fixnum-overflow-control-flow-test ] unit-test
|
||||
|
||||
[ 4 ] [ 2 [ dup fixnum* ] compile-call ] unit-test
|
||||
[ 7 ] [ 2 [ dup fixnum* 3 fixnum+fast ] compile-call ] unit-test
|
||||
|
|
|
@ -228,12 +228,12 @@ M:: ppc %fixnum-mul ( src1 src2 -- )
|
|||
"no-overflow" define-label
|
||||
0 0 LI
|
||||
0 MTXER
|
||||
src1 src1 tag-bits get SRAWI
|
||||
scratch-reg src1 src2 MULLWO.
|
||||
scratch-reg src1 tag-bits get SRAWI
|
||||
scratch-reg scratch-reg src2 MULLWO.
|
||||
scratch-reg ds-reg 0 STW
|
||||
"no-overflow" get BNO
|
||||
src2 src2 tag-bits get SRAWI
|
||||
src1 src2 move>args
|
||||
scratch-reg src2 move>args
|
||||
%prepare-alien-invoke
|
||||
"overflow_fixnum_multiply" f %alien-invoke
|
||||
"no-overflow" resolve-label ;
|
||||
|
@ -242,14 +242,14 @@ M:: ppc %fixnum-mul-tail ( src1 src2 -- )
|
|||
"overflow" define-label
|
||||
0 0 LI
|
||||
0 MTXER
|
||||
src1 src1 tag-bits get SRAWI
|
||||
scratch-reg src1 src2 MULLWO.
|
||||
scratch-reg src1 tag-bits get SRAWI
|
||||
scratch-reg scratch-reg src2 MULLWO.
|
||||
"overflow" get BO
|
||||
scratch-reg ds-reg 0 STW
|
||||
BLR
|
||||
"overflow" resolve-label
|
||||
src2 src2 tag-bits get SRAWI
|
||||
src1 src2 move>args
|
||||
scratch-reg src2 move>args
|
||||
%prepare-alien-invoke
|
||||
"overflow_fixnum_multiply" f %alien-invoke-tail ;
|
||||
|
||||
|
|
|
@ -102,3 +102,5 @@ USING: math.matrices math.vectors tools.test math ;
|
|||
[ { 0 0 -1 } ] [ { 1 0 0 } { 0 1 0 } cross ] unit-test
|
||||
[ { 1 0 0 } ] [ { 0 1 0 } { 0 0 1 } cross ] unit-test
|
||||
[ { 0 1 0 } ] [ { 0 0 1 } { 1 0 0 } cross ] unit-test
|
||||
|
||||
[ { 1 0 0 } ] [ { 1 1 0 } { 1 0 0 } proj ] unit-test
|
||||
|
|
Loading…
Reference in New Issue