aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-02-07 01:24:09 +0000
committerRichard Stallman <rms@gnu.org>1993-02-07 01:24:09 +0000
commit3ceb5ed36caa09099afa64291397c9ca9c5bc462 (patch)
tree665405f3f70edacad196a142d91f7240c3a6102a /gcc
parent6a5bbbe6b815b84e45e0a017b087c2d92516bc82 (diff)
downloadgcc-3ceb5ed36caa09099afa64291397c9ca9c5bc462.zip
gcc-3ceb5ed36caa09099afa64291397c9ca9c5bc462.tar.gz
gcc-3ceb5ed36caa09099afa64291397c9ca9c5bc462.tar.bz2
(movqi): For special case of moving byte to stack, push into low byte and then copy to high byte.
(movqi): For special case of moving byte to stack, push into low byte and then copy to high byte. For case of moving to/from address reg, exchange it with d0. From-SVN: r3433
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/m68k/m68k.md30
1 files changed, 7 insertions, 23 deletions
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index 98e0b73..5fac2b9 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -922,36 +922,20 @@
xoperands[2]
= gen_rtx (MEM, QImode,
gen_rtx (PLUS, VOIDmode, stack_pointer_rtx, const1_rtx));
- xoperands[3] = stack_pointer_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 (\"subq%.w %#2,%3\;move%.b %1,%2\", xoperands);
+ output_asm_insn (\"move%.b %1,%-\;move%.b %@,%2\", xoperands);
return \"\";
}
+ /* Moving a byte into an address register is not possible. */
+ /* Use d0 as an intermediate, but don't clobber its contents. */
if (ADDRESS_REG_P (operands[0]) && GET_CODE (operands[1]) == MEM)
- {
- xoperands[1] = operands[1];
- xoperands[2]
- = gen_rtx (MEM, QImode,
- gen_rtx (PLUS, VOIDmode, stack_pointer_rtx, const1_rtx));
- xoperands[3] = stack_pointer_rtx;
- /* Just pushing a byte puts it in the high byte of the halfword. */
- /* We must put it in the low half, the second byte. */
- output_asm_insn (\"subq%.w %#2,%3\;move%.b %1,%2\", xoperands);
- return \"move%.w %+,%0\";
- }
+ return \"exg %/d0,%0\;move%.b %1,%/d0\;exg %/d0,%0\";
+ /* Likewise for moving from an address reg. */
if (ADDRESS_REG_P (operands[1]) && GET_CODE (operands[0]) == MEM)
- {
- xoperands[0] = operands[0];
- xoperands[1] = operands[1];
- xoperands[2]
- = gen_rtx (MEM, QImode,
- gen_rtx (PLUS, VOIDmode, stack_pointer_rtx, const1_rtx));
- xoperands[3] = stack_pointer_rtx;
- output_asm_insn (\"move%.w %1,%-\;move%.b %2,%0\;addq%.w %#2,%3\", xoperands);
- return \"\";
- }
+ return \"exg %/d0,%1\;move%.b %/d0,%0\;exg %/d0,%1\";
+
/* clr and st insns on 68000 read before writing.
This isn't so on the 68010, but we have no alternative for it. */
if (TARGET_68020