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
This commit is contained in:
Jeffrey A Law 1998-08-12 16:41:11 +00:00 committed by Jeff Law
parent 6e755043dd
commit 980d0e8162
3 changed files with 75 additions and 3 deletions

View File

@ -1,5 +1,10 @@
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"
optimizations.

View File

@ -39,7 +39,10 @@ Boston, MA 02111-1307, USA. */
/* 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
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
asm_file_start (file)

View File

@ -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")])
@ -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")])