aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-05-31 20:44:10 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-05-31 20:44:10 -0400
commit35f456e3977f35b0de8a39d5da5bfae59e0de63c (patch)
treeb4f654b5fc9a8540f3443e3e5040dcdbe7010639
parente65886db7dfb5cd98b806945386a2e294074e234 (diff)
downloadgcc-35f456e3977f35b0de8a39d5da5bfae59e0de63c.zip
gcc-35f456e3977f35b0de8a39d5da5bfae59e0de63c.tar.gz
gcc-35f456e3977f35b0de8a39d5da5bfae59e0de63c.tar.bz2
(one_cmpldi2): New pattern.
({a,l}shrdi{3,_const}): Allow 63 as shift count. From-SVN: r9854
-rw-r--r--gcc/config/m68k/m68k.md50
1 files changed, 37 insertions, 13 deletions
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index d2667ea..fab1159 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -4009,6 +4009,24 @@
;; one complement instructions
+;; "one_cmpldi2" is only here to help combine().
+(define_insn "one_cmpldi2"
+ [(set (match_operand:DI 0 "general_operand" "=dm")
+ (not:DI (match_operand:DI 1 "general_operand" "0")))]
+ ""
+ "*
+{
+ CC_STATUS_INIT;
+ if (GET_CODE (operands[0]) == REG)
+ operands[2] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ else if (GET_CODE (XEXP (operands[0], 0)) == POST_INC
+ || GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
+ operands[1] = operands[0];
+ else
+ operands[1] = adj_offsettable_operand (operands[0], 4);
+ return \"not%.l %1\;not%.l %0\";
+}")
+
(define_insn "one_cmplsi2"
[(set (match_operand:SI 0 "general_operand" "=dm")
(not:SI (match_operand:SI 1 "general_operand" "0")))]
@@ -4293,12 +4311,14 @@
[(set (match_operand:DI 0 "general_operand" "=d")
(ashiftrt:DI (match_operand:DI 1 "general_operand" "0")
(match_operand 2 "const_int_operand" "n")))]
- "(INTVAL (operands[2]) == 1
- || INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16
- || INTVAL (operands[2]) == 2 || INTVAL (operands[2]) == 3)"
+ "(INTVAL (operands[2]) == 1 || INTVAL (operands[2]) == 2
+ || INTVAL (operands[2]) == 3 || INTVAL (operands[2]) == 8
+ || INTVAL (operands[2]) == 16 || INTVAL (operands[2]) == 63)"
"*
{
operands[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ if (INTVAL (operands[2]) == 63)
+ return \"add%.l %0,%0\;subx%.l %0,%0\;move%.l %0,%1\";
CC_STATUS_INIT;
if (INTVAL (operands[2]) == 1)
return \"asr%.l %#1,%0\;roxr%.l %#1,%1\";
@@ -4320,9 +4340,10 @@
"
{
if (GET_CODE (operands[2]) != CONST_INT
- || (INTVAL (operands[2]) != 1 && INTVAL (operands[2]) != 32
- && INTVAL (operands[2]) != 8 && INTVAL (operands[2]) != 16
- && INTVAL (operands[2]) != 2 && INTVAL (operands[2]) != 3))
+ || (INTVAL (operands[2]) != 1 && INTVAL (operands[2]) != 2
+ && INTVAL (operands[2]) != 3 && INTVAL (operands[2]) != 8
+ && INTVAL (operands[2]) != 16 && INTVAL (operands[2]) != 32
+ && INTVAL (operands[2]) != 63))
FAIL;
} ")
@@ -4434,13 +4455,15 @@
[(set (match_operand:DI 0 "general_operand" "=d")
(lshiftrt:DI (match_operand:DI 1 "general_operand" "0")
(match_operand 2 "const_int_operand" "n")))]
- "(INTVAL (operands[2]) == 1
- || INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16
- || INTVAL (operands[2]) == 2 || INTVAL (operands[2]) == 3)"
+ "(INTVAL (operands[2]) == 1 || INTVAL (operands[2]) == 2
+ || INTVAL (operands[2]) == 3 || INTVAL (operands[2]) == 8
+ || INTVAL (operands[2]) == 16 || INTVAL (operands[2]) == 63)"
"*
{
- CC_STATUS_INIT;
operands[1] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+ if (INTVAL (operands[2]) == 63)
+ return \"add%.l %0,%0\;clr%.l %0\;clr%.l %1\;addx%.l %1,%1\";
+ CC_STATUS_INIT;
if (INTVAL (operands[2]) == 1)
return \"lsr%.l %#1,%0\;roxr%.l %#1,%1\";
else if (INTVAL (operands[2]) == 8)
@@ -4461,9 +4484,10 @@
"
{
if (GET_CODE (operands[2]) != CONST_INT
- || (INTVAL (operands[2]) != 1 && INTVAL (operands[2]) != 32
- && INTVAL (operands[2]) != 8 && INTVAL (operands[2]) != 16
- && INTVAL (operands[2]) != 2 && INTVAL (operands[2]) != 3))
+ || (INTVAL (operands[2]) != 1 && INTVAL (operands[2]) != 2
+ && INTVAL (operands[2]) != 3 && INTVAL (operands[2]) != 8
+ && INTVAL (operands[2]) != 16 && INTVAL (operands[2]) != 32
+ && INTVAL (operands[2]) != 63))
FAIL;
} ")