aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2002-12-02 16:54:14 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2002-12-02 16:54:14 +0000
commit513f31eb684407555e3600efee9707f7e94a3351 (patch)
treea85b415497c239ee68e1a8f441d0fec431714ee2
parent7ffc9761ca08a1576add6f098c01e5504735e363 (diff)
downloadgcc-513f31eb684407555e3600efee9707f7e94a3351.zip
gcc-513f31eb684407555e3600efee9707f7e94a3351.tar.gz
gcc-513f31eb684407555e3600efee9707f7e94a3351.tar.bz2
h8300.c (dosize): Output r7/er7 instead of sp.
* config/h8300/h8300.c (dosize): Output r7/er7 instead of sp. (push): Likewise. (pop): Likewise. (h8300_output_function_prologue): Likewise. (h8300_output_function_epilogue): Likewise. From-SVN: r59718
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/h8300/h8300.c24
2 files changed, 25 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 64558f1..ad643b8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2002-12-02 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (dosize): Output r7/er7 instead of sp.
+ (push): Likewise.
+ (pop): Likewise.
+ (h8300_output_function_prologue): Likewise.
+ (h8300_output_function_epilogue): Likewise.
+
Mon Dec 2 14:43:22 2002 J"orn Rennecke <joern.rennecke@superh.com>
* expmed.c (store_bit_field): Use int_mode_for_mode to find
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 84ce436..bf82186 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -418,16 +418,20 @@ dosize (file, op, size)
amount > 0;
amount /= 2)
{
+ char insn[100];
+
+ sprintf (insn, "\t%ss\t#%d,%s\n", op, amount,
+ TARGET_H8300 ? "r7" : "er7");
for (; size >= amount; size -= amount)
- fprintf (file, "\t%ss\t#%d,sp\n", op, amount);
+ fputs (insn, file);
}
}
else
{
if (TARGET_H8300)
- fprintf (file, "\tmov.w\t#%d,r3\n\t%s.w\tr3,sp\n", size, op);
+ fprintf (file, "\tmov.w\t#%d,r3\n\t%s.w\tr3,r7\n", size, op);
else
- fprintf (file, "\t%s.l\t#%d,sp\n", op, size);
+ fprintf (file, "\t%s.l\t#%d,er7\n", op, size);
}
}
@@ -471,7 +475,10 @@ push (file, rn)
FILE *file;
int rn;
{
- fprintf (file, "\t%s\t%s\n", h8_push_op, h8_reg_names[rn]);
+ if (TARGET_H8300)
+ fprintf (file, "\t%s\t%s,@-r7\n", h8_mov_op, h8_reg_names[rn]);
+ else
+ fprintf (file, "\t%s\t%s,@-er7\n", h8_mov_op, h8_reg_names[rn]);
}
/* Output assembly language code to pop register RN. */
@@ -481,7 +488,10 @@ pop (file, rn)
FILE *file;
int rn;
{
- fprintf (file, "\t%s\t%s\n", h8_pop_op, h8_reg_names[rn]);
+ if (TARGET_H8300)
+ fprintf (file, "\t%s\t@r7+,%s\n", h8_mov_op, h8_reg_names[rn]);
+ else
+ fprintf (file, "\t%s\t@er7+,%s\n", h8_mov_op, h8_reg_names[rn]);
}
/* This is what the stack looks like after the prolog of
@@ -604,7 +614,7 @@ h8300_output_function_prologue (file, size)
if (n_regs == 1)
push (file, regno);
else
- fprintf (file, "\tstm.l\t%s-%s,@-sp\n",
+ fprintf (file, "\tstm.l\t%s-%s,@-er7\n",
h8_reg_names[regno],
h8_reg_names[regno + (n_regs - 1)]);
}
@@ -670,7 +680,7 @@ h8300_output_function_epilogue (file, size)
if (n_regs == 1)
pop (file, regno);
else
- fprintf (file, "\tldm.l\t@sp+,%s-%s\n",
+ fprintf (file, "\tldm.l\t@er7+,%s-%s\n",
h8_reg_names[regno - (n_regs - 1)],
h8_reg_names[regno]);
}