Commit 3ceb5ed3 by Richard Stallman

(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
parent 6a5bbbe6
...@@ -922,36 +922,20 @@ ...@@ -922,36 +922,20 @@
xoperands[2] xoperands[2]
= gen_rtx (MEM, QImode, = gen_rtx (MEM, QImode,
gen_rtx (PLUS, VOIDmode, stack_pointer_rtx, const1_rtx)); 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. */ /* Just pushing a byte puts it in the high byte of the halfword. */
/* We must put it in the low-order, high-numbered byte. */ /* 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 \"\"; 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) if (ADDRESS_REG_P (operands[0]) && GET_CODE (operands[1]) == MEM)
{ return \"exg %/d0,%0\;move%.b %1,%/d0\;exg %/d0,%0\";
xoperands[1] = operands[1]; /* Likewise for moving from an address reg. */
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\";
}
if (ADDRESS_REG_P (operands[1]) && GET_CODE (operands[0]) == MEM) if (ADDRESS_REG_P (operands[1]) && GET_CODE (operands[0]) == MEM)
{ return \"exg %/d0,%1\;move%.b %/d0,%0\;exg %/d0,%1\";
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 \"\";
}
/* clr and st insns on 68000 read before writing. /* clr and st insns on 68000 read before writing.
This isn't so on the 68010, but we have no alternative for it. */ This isn't so on the 68010, but we have no alternative for it. */
if (TARGET_68020 if (TARGET_68020
......
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