(cmpdi): Rewrite to avoid bogus matching constraints.
authorRichard Kenner <kenner@gcc.gnu.org>
Mon, 5 Jun 1995 23:00:56 +0000 (19:00 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 5 Jun 1995 23:00:56 +0000 (19:00 -0400)
From-SVN: r9880

gcc/config/m68k/m68k.md

index e978d2b5dd3664f4f824fbf2bf3e6a7ed676ccff..e16004e48e16d1696130e1a0af03d45677205413 100644 (file)
 \f
 ;; compare instructions.
 
-(define_insn "cmpdi"
+(define_expand "cmpdi"
+  [(parallel
+    [(set (cc0)
+         (compare (match_operand:DI 0 "nonimmediate_operand" "")
+                  (match_operand:DI 1 "general_operand" "")))
+     (clobber (match_dup 2))])]
+  ""
+  "
+{
+  operands[2] = gen_reg_rtx (DImode);
+}")
+
+(define_insn ""
   [(set (cc0)
-;;     (compare (match_operand:DI 0 "general_operand" "=&d*a")
-;;     (compare (match_operand:DI 0 "general_operand" "+&d*a")
-;;     (compare (match_operand:DI 0 "general_operand" "+d*a")
-       (compare (match_operand:DI 0 "general_operand" "d*a")
-                (match_operand:DI 1 "general_operand" "d")))
-   (clobber (match_scratch:DI 2 "=0"))]
+       (compare (match_operand:DI 1 "nonimmediate_operand" "0,d")
+                (match_operand:DI 2 "general_operand" "d,0")))
+   (clobber (match_operand:DI 0 "register_operand" "=d,d"))]
   ""
   "*
 {
-  operands[2] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
-  operands[3] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
-  if (DATA_REG_P (operands[0]))
-    return \"sub%.l %3,%2\;subx%.l %1,%0\";
+  if (rtx_equal_p (operands[0], operands[1]))
+    return \"sub%.l %R2,%R0\;subx%.l %2,%0\";
   else
-    return \"exg %/d0,%2\;sub%.l %3,%/d0\;exg %/d0,%0\;subx%.l %1,%/d0\;exg %/d0,%2\";
+    {
+      return \"sub%.l %R1,%R0\;subx%.l %1,%0\";
+      cc_status.flags |= CC_REVERSED;
+    }
 }")
 
 ;; This is the second "hook" for PIC code (in addition to movsi). See