diff options
author | Richard Stallman <rms@gnu.org> | 1993-03-20 06:54:26 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-03-20 06:54:26 +0000 |
commit | 2bb3413d31c03a097df9dd8015a430aa9cdb1926 (patch) | |
tree | 17d4ac9cb2add049b79b90e893d93cd6fb33673f | |
parent | 14a8d078590eb7741732ef43040347cd8e531371 (diff) | |
download | gcc-2bb3413d31c03a097df9dd8015a430aa9cdb1926.zip gcc-2bb3413d31c03a097df9dd8015a430aa9cdb1926.tar.gz gcc-2bb3413d31c03a097df9dd8015a430aa9cdb1926.tar.bz2 |
(movqi): In address reg case, if d0
appears in the address, use d1 instead as intermediate reg.
From-SVN: r3797
-rw-r--r-- | gcc/config/m68k/m68k.md | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index dc8c45a..c31ba9b2 100644 --- a/gcc/config/m68k/m68k.md +++ b/gcc/config/m68k/m68k.md @@ -931,10 +931,24 @@ /* 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) - 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. */ 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. This isn't so on the 68010, but we have no alternative for it. */ |