aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-04-13 15:15:21 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1997-04-13 15:15:21 -0400
commit3879920c646985bca78fc35a716c600a640173b6 (patch)
tree3344a273468d434d8e51a42f4d4d4c0ff5d65527 /gcc
parent5716e6452827c805240fbede43b6f82a4f6a914f (diff)
downloadgcc-3879920c646985bca78fc35a716c600a640173b6.zip
gcc-3879920c646985bca78fc35a716c600a640173b6.tar.gz
gcc-3879920c646985bca78fc35a716c600a640173b6.tar.bz2
(output_move_qimode): Optimize pushing one byte if the source operand
does not use the stack pointer. From-SVN: r13891
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/m68k/m68k.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 59b9315..f0c1714 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -1508,7 +1508,17 @@ output_move_qimode (operands)
gen_rtx (PLUS, VOIDmode, stack_pointer_rtx, const1_rtx));
/* Just pushing a byte puts it in the high byte of the halfword. */
/* We must put it in the low-order, high-numbered byte. */
- output_asm_insn ("move%.b %1,%-\n\tmove%.b %@,%2", xoperands);
+ if (!reg_mentioned_p (stack_pointer_rtx, operands[1]))
+ {
+ xoperands[3] = stack_pointer_rtx;
+#ifndef NO_ADDSUB_Q
+ output_asm_insn ("subq%.l %#2,%3\n\tmove%.b %1,%2", xoperands);
+#else
+ output_asm_insn ("sub%.l %#2,%3\n\tmove%.b %1,%2", xoperands);
+#endif
+ }
+ else
+ output_asm_insn ("move%.b %1,%-\n\tmove%.b %@,%2", xoperands);
return "";
}