Commit b42abad8 by Jeffrey A Law Committed by Jeff Law

simplify-rtx.c (simplify_rtx): Canonicalize commutative expressions by putting…

simplify-rtx.c (simplify_rtx): Canonicalize commutative expressions by putting complex operands first and...

        * simplify-rtx.c (simplify_rtx): Canonicalize commutative expressions
        by putting complex operands first and constants second.

From-SVN: r43621
parent 6dc04dec
Wed Jun 27 18:01:09 2001 Jeffrey A Law (law@cygnus.com)
* simplify-rtx.c (simplify_rtx): Canonicalize commutative expressions
by putting complex operands first and constants second.
2001-06-27 Gabriel Dos Reis <gdr@codesourcery.com> 2001-06-27 Gabriel Dos Reis <gdr@codesourcery.com>
* diagnostic.h: Add documentation. Make macros polymorphic. * diagnostic.h: Add documentation. Make macros polymorphic.
......
...@@ -2520,8 +2520,26 @@ simplify_rtx (x) ...@@ -2520,8 +2520,26 @@ simplify_rtx (x)
case '1': case '1':
return simplify_unary_operation (code, mode, return simplify_unary_operation (code, mode,
XEXP (x, 0), GET_MODE (XEXP (x, 0))); XEXP (x, 0), GET_MODE (XEXP (x, 0)));
case '2':
case 'c': case 'c':
/* Put complex operands first and constants second if commutative. */
if (GET_RTX_CLASS (code) == 'c'
&& ((CONSTANT_P (XEXP (x, 0)) && GET_CODE (XEXP (x, 1)) != CONST_INT)
|| (GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == 'o'
&& GET_RTX_CLASS (GET_CODE (XEXP (x, 1))) != 'o')
|| (GET_CODE (XEXP (x, 0)) == SUBREG
&& GET_RTX_CLASS (GET_CODE (SUBREG_REG (XEXP (x, 0)))) == 'o'
&& GET_RTX_CLASS (GET_CODE (XEXP (x, 1))) != 'o')))
{
rtx tem;
tem = XEXP (x, 0);
XEXP (x, 0) = XEXP (x, 1);
XEXP (x, 1) = tem;
return simplify_binary_operation (code, mode,
XEXP (x, 0), XEXP (x, 1));
}
case '2':
return simplify_binary_operation (code, mode, XEXP (x, 0), XEXP (x, 1)); return simplify_binary_operation (code, mode, XEXP (x, 0), XEXP (x, 1));
case '3': case '3':
......
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