From: Richard Kenner Date: Mon, 5 Jun 1995 23:00:56 +0000 (-0400) Subject: (cmpdi): Rewrite to avoid bogus matching constraints. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a1efcf3c405f3ae4b76a4778bbb6326f4bb83c50;p=gcc.git (cmpdi): Rewrite to avoid bogus matching constraints. From-SVN: r9880 --- diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index e978d2b5dd3..e16004e48e1 100644 --- a/gcc/config/m68k/m68k.md +++ b/gcc/config/m68k/m68k.md @@ -411,23 +411,33 @@ ;; 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