]> git.ipfire.org Git - thirdparty/gcc.git/commit
* fold-const.c (negate_expr_p): MULT_EXPRs and RDIV_EXPRs are easy
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Aug 2003 20:53:26 +0000 (20:53 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Aug 2003 20:53:26 +0000 (20:53 +0000)
commita12ecaaad932850913429daf0f59addb4ddd2d2b
tree9a1c805b0d9f0abdd6f5f935e7f53f0fb1091c08
parent080e0ef544623575bf3f2c7d209d5170bbe4573c
* fold-const.c (negate_expr_p): MULT_EXPRs and RDIV_EXPRs are easy
to negate if either operand is easy to negate, if we don't care
about sign-dependent rounding.
(negate_expr): Make the logic to negate a REAL_CST explicit.
Attempt to negate a MULT_EXPR or RDIV_EXPR by negating an operand
that's easy to negate, if we don't honor sign-dependent rounding.
(fold <MULT_EXPR>): Optimize -A * B as A * -B if B is easy to
negate, and the symmetric A * -B as -A * B if A is easy to negate.
(fold <RDIV_EXPR>): Likewise, optimize -A/B and C/-D as A/-B and
-C/D if B and C are cheap to negate.  Add an explicit rule to
optimize X/-1.0 as -X when we don't care about signaling NaNs.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70455 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/fold-const.c