Commit 2bb3413d by Richard Stallman

(movqi): In address reg case, if d0

appears in the address, use d1 instead as intermediate reg.

From-SVN: r3797
parent 14a8d078
...@@ -931,10 +931,24 @@ ...@@ -931,10 +931,24 @@
/* Moving a byte into an address register is not possible. */ /* Moving a byte into an address register is not possible. */
/* Use d0 as an intermediate, but don't clobber its contents. */ /* 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\"; {
/* If the address of operand 1 uses d0, choose d1 as intermediate. */
if (refers_to_regno_p (0, 1, operands[1], NULL_RTX))
return \"exg %/d1,%0\;move%.b %1,%/d1\;exg %/d1,%0\";
/* Otherwise d0 is usable.
(An effective address on the 68k can't use two d-regs.) */
else
return \"exg %/d0,%0\;move%.b %1,%/d0\;exg %/d0,%0\";
}
/* Likewise for moving from an address reg. */ /* Likewise for moving from an address reg. */
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\"; {
if (refers_to_regno_p (0, 1, operands[0], NULL_RTX))
return \"exg %/d1,%1\;move%.b %/d1,%0\;exg %/d1,%1\";
else
return \"exg %/d0,%1\;move%.b %/d0,%0\;exg %/d0,%1\";
}
/* 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. */
......
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