From: Stephane Carrez Date: Fri, 20 Jul 2001 19:43:19 +0000 (+0200) Subject: m68hc11.md ("movdi", [...]): Use an expand to emit the pattern; put a REG_INC note... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=00d0458c03fc77ca4d52412d47b23a09106e3696;p=gcc.git m68hc11.md ("movdi", [...]): Use an expand to emit the pattern; put a REG_INC note for push/pop instructions. * config/m68hc11/m68hc11.md ("movdi", "movdi_internal"): Use an expand to emit the pattern; put a REG_INC note for push/pop instructions. ("movdf", "movdf_internal"): Likewise. ("movsi", "movsi_internal"): Likewise. ("movsf", "movsf_internal"): Likewise. ("movhi", "movqi"): Emit a REG_INC note for push/pop instructions. From-SVN: r44208 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f19c5f8266a..b73cd6657d1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2001-07-20 Stephane Carrez + + * config/m68hc11/m68hc11.md ("movdi", "movdi_internal"): Use an + expand to emit the pattern; put a REG_INC note for push/pop + instructions. + ("movdf", "movdf_internal"): Likewise. + ("movsi", "movsi_internal"): Likewise. + ("movsf", "movsf_internal"): Likewise. + ("movhi", "movqi"): Emit a REG_INC note for push/pop instructions. + 2001-07-20 Stephane Carrez * config/m68hc11/m68hc11.c (m68hc11_gen_highpart): Don't use diff --git a/gcc/config/m68hc11/m68hc11.md b/gcc/config/m68hc11/m68hc11.md index f5992049563..e75f1add31d 100644 --- a/gcc/config/m68hc11/m68hc11.md +++ b/gcc/config/m68hc11/m68hc11.md @@ -587,7 +587,28 @@ ;; The insn will be split in one or several memory moves (movw). ;; [SCz: this does not work ?? So, I switched temporary to 'd' reg] ;;-------------------------------------------------------------------- -(define_insn "movdi" +(define_expand "movdi" + [(parallel [(set (match_operand:DI 0 "nonimmediate_operand" "") + (match_operand:DI 1 "general_operand" "")) + (clobber (match_scratch:HI 2 ""))])] + "" + " + /* For push/pop, emit a REG_INC note to make sure the reload + inheritance and reload CSE pass notice the change of the stack + pointer. */ + if (IS_STACK_PUSH (operands[0]) || IS_STACK_POP (operands[1])) + { + rtx insn; + + insn = emit_insn (gen_movdi_internal (operands[0], operands[1])); + REG_NOTES (insn) = alloc_EXPR_LIST (REG_INC, + stack_pointer_rtx, + REG_NOTES (insn)); + DONE; + } +") + +(define_insn "movdi_internal" [(set (match_operand:DI 0 "nonimmediate_operand" "=U,!u,U,m,m,!u") (match_operand:DI 1 "general_operand" "iU,iU,!u,mi,!u,!mu")) (clobber (match_scratch:HI 2 "=&d,&d,&d,&d,&d,&d"))] @@ -603,7 +624,27 @@ "m68hc11_split_move (operands[0], operands[1], operands[2]); DONE;") -(define_insn "movdf" +(define_expand "movdf" + [(parallel [(set (match_operand:DF 0 "nonimmediate_operand" "") + (match_operand:DF 1 "general_operand" "")) + (clobber (match_scratch:HI 2 ""))])] + "" + "/* For push/pop, emit a REG_INC note to make sure the reload + inheritance and reload CSE pass notice the change of the stack + pointer. */ + if (IS_STACK_PUSH (operands[0]) || IS_STACK_POP (operands[1])) + { + rtx insn; + + insn = emit_insn (gen_movdf_internal (operands[0], operands[1])); + REG_NOTES (insn) = alloc_EXPR_LIST (REG_INC, + stack_pointer_rtx, + REG_NOTES (insn)); + DONE; + } +") + +(define_insn "movdf_internal" [(set (match_operand:DF 0 "nonimmediate_operand" "=U,!u,U,m,m,!u") (match_operand:DF 1 "general_operand" "iU,iU,!u,mi,!u,!mu")) (clobber (match_scratch:HI 2 "=&d,&d,&d,&d,&d,&d"))] @@ -618,7 +659,7 @@ [(const_int 0)] "m68hc11_split_move (operands[0], operands[1], operands[2]); DONE;") - + ;;-------------------------------------------------------------------- ;;- 32-bit Move Operations. ;; The movsi and movsf patterns are identical except for the mode. @@ -628,7 +669,27 @@ ;; pass does not give us a register that dies in the insn and is used ;; for input/output operands. ;;-------------------------------------------------------------------- -(define_insn "movsi" +(define_expand "movsi" + [(parallel [(set (match_operand:SI 0 "nonimmediate_operand" "") + (match_operand:SI 1 "general_operand" "")) + (clobber (match_scratch:HI 2 ""))])] + "" + "/* For push/pop, emit a REG_INC note to make sure the reload + inheritance and reload CSE pass notice the change of the stack + pointer. */ + if (IS_STACK_PUSH (operands[0]) || IS_STACK_POP (operands[1])) + { + rtx insn; + + insn = emit_insn (gen_movsi_internal (operands[0], operands[1])); + REG_NOTES (insn) = alloc_EXPR_LIST (REG_INC, + stack_pointer_rtx, + REG_NOTES (insn)); + DONE; + } +") + +(define_insn "movsi_internal" [(set (match_operand:SI 0 "nonimmediate_operand" "=mu,?D,m,?D,?u,?u,!u,D") (match_operand:SI 1 "general_operand" "imu,im,?D,!u,?D,mi,!u,!D")) (clobber (match_scratch:HI 2 "=&d,X,X,X,X,&d,&d,X"))] @@ -644,7 +705,27 @@ "m68hc11_split_move (operands[0], operands[1], operands[2]); DONE;") -(define_insn "movsf" +(define_expand "movsf" + [(parallel [(set (match_operand:SF 0 "nonimmediate_operand" "") + (match_operand:SF 1 "general_operand" "")) + (clobber (match_scratch:HI 2 ""))])] + "" + "/* For push/pop, emit a REG_INC note to make sure the reload + inheritance and reload CSE pass notice the change of the stack + pointer. */ + if (IS_STACK_PUSH (operands[0]) || IS_STACK_POP (operands[1])) + { + rtx insn; + + insn = emit_insn (gen_movsf_internal (operands[0], operands[1])); + REG_NOTES (insn) = alloc_EXPR_LIST (REG_INC, + stack_pointer_rtx, + REG_NOTES (insn)); + DONE; + } +") + +(define_insn "movsf_internal" [(set (match_operand:SF 0 "nonimmediate_operand" "=m,D,m,D,!u,!u,!u,D") (match_operand:SF 1 "general_operand" "im,im,D,!u,D,mi,!u,!D")) (clobber (match_scratch:HI 2 "=&d,X,X,X,X,&d,&d,X"))] @@ -739,6 +820,19 @@ operands[1] = force_reg (HImode, operands[1]); } } + /* For push/pop, emit a REG_INC note to make sure the reload + inheritance and reload CSE pass notice the change of the stack + pointer. */ + if (IS_STACK_PUSH (operands[0]) || IS_STACK_POP (operands[1])) + { + rtx insn; + + insn = emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1])); + REG_NOTES (insn) = alloc_EXPR_LIST (REG_INC, + stack_pointer_rtx, + REG_NOTES (insn)); + DONE; + } }") (define_insn "movhi_const0" @@ -866,6 +960,19 @@ operands[1] = force_reg (QImode, operands[1]); } } + /* For push/pop, emit a REG_INC note to make sure the reload + inheritance and reload CSE pass notice the change of the stack + pointer. */ + if (IS_STACK_PUSH (operands[0]) || IS_STACK_POP (operands[1])) + { + rtx insn; + + insn = emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1])); + REG_NOTES (insn) = alloc_EXPR_LIST (REG_INC, + stack_pointer_rtx, + REG_NOTES (insn)); + DONE; + } }") (define_insn "*movqi_68hc12"