aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard@codesourcery.com>2006-12-15 09:23:08 +0000
committerRichard Sandiford <richard@codesourcery.com>2006-12-15 09:23:08 +0000
commit9da534955cb85e76682cb83575c36b94ccada8d4 (patch)
treef7f5808c0a29dcfa7bc5555cbc7e5e008d48bdce
parentfac5e14eb38accdeeba29e77d8dc2685f874ea38 (diff)
gcc/
* config/m68k/m68k.md (adddi_dilshr32): Rename to... (*adddi_dilshr32): ...this. Fix formatting. Remove commented-out non-canonical pattern. Restrict to !m68k_arch_coldfire. (*adddi_dilshr32_cf): New pattern. (adddi3, subdi3): Remove first alternatives. gcc/testsuite/ * gcc.c-torture/compile/20061214-1.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/csl/sourcerygxx-4_1@119878 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog.csl12
-rw-r--r--gcc/config/m68k/m68k.md46
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20061214-1.c7
3 files changed, 43 insertions, 22 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl
index 820e03583c7..14cc97c7e41 100644
--- a/ChangeLog.csl
+++ b/ChangeLog.csl
@@ -1,3 +1,15 @@
+2006-12-15 Richard Sandiford <richard@codesourcery.com>
+
+ gcc/
+ * config/m68k/m68k.md (adddi_dilshr32): Rename to...
+ (*adddi_dilshr32): ...this. Fix formatting. Remove commented-out
+ non-canonical pattern. Restrict to !m68k_arch_coldfire.
+ (*adddi_dilshr32_cf): New pattern.
+ (adddi3, subdi3): Remove first alternatives.
+
+ gcc/testsuite/
+ * gcc.c-torture/compile/20061214-1.c: New test.
+
2006-12-13 Carlos O'Donell <carlos@codesourcery.com>
gcc/
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index 54e12d2fe81..5b73f2bced8 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -1936,15 +1936,12 @@
return "move%.w %1,%3\;ext%.l %3\;add%.l %3,%0";
})
-(define_insn "adddi_dilshr32"
+(define_insn "*adddi_dilshr32"
[(set (match_operand:DI 0 "nonimmediate_operand" "=d,o")
-;; (plus:DI (match_operand:DI 2 "general_operand" "%0")
-;; (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro")
-;; (const_int 32))))]
- (plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro,d")
- (const_int 32))
- (match_operand:DI 2 "general_operand" "0,0")))]
- ""
+ (plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro,d")
+ (const_int 32))
+ (match_operand:DI 2 "general_operand" "0,0")))]
+ "!m68k_arch_coldfire"
{
CC_STATUS_INIT;
if (GET_CODE (operands[0]) == REG)
@@ -1954,6 +1951,17 @@
return "add%.l %1,%2\;negx%.l %0\;neg%.l %0";
})
+(define_insn "*adddi_dilshr32_cf"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (plus:DI (lshiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "ro")
+ (const_int 32))
+ (match_operand:DI 2 "register_operand" "0")))]
+ "m68k_arch_coldfire"
+{
+ CC_STATUS_INIT;
+ return "add%.l %1,%R0\;negx%.l %0\;neg%.l %0";
+})
+
(define_insn "adddi_dishl32"
[(set (match_operand:DI 0 "nonimmediate_operand" "=r,o")
;; (plus:DI (match_operand:DI 2 "general_operand" "%0")
@@ -1973,10 +1981,10 @@
})
(define_insn "adddi3"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=<,o<>,d,d,d")
- (plus:DI (match_operand:DI 1 "general_operand" "%0,0,0,0,0")
- (match_operand:DI 2 "general_operand" "<,d,no>,d,a")))
- (clobber (match_scratch:SI 3 "=X,&d,&d,X,&d"))]
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=o<>,d,d,d")
+ (plus:DI (match_operand:DI 1 "general_operand" "%0,0,0,0")
+ (match_operand:DI 2 "general_operand" "d,no>,d,a")))
+ (clobber (match_scratch:SI 3 "=&d,&d,X,&d"))]
""
{
if (DATA_REG_P (operands[0]))
@@ -2029,9 +2037,6 @@
else
{
gcc_assert (GET_CODE (operands[0]) == MEM);
- if (GET_CODE (operands[2]) == MEM
- && GET_CODE (XEXP (operands[2], 0)) == PRE_DEC)
- return "add%.l %2,%0\;addx%.l %2,%0";
CC_STATUS_INIT;
if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
{
@@ -2418,10 +2423,10 @@
})
(define_insn "subdi3"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=<,o<>,d,d,d")
- (minus:DI (match_operand:DI 1 "general_operand" "0,0,0,0,0")
- (match_operand:DI 2 "general_operand" "<,d,no>,d,a")))
- (clobber (match_scratch:SI 3 "=X,&d,&d,X,&d"))]
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=o<>,d,d,d")
+ (minus:DI (match_operand:DI 1 "general_operand" "0,0,0,0")
+ (match_operand:DI 2 "general_operand" "d,no>,d,a")))
+ (clobber (match_scratch:SI 3 "=&d,&d,X,&d"))]
""
{
if (DATA_REG_P (operands[0]))
@@ -2476,9 +2481,6 @@
else
{
gcc_assert (GET_CODE (operands[0]) == MEM);
- if (GET_CODE (operands[2]) == MEM
- && GET_CODE (XEXP (operands[2], 0)) == PRE_DEC)
- return "sub%.l %2,%0\;subx%.l %2,%0";
CC_STATUS_INIT;
if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
{
diff --git a/gcc/testsuite/gcc.c-torture/compile/20061214-1.c b/gcc/testsuite/gcc.c-torture/compile/20061214-1.c
new file mode 100644
index 00000000000..1e65a2a6e52
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20061214-1.c
@@ -0,0 +1,7 @@
+typedef unsigned long long ull;
+ull bar (void);
+void foo (ull *x)
+{
+ ull y = bar ();
+ *x += y >> 32;
+}