* config/cris/cris.md (define_split "*mov_sidesi_biap_mem"+1)
(define_splits "*mov_sidesi_mem"+1, "casesi"+9, +10, +11, +12):
Use cris_mem_op and replace_equiv_address, not gen_rtx_MEM.
("call", "call_value", define_split "*mov_sidesi_mem"+19, +20)
(define_split "*mov_sidesi_mem"+21, +22, +23, +24, +25, +26, +27)
(define_split "*mov_sidesi_mem"+28, +29, +30): Use
replace_equiv_address, not gen_rtx_MEM.
* config/cris/cris.c (cris_mem_op): New match_operator function.
* config/cris/cris.h (PREDICATE_CODES): Add cris_mem_op.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72521
138bc75d-0d04-0410-961f-
82ee72b054a4
+2003-10-15 Hans-Peter Nilsson <hp@axis.com>
+
+ PR target/12598
+ * config/cris/cris.md (define_split "*mov_sidesi_biap_mem"+1)
+ (define_splits "*mov_sidesi_mem"+1, "casesi"+9, +10, +11, +12):
+ Use cris_mem_op and replace_equiv_address, not gen_rtx_MEM.
+ ("call", "call_value", define_split "*mov_sidesi_mem"+19, +20)
+ (define_split "*mov_sidesi_mem"+21, +22, +23, +24, +25, +26, +27)
+ (define_split "*mov_sidesi_mem"+28, +29, +30): Use
+ replace_equiv_address, not gen_rtx_MEM.
+ * config/cris/cris.c (cris_mem_op): New match_operator function.
+ * config/cris/cris.h (PREDICATE_CODES): Add cris_mem_op.
+
2003-10-15 Bernardo Innocenti <bernie@develer.com>
* config/m68k/m68k.h (MASK_SEP_DATA, TARGET_SEP_DATA,
2003-10-15 Bernardo Innocenti <bernie@develer.com>
* config/m68k/m68k.h (MASK_SEP_DATA, TARGET_SEP_DATA,
(GET_MODE (x) == mode && (code == UMIN || code == PLUS));
}
(GET_MODE (x) == mode && (code == UMIN || code == PLUS));
}
+/* Used as an operator to get a handle on a already-known-valid MEM rtx:es
+ (no need to validate the address), where some address expression parts
+ have their own match_operand. */
+
+int
+cris_mem_op (rtx x, enum machine_mode mode)
+{
+ if (mode == VOIDmode)
+ mode = GET_MODE (x);
+
+ return GET_MODE (x) == mode && GET_CODE (x) == MEM;
+}
+
/* Since with -fPIC, not all symbols are valid PIC symbols or indeed
general_operands, we have to have a predicate that matches it for the
"movsi" expander. */
/* Since with -fPIC, not all symbols are valid PIC symbols or indeed
general_operands, we have to have a predicate that matches it for the
"movsi" expander. */
value1=rz and value2=[rx] */
cc_status.value1 = XEXP (XVECEXP (exp, 0, 0), 0);
cc_status.value2
value1=rz and value2=[rx] */
cc_status.value1 = XEXP (XVECEXP (exp, 0, 0), 0);
cc_status.value2
- = gen_rtx_MEM (GET_MODE (XEXP (XVECEXP (exp, 0, 0), 0)),
- XEXP (XVECEXP (exp, 0, 1), 0));
+ = replace_equiv_address (XEXP (XVECEXP (exp, 0, 0), 1),
+ XEXP (XVECEXP (exp, 0, 1), 0));
cc_status.flags = 0;
/* Huh? A side-effect cannot change the destination
cc_status.flags = 0;
/* Huh? A side-effect cannot change the destination
{ZERO_EXTEND, SIGN_EXTEND}}, \
{"cris_plus_or_bound_operator", \
{PLUS, UMIN}}, \
{ZERO_EXTEND, SIGN_EXTEND}}, \
{"cris_plus_or_bound_operator", \
{PLUS, UMIN}}, \
+ {"cris_mem_op", \
+ {MEM}}, \
{"cris_bdap_operand", \
{SUBREG, REG, LABEL_REF, SYMBOL_REF, MEM, CONST_INT, \
CONST_DOUBLE, CONST, SIGN_EXTEND}}, \
{"cris_bdap_operand", \
{SUBREG, REG, LABEL_REF, SYMBOL_REF, MEM, CONST_INT, \
CONST_DOUBLE, CONST, SIGN_EXTEND}}, \
- [(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_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]
(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.
\f
;; move.s rx,[ry=rz+i]
;; FIXME: These could have anonymous mode for operand 2.
- [(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)))])]
(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)))]
[(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.
\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.
- operands[0] = gen_rtx_MEM (GET_MODE (operands[0]), op0);
+ operands[0] = replace_equiv_address (operands[0], op0);
- 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" "")
(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_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))]
[(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" "")
;; 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)))])]
(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))]
|| 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
;; 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_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))]
[(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
;; 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)))])]
(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))]
|| 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]);")
[(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)]))]
[(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
;; 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)]))]
|| 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]);")
|| 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)]))]
|| 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
;; 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)]))]
[(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)
;; 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)]))]
[(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)
;; 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)]))]
|| 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
;; 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]),
(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
;; 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]),
[(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)
;; 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]),
(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)
;; 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]),
[(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.
\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]));
[(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.
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]));
[(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.
operands[5] = XEXP (operands[1], 0);")
\f
;; Various peephole optimizations.