Author: zoltan
Date: 2005-06-29 03:06:39 -0400 (Wed, 29 Jun 2005)
New Revision: 46707

Modified:
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/mini-x86.c
Log:
2005-06-29  Zoltan Varga  <[EMAIL PROTECTED]>

        * mini-x86.c: Revert the last change as it seems to break the build.


Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog      2005-06-29 07:02:42 UTC (rev 46706)
+++ trunk/mono/mono/mini/ChangeLog      2005-06-29 07:06:39 UTC (rev 46707)
@@ -1,3 +1,7 @@
+2005-06-29  Zoltan Varga  <[EMAIL PROTECTED]>
+
+       * mini-x86.c: Revert the last change as it seems to break the build..
+
 2005-06-28  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * mini-x86.c (peephole_pass): Fix the loadi1/loadi2 rules.

Modified: trunk/mono/mono/mini/mini-x86.c
===================================================================
--- trunk/mono/mono/mini/mini-x86.c     2005-06-29 07:02:42 UTC (rev 46706)
+++ trunk/mono/mono/mini/mini-x86.c     2005-06-29 07:06:39 UTC (rev 46707)
@@ -1357,33 +1357,51 @@
                case OP_LOADU1_MEMBASE:
                case OP_LOADI1_MEMBASE:
                        /* 
+                        * Note: if reg1 = reg2 the load op is removed
+                        *
                         * OP_STORE_MEMBASE_REG reg1, offset(basereg) 
                         * OP_LOAD_MEMBASE offset(basereg), reg2
                         * -->
                         * OP_STORE_MEMBASE_REG reg1, offset(basereg)
-                        * CONV_I1/U1 reg1, reg2
+                        * OP_MOVE reg1, reg2
                         */
                        if (last_ins && (last_ins->opcode == 
OP_STOREI1_MEMBASE_REG) &&
                                        ins->inst_basereg == 
last_ins->inst_destbasereg &&
                                        ins->inst_offset == 
last_ins->inst_offset) {
-                               ins->opcode = (ins->opcode == 
OP_LOADI1_MEMBASE) ? CEE_CONV_I1 : CEE_CONV_U1;
-                               ins->sreg1 = last_ins->sreg1;
+                               if (ins->dreg == last_ins->sreg1) {
+                                       last_ins->next = ins->next;             
                
+                                       ins = ins->next;                        
        
+                                       continue;
+                               } else {
+                                       //static int c = 0; printf ("MATCHX %s 
%d\n", cfg->method->name,c++);
+                                       ins->opcode = OP_MOVE;
+                                       ins->sreg1 = last_ins->sreg1;
+                               }
                        }
                        break;
                case OP_LOADU2_MEMBASE:
                case OP_LOADI2_MEMBASE:
                        /* 
+                        * Note: if reg1 = reg2 the load op is removed
+                        *
                         * OP_STORE_MEMBASE_REG reg1, offset(basereg) 
                         * OP_LOAD_MEMBASE offset(basereg), reg2
                         * -->
                         * OP_STORE_MEMBASE_REG reg1, offset(basereg)
-                        * CONV_I2/U2 reg1, reg2
+                        * OP_MOVE reg1, reg2
                         */
                        if (last_ins && (last_ins->opcode == 
OP_STOREI2_MEMBASE_REG) &&
                                        ins->inst_basereg == 
last_ins->inst_destbasereg &&
                                        ins->inst_offset == 
last_ins->inst_offset) {
-                               ins->opcode = (ins->opcode == 
OP_LOADI2_MEMBASE) ? CEE_CONV_I2 : CEE_CONV_U2;
-                               ins->sreg1 = last_ins->sreg1;
+                               if (ins->dreg == last_ins->sreg1) {
+                                       last_ins->next = ins->next;             
                
+                                       ins = ins->next;                        
        
+                                       continue;
+                               } else {
+                                       //static int c = 0; printf ("MATCHX %s 
%d\n", cfg->method->name,c++);
+                                       ins->opcode = OP_MOVE;
+                                       ins->sreg1 = last_ins->sreg1;
+                               }
                        }
                        break;
                case CEE_CONV_I4:

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

Reply via email to