aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/m68k
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim@codesourcery.com>2008-11-25 22:08:13 +0000
committerMaxim Kuvyrkov <mkuvyrkov@gcc.gnu.org>2008-11-25 22:08:13 +0000
commit5a1c3c109550ee678d41873ab74cb723923c7796 (patch)
treeff2d4a695c4f30a3f1121a340e1919d0fe5e6177 /gcc/config/m68k
parent32fc3abf0ed64ed30346eac9ba6e28f8fe9df11f (diff)
downloadgcc-5a1c3c109550ee678d41873ab74cb723923c7796.zip
gcc-5a1c3c109550ee678d41873ab74cb723923c7796.tar.gz
gcc-5a1c3c109550ee678d41873ab74cb723923c7796.tar.bz2
m68k.md (extendsidi2, [...]): Merge, clean up.
* config/m68k/m68k.md (extendsidi2, extendsidi2_mem): Merge, clean up. Disable unsupported alternative for ColdFire, add new alternative that ColdFire can handle. * gcc.c-torture/compile/20080929-1.c: New. From-SVN: r142205
Diffstat (limited to 'gcc/config/m68k')
-rw-r--r--gcc/config/m68k/m68k.md35
1 files changed, 19 insertions, 16 deletions
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index 29624a4..782c7cc 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -1703,32 +1703,35 @@
})
(define_insn "extendsidi2"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (sign_extend:DI (match_operand:SI 1 "nonimmediate_src_operand" "rm")))]
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=d,o,o,<")
+ (sign_extend:DI
+ (match_operand:SI 1 "nonimmediate_src_operand" "rm,rm,r<Q>,rm")))
+ (clobber (match_scratch:SI 2 "=X,d,d,d"))]
""
{
CC_STATUS_INIT;
- if (TARGET_68020 || TARGET_COLDFIRE)
- return "move%.l %1,%R0\;smi %0\;extb%.l %0";
- else
- return "move%.l %1,%R0\;smi %0\;ext%.w %0\;ext%.l %0";
-})
-(define_insn "*extendsidi2_mem"
- [(set (match_operand:DI 0 "memory_operand" "=o,<")
- (sign_extend:DI (match_operand:SI 1 "nonimmediate_src_operand" "rm,rm")))
- (clobber (match_scratch:SI 2 "=d,d"))]
- ""
-{
- CC_STATUS_INIT;
+ if (which_alternative == 0)
+ /* Handle alternative 0. */
+ {
+ if (TARGET_68020 || TARGET_COLDFIRE)
+ return "move%.l %1,%R0\;smi %0\;extb%.l %0";
+ else
+ return "move%.l %1,%R0\;smi %0\;ext%.w %0\;ext%.l %0";
+ }
+
+ /* Handle alternatives 1, 2 and 3. We don't need to adjust address by 4
+ in alternative 3 because autodecrement will do that for us. */
operands[3] = adjust_address (operands[0], SImode,
- which_alternative == 0 ? 4 : 0);
+ which_alternative == 3 ? 0 : 4);
operands[0] = adjust_address (operands[0], SImode, 0);
+
if (TARGET_68020 || TARGET_COLDFIRE)
return "move%.l %1,%3\;smi %2\;extb%.l %2\;move%.l %2,%0";
else
return "move%.l %1,%3\;smi %2\;ext%.w %2\;ext%.l %2\;move%.l %2,%0";
-})
+}
+ [(set_attr "ok_for_coldfire" "yes,no,yes,yes")])
;; Special case when one can avoid register clobbering, copy and test
;; Maybe there is a way to make that the general case, by forcing the