Commit 00d0458c by Stephane Carrez Committed by Stephane Carrez

m68hc11.md ("movdi", [...]): Use an expand to emit the pattern; put a REG_INC…

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
parent d74e9142
2001-07-20 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* 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 <Stephane.Carrez@worldnet.fr>
* config/m68hc11/m68hc11.c (m68hc11_gen_highpart): Don't use
gen_highpart.
......
......@@ -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"))]
......@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment