From: Peter Barada Date: Tue, 1 Jun 2004 13:22:04 +0000 (+0000) Subject: m68k.c (m68k_output_mi_thunk): For ColdFire, use %d0 as a scratch to perform an add... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5050d266eaf5c63b62a22579c3f25c598de83417;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aa5a1a9df14..ebe0dc21bcf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-06-01 Peter Barada + + * config/m68k/m68k.c(m68k_output_mi_thunk): For ColdFire, use %d0 as + a scratch to perform an add to memory. + 2004-06-01 Bernardo Innocenti PR target/14018 diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index 1aebe96c548..da17f65f9cd 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" :