This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/60962] b+(-2.f)*a generates multiplication instruction while b-2.f*a simplifies to addition&subtraction


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60962

--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Mon, 26 Sep 2016, rguenth at gcc dot gnu.org wrote:

>       /* We want to canonicalize to positive real constants.  Pretend
>          that only negative ones can be easily negated.  */
> 
> is that we don't transform x + -2.*y to x - 2.*y (which in this case would
> also pessimize code, but well...).

Note that such a transformation is invalid if flag_rounding_math.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]