optimization request: (-a)*(-b) => a*b

N8TM@aol.com N8TM@aol.com
Wed Mar 31 23:46:00 GMT 1999


In a message dated 3/4/99 6:22:17 AM Pacific Standard Time,
Sylvain.Pion@sophia.inria.fr writes:

<< If a is a NaN, then -a is a NaN too, and all comparisons involving a NaN
 return false (except (NaN == NaN) and (NaN != NaN)).>>

I see that you are correct, that this case need not be lumped with those
others.

 < -(a*b) is not valid, but (-a)*(-b) => a*b is. >>

Compilers have avoided such optimizations possibly because they were not
necessarily valid on pre-IEEE architectures; now that 2's complement floating
point has become extinct it may be interesting to reconsider.



More information about the Gcc mailing list