simplify-rtx.c (simplify_binary_operation): x * 1 is allowed when not honoring signalling NaNs.

2002-08-02  Toon Moene  <toon@moene.indiv.nluug.nl>

	* simplify-rtx.c (simplify_binary_operation): x * 1 is allowed
	when not honoring signalling NaNs.
	(simplify_ternary_operation): a == b has a definite value
	when not honoring NaNs.

From-SVN: r55980
This commit is contained in:
Toon Moene 2002-08-02 13:01:31 +02:00 committed by Toon Moene
parent b9d8832d73
commit e3e16ee37d
2 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2002-08-02 Toon Moene <toon@moene.indiv.nluug.nl>
* simplify-rtx.c (simplify_binary_operation): x * 1 is allowed
when not honoring signalling NaNs.
(simplify_ternary_operation): a == b has a definite value
when not honoring NaNs.
2002-08-02 Jason Merrill <jason@redhat.com>
* gdbinit.in (pct): New macro.

View File

@ -1169,10 +1169,10 @@ simplify_binary_operation (code, mode, op0, op1)
&& ! side_effects_p (op0))
return op1;
/* In IEEE floating point, x*1 is not equivalent to x for nans.
However, ANSI says we can drop signals,
so we can do this anyway. */
if (trueop1 == CONST1_RTX (mode))
/* In IEEE floating point, x*1 is not equivalent to x for
signalling NaNs. */
if (!HONOR_SNANS (mode)
&& trueop1 == CONST1_RTX (mode))
return op0;
/* Convert multiply by constant power of two into shift unless
@ -2193,12 +2193,12 @@ simplify_ternary_operation (code, mode, op0_mode, op0, op1, op2)
/* Convert a == b ? b : a to "a". */
if (GET_CODE (op0) == NE && ! side_effects_p (op0)
&& (! FLOAT_MODE_P (mode) || flag_unsafe_math_optimizations)
&& !HONOR_NANS (mode)
&& rtx_equal_p (XEXP (op0, 0), op1)
&& rtx_equal_p (XEXP (op0, 1), op2))
return op1;
else if (GET_CODE (op0) == EQ && ! side_effects_p (op0)
&& (! FLOAT_MODE_P (mode) || flag_unsafe_math_optimizations)
&& !HONOR_NANS (mode)
&& rtx_equal_p (XEXP (op0, 1), op1)
&& rtx_equal_p (XEXP (op0, 0), op2))
return op2;