]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix fixnum* problem; result was shifted to the right by 3 bits if both input register...
authorsheeple <sheeple@oberon.local>
Sat, 29 Nov 2008 06:44:46 +0000 (00:44 -0600)
committersheeple <sheeple@oberon.local>
Sat, 29 Nov 2008 06:44:46 +0000 (00:44 -0600)
basis/compiler/tests/codegen.factor
basis/cpu/ppc/ppc.factor
extra/math/matrices/matrices-tests.factor

index eb818972fc3fca1d6f85bf536e6f2e6238498767..b32a55fdd54f29ab9c91cd96f4ff47a509d506ef 100644 (file)
@@ -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
index aa9126fef07bf76800c90cfbf56f8c6700956f23..8632d236cc21fc61cbd3c69388fde8e7093b51a6 100644 (file)
@@ -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 ;
 
index ee2516e9a6bf4a74b862df23ec68a6fd60332f4b..6f87109ba08a55c96ccb800e18fe915362f8c539 100644 (file)
@@ -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