mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-21 14:30:14 +08:00
simplify-rtx.c (simplify_plus_minus): Do simplify constants.
* simplify-rtx.c (simplify_plus_minus): Do simplify constants. Delete dead code. From-SVN: r107840
This commit is contained in:
parent
728cdd0872
commit
36686ad6c0
@ -1,3 +1,8 @@
|
||||
2005-12-02 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* simplify-rtx.c (simplify_plus_minus): Do simplify constants.
|
||||
Delete dead code.
|
||||
|
||||
2005-12-01 Richard Henderson <rth@redhat.com>
|
||||
|
||||
* optabs.c (expand_vec_cond_expr): Use EXPAND_NORMAL.
|
||||
|
@ -2602,7 +2602,7 @@ simplify_plus_minus (enum rtx_code code, enum machine_mode mode, rtx op0,
|
||||
{
|
||||
struct simplify_plus_minus_op_data ops[8];
|
||||
rtx result, tem;
|
||||
int n_ops = 2, input_ops = 2, input_consts = 0, n_consts;
|
||||
int n_ops = 2, input_ops = 2;
|
||||
int first, changed, canonicalized = 0;
|
||||
int i, j;
|
||||
|
||||
@ -2661,7 +2661,6 @@ simplify_plus_minus (enum rtx_code code, enum machine_mode mode, rtx op0,
|
||||
ops[n_ops].op = XEXP (XEXP (this_op, 0), 1);
|
||||
ops[n_ops].neg = this_neg;
|
||||
n_ops++;
|
||||
input_consts++;
|
||||
changed = 1;
|
||||
canonicalized = 1;
|
||||
}
|
||||
@ -2699,7 +2698,16 @@ simplify_plus_minus (enum rtx_code code, enum machine_mode mode, rtx op0,
|
||||
|
||||
gcc_assert (n_ops >= 2);
|
||||
if (!canonicalized)
|
||||
return NULL_RTX;
|
||||
{
|
||||
int n_constants = 0;
|
||||
|
||||
for (i = 0; i < n_ops; i++)
|
||||
if (GET_CODE (ops[i].op) == CONST_INT)
|
||||
n_constants++;
|
||||
|
||||
if (n_constants <= 1)
|
||||
return NULL_RTX;
|
||||
}
|
||||
|
||||
/* If we only have two operands, we can avoid the loops. */
|
||||
if (n_ops == 2)
|
||||
@ -2728,11 +2736,6 @@ simplify_plus_minus (enum rtx_code code, enum machine_mode mode, rtx op0,
|
||||
return simplify_const_binary_operation (code, mode, lhs, rhs);
|
||||
}
|
||||
|
||||
/* Count the number of CONSTs we didn't split above. */
|
||||
for (i = 0; i < n_ops; i++)
|
||||
if (GET_CODE (ops[i].op) == CONST)
|
||||
input_consts++;
|
||||
|
||||
/* Now simplify each pair of operands until nothing changes. The first
|
||||
time through just simplify constants against each other. */
|
||||
|
||||
@ -2835,12 +2838,6 @@ simplify_plus_minus (enum rtx_code code, enum machine_mode mode, rtx op0,
|
||||
n_ops--;
|
||||
}
|
||||
|
||||
/* Count the number of CONSTs that we generated. */
|
||||
n_consts = 0;
|
||||
for (i = 0; i < n_ops; i++)
|
||||
if (GET_CODE (ops[i].op) == CONST)
|
||||
n_consts++;
|
||||
|
||||
/* Put a non-negated operand first, if possible. */
|
||||
|
||||
for (i = 0; i < n_ops && ops[i].neg; i++)
|
||||
|
Loading…
Reference in New Issue
Block a user