public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98429] New: Some FMA expressions are evaluated less efficiently when -ffast-math is active
@ 2020-12-23 17:22 chtz at informatik dot uni-bremen.de
  2021-01-05  9:45 ` [Bug middle-end/98429] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: chtz at informatik dot uni-bremen.de @ 2020-12-23 17:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98429
           Summary: Some FMA expressions are evaluated less efficiently
                    when -ffast-math is active
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chtz at informatik dot uni-bremen.de
  Target Milestone: ---

If you compile an expression like

    x - x*y

using fast-math optimizations it appears to get re-arranged to 

   x*(1-y)

which is (probably) never more efficient than the original expression,
especially if the target supports FMA operations.

Simple godbolt demonstration: https://godbolt.org/z/4q1oj9

(This is very likely not C++ specific, but I'm not sure what the correct
component is -- I also just tried this for AVX-FMA)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-06 18:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-23 17:22 [Bug c++/98429] New: Some FMA expressions are evaluated less efficiently when -ffast-math is active chtz at informatik dot uni-bremen.de
2021-01-05  9:45 ` [Bug middle-end/98429] " rguenth at gcc dot gnu.org
2021-09-06 18:35 ` pinskia at gcc dot gnu.org
2021-09-06 18:37 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).