diff options
author | Peter Barada <peter@the-baradas.com> | 2004-06-01 13:22:04 +0000 |
---|---|---|
committer | Bernardo Innocenti <bernie@gcc.gnu.org> | 2004-06-01 15:22:04 +0200 |
commit | 5050d266eaf5c63b62a22579c3f25c598de83417 (patch) | |
tree | dfac44a5e08525b91e08bfda1477e101a4c47b40 /gcc/config/m68k | |
parent | 225d221a9d82172d403aa068217dc67ca0a3f249 (diff) | |
download | gcc-5050d266eaf5c63b62a22579c3f25c598de83417.zip gcc-5050d266eaf5c63b62a22579c3f25c598de83417.tar.gz gcc-5050d266eaf5c63b62a22579c3f25c598de83417.tar.bz2 |
m68k.c (m68k_output_mi_thunk): For ColdFire, use %d0 as a scratch to perform an add to memory.
* config/m68k/m68k.c(m68k_output_mi_thunk): For ColdFire, use %d0 as
a scratch to perform an add to memory.
From-SVN: r82547
Diffstat (limited to 'gcc/config/m68k')
-rw-r--r-- | gcc/config/m68k/m68k.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index 1aebe96..da17f65 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -3334,6 +3334,23 @@ m68k_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, "\tsubq.l %I%d,4(%Rsp)\n" : "\tsubql %I%d,%Rsp@(4)\n", (int) -delta); + else if (TARGET_COLDFIRE) + { + /* ColdFire can't add/sub a constant to memory unless it is in + the range of addq/subq. So load the value into %d0 and + then add it to 4(%sp). */ + if (delta >= -128 && delta <= 127) + asm_fprintf (file, MOTOROLA ? + "\tmoveq.l %I%wd,%Rd0\n" : + "\tmoveql %I%wd,%Rd0\n", delta); + else + asm_fprintf (file, MOTOROLA ? + "\tmove.l %I%wd,%Rd0\n" : + "\tmovel %I%wd,%Rd0\n", delta); + asm_fprintf (file, MOTOROLA ? + "\tadd.l %Rd0,4(%Rsp)\n" : + "\taddl %Rd0,%Rsp@(4)\n"); + } else asm_fprintf (file, MOTOROLA ? "\tadd.l %I%wd,4(%Rsp)\n" : |