m68k.md (beq0_di): Generate correct (and more efficient) code when...
authorJeffrey A Law <law@cygnus.com>
Sat, 29 Aug 1998 13:54:24 +0000 (13:54 +0000)
committerJeff Law <law@gcc.gnu.org>
Sat, 29 Aug 1998 13:54:24 +0000 (07:54 -0600)
        * m68k.md (beq0_di): Generate correct (and more efficient) code when
        the clobbered operand overlaps with an input.
        (bne0_di): Similarly.

From-SVN: r22082

gcc/ChangeLog
gcc/config/m68k/m68k.md

index 4530c521b51899375c3130e6b2c8306319c90559..e363da48ad321928f569f433ae89bef32c827261 100644 (file)
@@ -1,5 +1,9 @@
 Sat Aug 29 12:39:56 1998  Jeffrey A Law  (law@cygnus.com)
 
+        * m68k.md (beq0_di): Generate correct (and more efficient) code when
+        the clobbered operand overlaps with an input.
+        (bne0_di): Similarly.
+
        * Makefile.in (INSTALL): Remove "--no-header" argument.
 
         * NEWS: Various updates.
index de3c84625faa11a4c57ecc8346ba7fcb94eace2d..4abcdeb80f4deef48d13804035ad80e774c3004e 100644 (file)
     operands[3] = adj_offsettable_operand (operands[0], 4);
   if (! ADDRESS_REG_P (operands[0]))
     {
+      if (reg_overlap_mentioned_p (operands[2], operands[0]))
+       {
+         if (reg_overlap_mentioned_p (operands[2], operands[3]))
+           {
+#ifdef MOTOROLA
+             return \"or%.l %0,%2\;jbeq %l1\";
+#else
+             return \"or%.l %0,%2\;jeq %l1\";
+#endif
+           }
+         else
+           {
+#ifdef MOTOROLA
+             return \"or%.l %3,%2\;jbeq %l1\";
+#else
+             return \"or%.l %3,%2\;jeq %l1\";
+#endif
+           }
+       }
 #ifdef MOTOROLA
       return \"move%.l %0,%2\;or%.l %3,%2\;jbeq %l1\";
 #else
     operands[3] = adj_offsettable_operand (operands[0], 4);
   if (!ADDRESS_REG_P (operands[0]))
     {
+      if (reg_overlap_mentioned_p (operands[2], operands[0]))
+       {
+         if (reg_overlap_mentioned_p (operands[2], operands[3]))
+           {
+#ifdef MOTOROLA
+             return \"or%.l %0,%2\;jbne %l1\";
+#else
+             return \"or%.l %0,%2\;jne %l1\";
+#endif
+           }
+         else
+           {
+#ifdef MOTOROLA
+             return \"or%.l %3,%2\;jbne %l1\";
+#else
+             return \"or%.l %3,%2\;jne %l1\";
+#endif
+           }
+       }
 #ifdef MOTOROLA
       return \"move%.l %0,%2\;or%.l %3,%2\;jbne %l1\";
 #else