diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1996-04-12 23:23:05 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1996-04-12 23:23:05 +0000 |
commit | b9393aaf182f82dfaaabe434163ee2a7ce188cee (patch) | |
tree | 318e62a2d2a1912dd62bc63c2b71acef37ed46e5 /gcc/config/h8300 | |
parent | 2c7be64385cb918fe6eb7b648657214b5d6c6907 (diff) | |
download | gcc-b9393aaf182f82dfaaabe434163ee2a7ce188cee.tar.gz |
* h8300/h8300.c (dosize): Remove unused "fped" argument. All callers
changed. Handle add/sub of 5-8 bytes efficiently on the h8300h.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11708 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/h8300')
-rw-r--r-- | gcc/config/h8300/h8300.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index 062912b9f7a..2d8fc53c18f 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -121,15 +121,23 @@ byte_reg (x, b) /* Output assembly language to FILE for the operation OP with operand size SIZE to adjust the stack pointer. */ -/* ??? FPED is currently unused. */ static void -dosize (file, op, size, fped) +dosize (file, op, size) FILE *file; char *op; unsigned int size; - int fped; { + /* On the h8300h, for sizes <= 8 bytes it is as good or + better to use adds/subs insns rather than add.l/sub.l + with an immediate value. */ + if (size > 4 && size <= 8 && TARGET_H8300H) + { + /* Crank the size down to <= 4 */ + fprintf (file, "\t%ss\t#%d,sp\n", op, 4); + size -= 4; + } + switch (size) { case 4: @@ -208,7 +216,7 @@ function_prologue (file, size) h8_reg_names[FRAME_POINTER_REGNUM]); /* leave room for locals */ - dosize (file, "sub", fsize, 1); + dosize (file, "sub", fsize); /* Push the rest of the registers */ for (idx = 0; idx < FIRST_PSEUDO_REGISTER; idx++) @@ -221,7 +229,7 @@ function_prologue (file, size) } else { - dosize (file, "sub", fsize, 0); + dosize (file, "sub", fsize); for (idx = 0; idx < FIRST_PSEUDO_REGISTER; idx++) { int regno = push_order[idx]; @@ -265,7 +273,7 @@ function_epilogue (file, size) fprintf (file, "\t%s\t%s\n", h8_pop_op, h8_reg_names[regno]); } /* deallocate locals */ - dosize (file, "add", fsize, 1); + dosize (file, "add", fsize); /* pop frame pointer */ fprintf (file, "\t%s\t%s\n", h8_pop_op, h8_reg_names[FRAME_POINTER_REGNUM]); } @@ -279,7 +287,7 @@ function_epilogue (file, size) fprintf (file, "\t%s\t%s\n", h8_pop_op, h8_reg_names[regno]); } /* deallocate locals */ - dosize (file, "add", fsize, 0); + dosize (file, "add", fsize; } if (interrupt_handler) |