Commit 4ba5f925 by Jan Hubicka Committed by Jan Hubicka

combine.c (combine_simplify_rtx): Attempt to simplify a*(b/c) as (a*b)/c for…

combine.c (combine_simplify_rtx): Attempt to simplify a*(b/c) as (a*b)/c for floats in unsafe_math mode.

	* combine.c (combine_simplify_rtx): Attempt to simplify
	a*(b/c) as (a*b)/c for floats in unsafe_math mode.

	* simplify-rtx.c (avoid_constatn_pool_reference): New static function.
	(simplify_binary_operation, simplify_unary_operation,
	 simplify_relational_operation): Use it.

	* combine.c (combine_simplify_rtx): Don't do associative law
	on divisions; allow associative law on floats.

From-SVN: r44073
parent 3aa8ab7b
Tue Jul 17 16:56:05 CEST 2001 Jan Hubicka <jh@suse.cz>
* combine.c (combine_simplify_rtx): Attempt to simplify
a*(b/c) as (a*b)/c for floats in unsafe_math mode.
* simplify-rtx.c (avoid_constatn_pool_reference): New static function.
(simplify_binary_operation, simplify_unary_operation,
simplify_relational_operation): Use it.
* combine.c (combine_simplify_rtx): Don't do associative law
on divisions; allow associative law on floats.
2001-07-17 H.J. Lu <hjl@gnu.org>
Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
......
......@@ -3724,9 +3724,9 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
if they are logically related (i.e. (a & b) & a). */
if ((code == PLUS || code == MINUS
|| code == MULT || code == AND || code == IOR || code == XOR
|| code == DIV || code == UDIV
|| code == SMAX || code == SMIN || code == UMAX || code == UMIN)
&& INTEGRAL_MODE_P (mode))
&& (INTEGRAL_MODE_P (mode)
|| (flag_unsafe_math_optimizations && FLOAT_MODE_P (mode))))
{
if (GET_CODE (XEXP (x, 0)) == code)
{
......@@ -4231,6 +4231,16 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
if (GET_CODE (x) != MULT)
return x;
}
/* Try simplify a*(b/c) as (a*b)/c. */
if (FLOAT_MODE_P (mode) && flag_unsafe_math_optimizations
&& GET_CODE (XEXP (x, 0)) == DIV)
{
rtx tem = simplify_binary_operation (MULT, mode,
XEXP (XEXP (x, 0), 0),
XEXP (x, 1));
if (tem)
return gen_binary (DIV, mode, tem, XEXP (XEXP (x, 0), 1));
}
break;
case UDIV:
......
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