From: Jim Wilson Date: Tue, 17 Sep 1996 19:08:58 +0000 (-0700) Subject: New define_splits to recombine output from LEGITIMIZE_ADDRESS. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=653bd7a66072795b40b00ad455bdfd2d0ba75d43;p=gcc.git New define_splits to recombine output from LEGITIMIZE_ADDRESS. From-SVN: r12729 --- diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index 9e9fd9481d4..729884c3bc4 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -1709,6 +1709,61 @@ FAIL; }") +;; If a base address generated by LEGITIMIZE_ADDRESS for SImode is +;; used only once, let combine add in the index again. + +(define_split + [(set (match_operand:SI 0 "register_operand" "") + (match_operand:SI 1 "" "")) + (clobber (match_operand 2 "register_operand" ""))] + "! reload_in_progress && ! reload_completed" + [(use (reg:SI 0))] + " +{ + rtx addr, reg, const_int; + + if (GET_CODE (operands[1]) != MEM) + FAIL; + addr = XEXP (operands[1], 0); + if (GET_CODE (addr) != PLUS) + FAIL; + reg = XEXP (addr, 0); + const_int = XEXP (addr, 1); + if (GET_CODE (reg) != REG || GET_CODE (const_int) != CONST_INT) + FAIL; + emit_move_insn (operands[2], const_int); + emit_move_insn (operands[0], + change_address (operands[1], VOIDmode, + gen_rtx (PLUS, SImode, reg, operands[2]))); + DONE; +}") + +(define_split + [(set (match_operand:SI 1 "" "") + (match_operand:SI 0 "register_operand" "")) + (clobber (match_operand 2 "register_operand" ""))] + "! reload_in_progress && ! reload_completed" + [(use (reg:SI 0))] + " +{ + rtx addr, reg, const_int; + + if (GET_CODE (operands[1]) != MEM) + FAIL; + addr = XEXP (operands[1], 0); + if (GET_CODE (addr) != PLUS) + FAIL; + reg = XEXP (addr, 0); + const_int = XEXP (addr, 1); + if (GET_CODE (reg) != REG || GET_CODE (const_int) != CONST_INT) + FAIL; + emit_move_insn (operands[2], const_int); + emit_move_insn (change_address (operands[1], VOIDmode, + gen_rtx (PLUS, SImode, reg, operands[2])), + operands[0]); + DONE; +}") + (define_expand "movdf" [(set (match_operand:DF 0 "general_movdst_operand" "") (match_operand:DF 1 "general_movsrc_operand" ""))]