On Tue, May 07, 2019 at 09:48:13AM +0200, Richard Biener wrote:
> Will leave the "correctness check" for other folks but the above is
> better written as
> 
> +   (outer_op (inner_op @0 REAL_CST@1) REAL_CST@2)
> +    (if (real_zerop (@1)
> +         && real_zerop (@2)
> 
> because that gets code-generated better.  Btw, for -fsignalling-nans

Ok, will change.  I want to introduce uniform_real_cst_p similar to
uniform_integer_cst_p incrementally and then it will change again.

> can we have a literal sNaN?  Then you need :c on the inner_op since
> I'm not sure we canonicalize to sNaN + 0.0 rather than 0.0 + sNaN.

I had :c on both initially, but that doesn't compile, because MINUS_EXPR
is not commutative.  And I wanted to avoid writing 4 patterns instead of 1.

> Maybe not worth optimizing though (since we rule out -frounding-math
> a similar case there doesn't need to be considered).
> 
> > +    && HONOR_SIGNED_ZEROS (element_mode (type))
> > +    && !HONOR_SIGN_DEPENDENT_ROUNDING (element_mode (type)))
> 
> You can write HONOR_SIGNED_ZEROS (type) here for brevity.

Ok, will do (and change it then in fold_real_zero_addition_p as well).

        Jakub

Reply via email to