diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1996-03-26 09:49:56 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1996-03-26 09:49:56 -0500 |
commit | 02ed0c07c543650bbcee9842fc5ed0a299f04d07 (patch) | |
tree | 7e6a04f4b31c83427708f1bf62539653c67d3133 /gcc | |
parent | cab70741feebc002179fff778cb6ac8ed4b26f2e (diff) | |
download | gcc-02ed0c07c543650bbcee9842fc5ed0a299f04d07.zip gcc-02ed0c07c543650bbcee9842fc5ed0a299f04d07.tar.gz gcc-02ed0c07c543650bbcee9842fc5ed0a299f04d07.tar.bz2 |
(output_move_simode_const): New function.
(singlemove_string): Call it.
From-SVN: r11619
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/m68k/m68k.c | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index 2daf05d..8da249d 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -1158,6 +1158,34 @@ output_move_const_into_data_reg (operands) } } +char * +output_move_simode_const (operands) + rtx *operands; +{ + if (operands[1] == const0_rtx + && (DATA_REG_P (operands[0]) + || GET_CODE (operands[0]) == MEM) + /* clr insns on 68000 read before writing. + This isn't so on the 68010, but we have no alternative for it. */ + && (TARGET_68020 + || !(GET_CODE (operands[0]) == MEM + && MEM_VOLATILE_P (operands[0])))) + return "clr%.l %0"; + else if (DATA_REG_P (operands[0])) + return output_move_const_into_data_reg (operands); + else if (ADDRESS_REG_P (operands[0]) + && INTVAL (operands[1]) < 0x8000 + && INTVAL (operands[1]) >= -0x8000) + return "move%.w %1,%0"; + else if (GET_CODE (operands[0]) == MEM + && GET_CODE (XEXP (operands[0], 0)) == PRE_DEC + && REGNO (XEXP (XEXP (operands[0], 0), 0)) == STACK_POINTER_REGNUM + && INTVAL (operands[1]) < 0x8000 + && INTVAL (operands[1]) >= -0x8000) + return "pea %a1"; + return "move%.l %1,%0"; +} + /* Return the best assembler insn template for moving operands[1] into operands[0] as a fullword. */ @@ -1169,14 +1197,9 @@ singlemove_string (operands) if (FPA_REG_P (operands[0]) || FPA_REG_P (operands[1])) return "fpmoves %1,%0"; #endif - if (DATA_REG_P (operands[0]) - && GET_CODE (operands[1]) == CONST_INT) - return output_move_const_into_data_reg (operands); - if (operands[1] != const0_rtx) - return "move%.l %1,%0"; - if (! ADDRESS_REG_P (operands[0])) - return "clr%.l %0"; - return "sub%.l %0,%0"; + if (GET_CODE (operands[1]) == CONST_INT) + return output_move_simode_const (operands); + return "move%.l %1,%0"; } |