From: Richard Stallman Date: Sun, 7 Feb 1993 01:24:09 +0000 (+0000) Subject: (movqi): For special case of moving byte to stack, push into low byte and then copy... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3ceb5ed36caa09099afa64291397c9ca9c5bc462;p=gcc.git (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 --- diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index 98e0b734525..5fac2b9b67f 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