David Edelsohn <edelsohn@gnu.org>
PR rtl-optimization/25662
* optabs.c (simplify_expand_binop): Use simplify_binary_operation
for constant operands instead of simplify_gen_binary.
* simplify-rtx.c (simplify_gen_binary): Swap commutative operands
after trying simplify_binary_operation
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109456
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-01-07 Ian Lance Taylor <ian@airs.com>
+ David Edelsohn <edelsohn@gnu.org>
+
+ PR rtl-optimization/25662
+ * optabs.c (simplify_expand_binop): Use simplify_binary_operation
+ for constant operands instead of simplify_gen_binary.
+ * simplify-rtx.c (simplify_gen_binary): Swap commutative operands
+ after trying simplify_binary_operation
+
2006-01-06 Daniel Berlin <dberlin@dberlin.org>
* tree.c (iterative_hash_expr): Hash decls based on UID.
enum optab_methods methods)
{
if (CONSTANT_P (op0) && CONSTANT_P (op1))
- return simplify_gen_binary (binoptab->code, mode, op0, op1);
- else
- return expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods);
+ {
+ rtx x = simplify_binary_operation (binoptab->code, mode, op0, op1);
+
+ if (x)
+ return x;
+ }
+
+ return expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods);
}
/* Like simplify_expand_binop, but always put the result in TARGET.
{
rtx tem;
- /* Put complex operands first and constants second if commutative. */
- if (GET_RTX_CLASS (code) == RTX_COMM_ARITH
- && swap_commutative_operands_p (op0, op1))
- tem = op0, op0 = op1, op1 = tem;
-
/* If this simplifies, do it. */
tem = simplify_binary_operation (code, mode, op0, op1);
if (tem)
return tem;
+ /* Put complex operands first and constants second if commutative. */
+ if (GET_RTX_CLASS (code) == RTX_COMM_ARITH
+ && swap_commutative_operands_p (op0, op1))
+ tem = op0, op0 = op1, op1 = tem;
+
return gen_rtx_fmt_ee (code, mode, op0, op1);
}
\f