Author: zoltan
Date: 2005-06-29 02:02:57 -0400 (Wed, 29 Jun 2005)
New Revision: 46704
Modified:
trunk/mono/mono/mini/ChangeLog
trunk/mono/mono/mini/mini-x86.c
Log:
2005-06-28 Zoltan Varga <[EMAIL PROTECTED]>
* mini-x86.c (peephole_pass): Fix the loadi1/loadi2 rules.
Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog 2005-06-29 05:53:42 UTC (rev 46703)
+++ trunk/mono/mono/mini/ChangeLog 2005-06-29 06:02:57 UTC (rev 46704)
@@ -1,5 +1,7 @@
2005-06-28 Zoltan Varga <[EMAIL PROTECTED]>
+ * mini-x86.c (peephole_pass): Fix the loadi1/loadi2 rules.
+
* mini-x86.c (mono_arch_cpu_init): Fix setting of fp precision in the
VC build.
2005-06-27 Ben Maurer <[EMAIL PROTECTED]>
Modified: trunk/mono/mono/mini/mini-x86.c
===================================================================
--- trunk/mono/mono/mini/mini-x86.c 2005-06-29 05:53:42 UTC (rev 46703)
+++ trunk/mono/mono/mini/mini-x86.c 2005-06-29 06:02:57 UTC (rev 46704)
@@ -1357,51 +1357,33 @@
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)
- * OP_MOVE reg1, reg2
+ * CONV_I1/U1 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) {
- 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;
- }
+ ins->opcode = (ins->opcode ==
OP_LOADI1_MEMBASE) ? CEE_CONV_I1 : CEE_CONV_U1;
+ 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)
- * OP_MOVE reg1, reg2
+ * CONV_I2/U2 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) {
- 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;
- }
+ ins->opcode = (ins->opcode ==
OP_LOADI2_MEMBASE) ? CEE_CONV_I2 : CEE_CONV_U2;
+ ins->sreg1 = last_ins->sreg1;
}
break;
case CEE_CONV_I4:
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches