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

            Bug ID: 91250
           Summary: Missed optimization: is not used vfnmsub213ss
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zamazan4ik at tut dot by
  Target Milestone: ---

For this code:

float foo(float a, float b, float c)
{
    return a * -b - c;
}


gcc(trunk) with '-O3 -ffast-math -march=haswell' produces this:


foo(float, float, float):
        vfmadd132ss     xmm0, xmm2, xmm1
        vxorps  xmm0, xmm0, XMMWORD PTR .LC0[rip]
        ret


clang (trunk) with '-O3 -ffast-math -march=haswell' produces this:


foo(float, float, float):
        vfnmsub213ss    xmm0, xmm1, xmm2 # xmm0 = -(xmm1 * xmm0) - xmm2
        ret


Note: playground on godbolt - https://godbolt.org/z/NTMVdg

Reply via email to