Commit e1d5ee28 by Ulrich Weigand Committed by Ulrich Weigand

s390-protos.h (preferred_la_operand_p): Adapt prototype.

	* config/s390/s390-protos.h (preferred_la_operand_p): Adapt prototype.
	* config/s390/s390.c (preferred_la_operand_p): Accept two operands
	instead of one.  Check for strictly legitimate address.
	* config/s390/s390.md ("*la_31"/"*la_64" peepholes): Adapt call
	to preferred_la_operand_p, do not call gen_rtx_PLUS in predicate.

From-SVN: r86278
parent 19114537
2004-08-19 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/s390-protos.h (preferred_la_operand_p): Adapt prototype.
* config/s390/s390.c (preferred_la_operand_p): Accept two operands
instead of one. Check for strictly legitimate address.
* config/s390/s390.md ("*la_31"/"*la_64" peepholes): Adapt call
to preferred_la_operand_p, do not call gen_rtx_PLUS in predicate.
2004-08-19 Eric Christopher <echristo@redhat.com> 2004-08-19 Eric Christopher <echristo@redhat.com>
* langhooks-def.h (LANG_HOOKS_UNSAVE_EXPR_NOW): Remove. * langhooks-def.h (LANG_HOOKS_UNSAVE_EXPR_NOW): Remove.
......
...@@ -58,7 +58,7 @@ extern void s390_emit_jump (rtx, rtx); ...@@ -58,7 +58,7 @@ extern void s390_emit_jump (rtx, rtx);
extern int symbolic_reference_mentioned_p (rtx); extern int symbolic_reference_mentioned_p (rtx);
extern int tls_symbolic_reference_mentioned_p (rtx); extern int tls_symbolic_reference_mentioned_p (rtx);
extern int legitimate_la_operand_p (rtx); extern int legitimate_la_operand_p (rtx);
extern int preferred_la_operand_p (rtx); extern int preferred_la_operand_p (rtx, rtx);
extern int legitimate_pic_operand_p (rtx); extern int legitimate_pic_operand_p (rtx);
extern int legitimate_constant_p (rtx); extern int legitimate_constant_p (rtx);
extern int legitimate_reload_constant_p (rtx); extern int legitimate_reload_constant_p (rtx);
......
...@@ -2495,14 +2495,22 @@ legitimate_la_operand_p (register rtx op) ...@@ -2495,14 +2495,22 @@ legitimate_la_operand_p (register rtx op)
return FALSE; return FALSE;
} }
/* Return 1 if OP is a valid operand for the LA instruction, /* Return 1 if it is valid *and* preferrable to use LA to
and we prefer to use LA over addition to compute it. */ compute the sum of OP1 and OP2. */
int int
preferred_la_operand_p (register rtx op) preferred_la_operand_p (rtx op1, rtx op2)
{ {
struct s390_address addr; struct s390_address addr;
if (!s390_decompose_address (op, &addr))
if (op2 != const0_rtx)
op1 = gen_rtx_PLUS (Pmode, op1, op2);
if (!s390_decompose_address (op1, &addr))
return FALSE;
if (addr.base && !REG_OK_FOR_BASE_STRICT_P (addr.base))
return FALSE;
if (addr.indx && !REG_OK_FOR_INDEX_STRICT_P (addr.indx))
return FALSE; return FALSE;
if (!TARGET_64BIT && !addr.pointer) if (!TARGET_64BIT && !addr.pointer)
......
...@@ -971,8 +971,7 @@ ...@@ -971,8 +971,7 @@
(match_operand:QI 1 "address_operand" "")) (match_operand:QI 1 "address_operand" ""))
(clobber (reg:CC 33))])] (clobber (reg:CC 33))])]
"TARGET_64BIT "TARGET_64BIT
&& strict_memory_address_p (VOIDmode, operands[1]) && preferred_la_operand_p (operands[1], const0_rtx)"
&& preferred_la_operand_p (operands[1])"
[(set (match_dup 0) (match_dup 1))] [(set (match_dup 0) (match_dup 1))]
"") "")
...@@ -986,8 +985,7 @@ ...@@ -986,8 +985,7 @@
(clobber (reg:CC 33))])] (clobber (reg:CC 33))])]
"TARGET_64BIT "TARGET_64BIT
&& !reg_overlap_mentioned_p (operands[0], operands[2]) && !reg_overlap_mentioned_p (operands[0], operands[2])
&& strict_memory_address_p (VOIDmode, gen_rtx_PLUS (DImode, operands[1], operands[2])) && preferred_la_operand_p (operands[1], operands[2])"
&& preferred_la_operand_p (gen_rtx_PLUS (DImode, operands[1], operands[2]))"
[(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))] [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
"") "")
...@@ -1113,8 +1111,7 @@ ...@@ -1113,8 +1111,7 @@
(match_operand:QI 1 "address_operand" "")) (match_operand:QI 1 "address_operand" ""))
(clobber (reg:CC 33))])] (clobber (reg:CC 33))])]
"!TARGET_64BIT "!TARGET_64BIT
&& strict_memory_address_p (VOIDmode, operands[1]) && preferred_la_operand_p (operands[1], const0_rtx)"
&& preferred_la_operand_p (operands[1])"
[(set (match_dup 0) (match_dup 1))] [(set (match_dup 0) (match_dup 1))]
"") "")
...@@ -1128,8 +1125,7 @@ ...@@ -1128,8 +1125,7 @@
(clobber (reg:CC 33))])] (clobber (reg:CC 33))])]
"!TARGET_64BIT "!TARGET_64BIT
&& !reg_overlap_mentioned_p (operands[0], operands[2]) && !reg_overlap_mentioned_p (operands[0], operands[2])
&& strict_memory_address_p (VOIDmode, gen_rtx_PLUS (SImode, operands[1], operands[2])) && preferred_la_operand_p (operands[1], operands[2])"
&& preferred_la_operand_p (gen_rtx_PLUS (SImode, operands[1], operands[2]))"
[(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))] [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]
"") "")
......
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