Commit 980d0e81 by Jeffrey A Law Committed by Jeff Law

mn10300.c (REG_SAVE_BYTES): Only reserve space for registers which will be saved.

        * mn10300.c (REG_SAVE_BYTES): Only reserve space for registers
        which will be saved.
        * mn10300.md (prologue insn): Only save registers which need saving.
        (epilogue insn): Similarly.

From-SVN: r21687
parent 6e755043
Wed Aug 12 17:25:18 1998 Jeffrey A Law (law@cygnus.com) Wed Aug 12 17:25:18 1998 Jeffrey A Law (law@cygnus.com)
* mn10300.c (REG_SAVE_BYTES): Only reserve space for registers
which will be saved.
* mn10300.md (prologue insn): Only save registers which need saving.
(epilogue insn): Similarly.
* mn10300.c, mn10300.h, mn10300.md: Remove "global zero register" * mn10300.c, mn10300.h, mn10300.md: Remove "global zero register"
optimizations. optimizations.
......
...@@ -39,7 +39,10 @@ Boston, MA 02111-1307, USA. */ ...@@ -39,7 +39,10 @@ Boston, MA 02111-1307, USA. */
/* The size of the callee register save area. Right now we save everything /* The size of the callee register save area. Right now we save everything
on entry since it costs us nothing in code size. It does cost us from a on entry since it costs us nothing in code size. It does cost us from a
speed standpoint, so we want to optimize this sooner or later. */ speed standpoint, so we want to optimize this sooner or later. */
#define REG_SAVE_BYTES (16) #define REG_SAVE_BYTES (4 * regs_ever_live[2] \
+ 4 * regs_ever_live[3] \
+ 4 * regs_ever_live[6] \
+ 4 * regs_ever_live[7])
void void
asm_file_start (file) asm_file_start (file)
......
...@@ -1370,7 +1370,39 @@ ...@@ -1370,7 +1370,39 @@
"" ""
"* "*
{ {
return \"ret [d2,d3,a2,a3],%0\"; int i, need_comma;
int d2, d3, a2, a3;
need_comma = 0;
fputs (\"\\tret [\", asm_out_file);
if (regs_ever_live[2])
{
fputs (\"d2\", asm_out_file);
need_comma = 1;
}
if (regs_ever_live[3])
{
if (need_comma)
fputc (',', asm_out_file);
fputs (\"d3\", asm_out_file);
need_comma = 1;
}
if (regs_ever_live[6])
{
if (need_comma)
fputc (',', asm_out_file);
fputs (\"a2\", asm_out_file);
need_comma = 1;
}
if (regs_ever_live[7])
{
if (need_comma)
fputc (',', asm_out_file);
fputs (\"a3\", asm_out_file);
need_comma = 1;
}
fprintf (asm_out_file, \"],%d\\n\", INTVAL (operands[0]));
return \"\";
}" }"
[(set_attr "cc" "clobber")]) [(set_attr "cc" "clobber")])
...@@ -1379,7 +1411,39 @@ ...@@ -1379,7 +1411,39 @@
"" ""
"* "*
{ {
return \"movm [d2,d3,a2,a3],(sp)\"; int i, need_comma;
int d2, d3, a2, a3;
need_comma = 0;
fputs (\"\\tmovm [\", asm_out_file);
if (regs_ever_live[2])
{
fputs (\"d2\", asm_out_file);
need_comma = 1;
}
if (regs_ever_live[3])
{
if (need_comma)
fputc (',', asm_out_file);
fputs (\"d3\", asm_out_file);
need_comma = 1;
}
if (regs_ever_live[6])
{
if (need_comma)
fputc (',', asm_out_file);
fputs (\"a2\", asm_out_file);
need_comma = 1;
}
if (regs_ever_live[7])
{
if (need_comma)
fputc (',', asm_out_file);
fputs (\"a3\", asm_out_file);
need_comma = 1;
}
fputs (\"],(sp)\\n\", asm_out_file);
return \"\";
}" }"
[(set_attr "cc" "clobber")]) [(set_attr "cc" "clobber")])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment