Author: zoltan
Date: 2007-04-26 11:50:30 -0400 (Thu, 26 Apr 2007)
New Revision: 76346

Modified:
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/mini-amd64.c
Log:
2007-04-26  Zoltan Varga  <[EMAIL PROTECTED]>

        * mini-amd64.c (peephole_pass_1): Fix and reenable this pass.


Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog      2007-04-26 15:45:43 UTC (rev 76345)
+++ trunk/mono/mono/mini/ChangeLog      2007-04-26 15:50:30 UTC (rev 76346)
@@ -1,5 +1,7 @@
 2007-04-26  Zoltan Varga  <[EMAIL PROTECTED]>
 
+       * mini-amd64.c (peephole_pass_1): Fix and reenable this pass.
+       
        * mini-amd64.c (mono_arch_local_regalloc): Disable the new 
peephole_pass_1 as it
        causes the corlib unit tests to fail.
 

Modified: trunk/mono/mono/mini/mini-amd64.c
===================================================================
--- trunk/mono/mono/mini/mini-amd64.c   2007-04-26 15:45:43 UTC (rev 76345)
+++ trunk/mono/mono/mini/mini-amd64.c   2007-04-26 15:50:30 UTC (rev 76346)
@@ -1556,10 +1556,11 @@
                case OP_ADD_IMM:
                case OP_IADD_IMM:
                case OP_LADD_IMM:
-                       if ((ins->sreg1 < MONO_MAX_IREGS) && (ins->dreg >= 
MONO_MAX_IREGS)) {
+                       if ((ins->sreg1 < MONO_MAX_IREGS) && (ins->dreg >= 
MONO_MAX_IREGS) && (ins->inst_imm > 0)) {
                                /* 
                                 * X86_LEA is like ADD, but doesn't have the
-                                * sreg1==dreg restriction.
+                                * sreg1==dreg restriction. inst_imm > 0 is 
needed since LEA sign-extends 
+                                * its operand to 64 bit.
                                 */
                                ins->opcode = OP_X86_LEA_MEMBASE;
                                ins->inst_basereg = ins->sreg1;
@@ -1592,15 +1593,6 @@
                                }
                        }
                        break;
-               case OP_SUB_IMM:
-               case OP_ISUB_IMM:
-               case OP_LSUB_IMM:
-                       if ((ins->sreg1 < MONO_MAX_IREGS) && (ins->dreg >= 
MONO_MAX_IREGS)) {
-                               ins->opcode = OP_X86_LEA_MEMBASE;
-                               ins->inst_basereg = ins->sreg1;
-                               ins->inst_imm = -ins->inst_imm;
-                       }
-                       break;
                case OP_COMPARE_IMM:
                        /* OP_COMPARE_IMM (reg, 0) 
                         * --> 
@@ -2177,10 +2169,8 @@
 
        mono_arch_lowering_pass (cfg, bb);
 
-       /*
        if (cfg->opt & MONO_OPT_PEEPHOLE)
                peephole_pass_1 (cfg, bb);
-       */
 
        mono_local_regalloc (cfg, bb);
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to