(define_split
[(parallel
- [(set (mem (plus:SI
- (mult:SI (match_operand:SI 0 "register_operand" "")
- (match_operand:SI 1 "const_int_operand" ""))
- (match_operand:SI 2 "register_operand" "")))
+ [(set (match_operator
+ 6 "cris_mem_op"
+ [(plus:SI
+ (mult:SI (match_operand:SI 0 "register_operand" "")
+ (match_operand:SI 1 "const_int_operand" ""))
+ (match_operand:SI 2 "register_operand" ""))])
(match_operand 3 "register_operand" ""))
(set (match_operand:SI 4 "register_operand" "")
(plus:SI (mult:SI (match_dup 0)
(match_dup 1))
(match_dup 4)))]
"operands[5]
- = gen_rtx_MEM (GET_MODE (operands[3]),
- gen_rtx_PLUS (SImode,
- gen_rtx_MULT (SImode,
- operands[0], operands[1]),
- operands[2]));")
+ = replace_equiv_address (operands[6],
+ gen_rtx_PLUS (SImode,
+ gen_rtx_MULT (SImode,
+ operands[0],
+ operands[1]),
+ operands[2]));")
\f
;; move.s rx,[ry=rz+i]
;; FIXME: These could have anonymous mode for operand 2.
(define_split
[(parallel
- [(set (mem (plus:SI
- (match_operand:SI 0 "cris_bdap_operand" "")
- (match_operand:SI 1 "cris_bdap_operand" "")))
+ [(set (match_operator
+ 4 "cris_mem_op"
+ [(plus:SI
+ (match_operand:SI 0 "cris_bdap_operand" "")
+ (match_operand:SI 1 "cris_bdap_operand" ""))])
(match_operand 2 "register_operand" ""))
(set (match_operand:SI 3 "register_operand" "")
(plus:SI (match_dup 0) (match_dup 1)))])]
[(set (match_dup 4) (match_dup 2))
(set (match_dup 3) (match_dup 0))
(set (match_dup 3) (plus:SI (match_dup 3) (match_dup 1)))]
- "operands[4]
- = gen_rtx_MEM (GET_MODE (operands[2]),
- gen_rtx_PLUS (SImode, operands[0], operands[1]));")
+ "")
\f
;; Clear memory side-effect patterns. It is hard to get to the mode if
;; the MEM was anonymous, so there will be one for each mode.
else
abort ();
- operands[0] = gen_rtx_MEM (GET_MODE (operands[0]), op0);
+ operands[0] = replace_equiv_address (operands[0], op0);
}
}
}")
else
abort ();
- operands[1] = gen_rtx_MEM (GET_MODE (operands[1]), op1);
+ operands[1] = replace_equiv_address (operands[1], op1);
}
}
}")
(define_split
[(parallel
[(set (match_operand 0 "register_operand" "")
- (mem (plus:SI
- (mult:SI (match_operand:SI 1 "register_operand" "")
- (match_operand:SI 2 "const_int_operand" ""))
- (match_operand:SI 3 "register_operand" ""))))
+ (match_operator
+ 6 "cris_mem_op"
+ [(plus:SI
+ (mult:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "const_int_operand" ""))
+ (match_operand:SI 3 "register_operand" ""))]))
(set (match_operand:SI 4 "register_operand" "")
(plus:SI (mult:SI (match_dup 1)
(match_dup 2))
[(set (match_dup 4) (plus:SI (mult:SI (match_dup 1) (match_dup 2))
(match_dup 3)))
(set (match_dup 0) (match_dup 5))]
- "operands[5] = gen_rtx_MEM (GET_MODE (operands[0]), operands[3]);")
+ "operands[5] = replace_equiv_address (operands[6], operands[3]);")
;; move.S1 [rx=rx+i],ry
(define_split
[(parallel
[(set (match_operand 0 "register_operand" "")
- (mem
- (plus:SI (match_operand:SI 1 "cris_bdap_operand" "")
- (match_operand:SI 2 "cris_bdap_operand" ""))))
+ (match_operator
+ 5 "cris_mem_op"
+ [(plus:SI (match_operand:SI 1 "cris_bdap_operand" "")
+ (match_operand:SI 2 "cris_bdap_operand" ""))]))
(set (match_operand:SI 3 "register_operand" "")
(plus:SI (match_dup 1)
(match_dup 2)))])]
|| rtx_equal_p (operands[3], operands[2]))"
[(set (match_dup 3) (plus:SI (match_dup 1) (match_dup 2)))
(set (match_dup 0) (match_dup 4))]
- "operands[4] = gen_rtx_MEM (GET_MODE (operands[0]), operands[3]);")
+ "operands[4] = replace_equiv_address (operands[5], operands[3]);")
;; move.S1 ry,[rx=rx+rz.S2]
(define_split
[(parallel
- [(set (mem (plus:SI
- (mult:SI (match_operand:SI 0 "register_operand" "")
- (match_operand:SI 1 "const_int_operand" ""))
- (match_operand:SI 2 "register_operand" "")))
- (match_operand 3 "register_operand" ""))
+ [(set (match_operator
+ 6 "cris_mem_op"
+ [(plus:SI
+ (mult:SI (match_operand:SI 0 "register_operand" "")
+ (match_operand:SI 1 "const_int_operand" ""))
+ (match_operand:SI 2 "register_operand" ""))])
+ (match_operand 3 "register_operand" ""))
(set (match_operand:SI 4 "register_operand" "")
(plus:SI (mult:SI (match_dup 0)
(match_dup 1))
[(set (match_dup 4) (plus:SI (mult:SI (match_dup 0) (match_dup 1))
(match_dup 2)))
(set (match_dup 5) (match_dup 3))]
- "operands[5] = gen_rtx_MEM (GET_MODE (operands[3]), operands[4]);")
+ "operands[5] = replace_equiv_address (operands[6], operands[4]);")
;; move.S1 ry,[rx=rx+i]
(define_split
[(parallel
- [(set (mem
- (plus:SI (match_operand:SI 0 "cris_bdap_operand" "")
- (match_operand:SI 1 "cris_bdap_operand" "")))
- (match_operand 2 "register_operand" ""))
+ [(set (match_operator
+ 6 "cris_mem_op"
+ [(plus:SI (match_operand:SI 0 "cris_bdap_operand" "")
+ (match_operand:SI 1 "cris_bdap_operand" ""))])
+ (match_operand 2 "register_operand" ""))
(set (match_operand:SI 3 "register_operand" "")
(plus:SI (match_dup 0)
(match_dup 1)))])]
|| rtx_equal_p (operands[3], operands[1]))"
[(set (match_dup 3) (plus:SI (match_dup 0) (match_dup 1)))
(set (match_dup 5) (match_dup 2))]
- "operands[5] = gen_rtx_MEM (GET_MODE (operands[2]), operands[3]);")
+ "operands[5] = replace_equiv_address (operands[6], operands[3]);")
;; clear.d [rx=rx+rz.S2]
[(set (match_dup 4) (plus:SI (mult:SI (match_dup 1) (match_dup 2))
(match_dup 3)))
(set (match_dup 0) (match_op_dup 5 [(match_dup 6)]))]
- "operands[6] = gen_rtx_MEM (GET_MODE (XEXP (operands[5],0)),
- operands[4]);")
+ "operands[6] = replace_equiv_address (XEXP (operands[5], 0), operands[4]);")
;; mov(s|u).S1 [rx=rx+i],ry
|| rtx_equal_p (operands[2], operands[3]))"
[(set (match_dup 3) (plus:SI (match_dup 1) (match_dup 2)))
(set (match_dup 0) (match_op_dup 4 [(match_dup 5)]))]
- "operands[5] = gen_rtx_MEM (GET_MODE (XEXP (operands[4], 0)),
- operands[3]);")
+ "operands[5] = replace_equiv_address (XEXP (operands[4], 0), operands[3]);")
;; op.S1 [rx=rx+i],ry
|| rtx_equal_p (operands[4], operands[3]))"
[(set (match_dup 4) (plus:SI (match_dup 2) (match_dup 3)))
(set (match_dup 0) (match_op_dup 5 [(match_dup 1) (match_dup 6)]))]
- "operands[6] = gen_rtx_MEM (GET_MODE (operands[0]), operands[4]);")
+ "operands[6] = replace_equiv_address (XEXP (operands[5], 1), operands[4]);")
;; op.S1 [rx=rx+rz.S2],ry
[(set (match_dup 5) (plus:SI (mult:SI (match_dup 2) (match_dup 3))
(match_dup 4)))
(set (match_dup 0) (match_op_dup 6 [(match_dup 1) (match_dup 7)]))]
- "operands[7] = gen_rtx_MEM (GET_MODE (operands[0]), operands[5]);")
+ "operands[7] = replace_equiv_address (XEXP (operands[6], 1), operands[5]);")
;; op.S1 [rx=rx+rz.S2],ry (swapped)
[(set (match_dup 5) (plus:SI (mult:SI (match_dup 2) (match_dup 3))
(match_dup 4)))
(set (match_dup 0) (match_op_dup 6 [(match_dup 7) (match_dup 1)]))]
- "operands[7] = gen_rtx_MEM (GET_MODE (operands[0]), operands[5]);")
+ "operands[7] = replace_equiv_address (XEXP (operands[6], 0), operands[5]);")
;; op.S1 [rx=rx+i],ry (swapped)
|| rtx_equal_p (operands[4], operands[3]))"
[(set (match_dup 4) (plus:SI (match_dup 2) (match_dup 3)))
(set (match_dup 0) (match_op_dup 5 [(match_dup 6) (match_dup 1)]))]
- "operands[6] = gen_rtx_MEM (GET_MODE (operands[0]), operands[4]);")
+ "operands[6] = replace_equiv_address (XEXP (operands[5], 0), operands[4]);")
;; op(s|u).S1 [rx=rx+rz.S2],ry
(match_dup 4)))
(set (match_dup 0) (match_op_dup 6 [(match_dup 1) (match_dup 8)]))]
"operands[8] = gen_rtx (GET_CODE (operands[7]), GET_MODE (operands[7]),
- gen_rtx_MEM (GET_MODE (XEXP (operands[7], 0)),
- operands[5]));")
+ replace_equiv_address (XEXP (operands[7], 0),
+ operands[5]));")
;; op(s|u).S1 [rx=rx+i],ry
[(set (match_dup 4) (plus:SI (match_dup 2) (match_dup 3)))
(set (match_dup 0) (match_op_dup 5 [(match_dup 1) (match_dup 7)]))]
"operands[7] = gen_rtx (GET_CODE (operands[6]), GET_MODE (operands[6]),
- gen_rtx_MEM (GET_MODE (XEXP (operands[6], 0)),
- operands[4]));")
+ replace_equiv_address (XEXP (operands[6], 0),
+ operands[4]));")
;; op(s|u).S1 [rx=rx+rz.S2],ry (swapped, plus or bound)
(match_dup 4)))
(set (match_dup 0) (match_op_dup 6 [(match_dup 8) (match_dup 1)]))]
"operands[8] = gen_rtx (GET_CODE (operands[6]), GET_MODE (operands[6]),
- gen_rtx_MEM (GET_MODE (XEXP (operands[6], 0)),
- operands[5]));")
+ replace_equiv_address (XEXP (operands[6], 0),
+ operands[5]));")
;; op(s|u).S1 [rx=rx+i],ry (swapped, plus or bound)
[(set (match_dup 4) (plus:SI (match_dup 2) (match_dup 3)))
(set (match_dup 0) (match_op_dup 6 [(match_dup 7) (match_dup 1)]))]
"operands[7] = gen_rtx (GET_CODE (operands[5]), GET_MODE (operands[5]),
- gen_rtx_MEM (GET_MODE (XEXP (operands[5], 0)),
- operands[4]));")
+ replace_equiv_address (XEXP (operands[5], 0),
+ operands[4]));")
\f
;; Splits for addressing prefixes that have no side-effects, so we can
;; fill a delay slot. Never split if we lose something, though.
[(set (match_dup 2) (match_dup 4))
(set (match_dup 0) (match_dup 3))]
"operands[2] = gen_rtx_REG (Pmode, REGNO (operands[0]));
- operands[3] = gen_rtx_MEM (GET_MODE (operands[0]), operands[2]);
+ operands[3] = replace_equiv_address (operands[1], operands[2]);
operands[4] = XEXP (operands[1], 0);")
;; As the above, but MOVS and MOVU.
[(set (match_dup 2) (match_dup 5))
(set (match_dup 0) (match_op_dup 4 [(match_dup 3)]))]
"operands[2] = gen_rtx_REG (Pmode, REGNO (operands[0]));
- operands[3] = gen_rtx_MEM (GET_MODE (XEXP (operands[4], 0)), operands[2]);
+ operands[3] = replace_equiv_address (XEXP (operands[4], 0), operands[2]);
operands[5] = XEXP (operands[1], 0);")
\f
;; Various peephole optimizations.