public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/95060] New: vfnmsub132ps is not generated with -ffast-math
@ 2020-05-11 15:07 ubizjak at gmail dot com
  2020-05-11 15:12 ` [Bug tree-optimization/95060] " ubizjak at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: ubizjak at gmail dot com @ 2020-05-11 15:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95060
           Summary: vfnmsub132ps is not generated with -ffast-math
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ubizjak at gmail dot com
  Target Milestone: ---

Following testcase:

--cut here--
float r[8], a[8], b[8], c[8];

void
test_fnms (void)
{
  for (int i = 0; i < 8; i++)
    r[i] = -(a[i] * b[i]) - c[i];
}
--cut here--

compiles on x86_64 with "-O3 -mfma" to

        vmovaps b(%rip), %ymm0
        vmovaps c(%rip), %ymm1
        vfnmsub132ps    a(%rip), %ymm1, %ymm0
        vmovaps %ymm0, r(%rip)
        vzeroupper
        ret

However, when -ffast-math is added, negation gets moved out of the insn:

        vmovaps b(%rip), %ymm0
        vmovaps c(%rip), %ymm1
        vfmadd132ps     a(%rip), %ymm1, %ymm0
->      vxorps  .LC0(%rip), %ymm0, %ymm0
        vmovaps %ymm0, r(%rip)
        vzeroupper
        ret

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

end of thread, other threads:[~2021-08-10 23:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11 15:07 [Bug tree-optimization/95060] New: vfnmsub132ps is not generated with -ffast-math ubizjak at gmail dot com
2020-05-11 15:12 ` [Bug tree-optimization/95060] " ubizjak at gmail dot com
2020-05-11 19:49 ` jakub at gcc dot gnu.org
2020-05-12  6:56 ` rguenth at gcc dot gnu.org
2020-05-12 10:21 ` jakub at gcc dot gnu.org
2020-05-13  9:21 ` cvs-commit at gcc dot gnu.org
2020-05-13  9:23 ` jakub at gcc dot gnu.org
2021-08-10 23:13 ` 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).