2004-06-12 Ben Maurer <bmaurer@users.sourceforge.net>
authorBen Maurer <benm@mono-cvs.ximian.com>
Sat, 12 Jun 2004 15:39:27 +0000 (15:39 -0000)
committerBen Maurer <benm@mono-cvs.ximian.com>
Sat, 12 Jun 2004 15:39:27 +0000 (15:39 -0000)
* mini.c: use BIGMUL only if both operands have the same signage.
* iltests.il: Test for bug 60056. (errors related to signage in
BIGMUL).

r=lupus.

svn path=/trunk/mono/; revision=29410

mono/mini/ChangeLog
mono/mini/iltests.il
mono/mini/mini.c

index 75beecc02c53eb555320129f4c38435376f44d8f..5b54a964543b53104ae1934be64fe55a630040a5 100644 (file)
@@ -1,3 +1,10 @@
+2004-06-12 Ben Maurer  <bmaurer@users.sourceforge.net>
+
+       * mini.c: use BIGMUL only if both operands have the same signage.
+       * iltests.il: Test for bug 60056. (errors related to signage in
+       BIGMUL).
+
+       r=lupus.
 
 Thu Jun 10 16:06:42 CEST 2004 Paolo Molaro <lupus@ximian.com>
 
index 777c38423b8b8311c93a15bb81c4de7ef6b196c0..0c68cfc57b9674761c7e71db0dd2ca951c7cf25b 100644 (file)
                ldc.i4.1
                ret
        }
-
+       
+       .method public static int32 test_1_bug60056  () {
+               .locals init (int32 m5)
+                       
+               ldc.i4.m1
+               stloc.0
+               
+               ldc.i4.1
+               conv.u8
+               
+               ldloc.0
+               conv.i8
+               mul
+               
+               ldc.i4.m1
+               conv.i8
+               ceq
+               ret
+       }
 }
index c334970ef9d31396715d7180ffee9437a4a16436..eae413be49b38b0b867b77c3c085fafdf86c4d3a 100644 (file)
@@ -6787,7 +6787,8 @@ dec_foreach (MonoInst *tree, MonoCompile *cfg) {
                                && tree->inst_left->inst_left->type == STACK_I4
                                && (tree->inst_right->opcode == CEE_CONV_I8 
                                        || tree->inst_right->opcode == CEE_CONV_U8)
-                               && tree->inst_right->inst_left->type == STACK_I4) {
+                               && tree->inst_right->inst_left->type == STACK_I4
+                               && tree->inst_left->opcode == tree->inst_right->opcode) {
                        tree->opcode = (tree->inst_left->opcode == CEE_CONV_I8 ? OP_BIGMUL: OP_BIGMUL_UN);
                        tree->inst_left = tree->inst_left->inst_left;
                        tree->inst_right = tree->inst_right->inst_left;