[llvm-bugs] [Bug 36846] New: -std=gnu11 behaves different than gcc wrt FMA

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 21 05:53:04 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=36846

            Bug ID: 36846
           Summary: -std=gnu11 behaves different than gcc wrt FMA
           Product: new-bugs
           Version: 5.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: arjanvandeven at gmail.com
                CC: llvm-bugs at lists.llvm.org

gcc allows the compiler to use FMA with -std=gnu11 (and its friends) while LLVM
seems to be much more conservative and not emit FMA.

double foo2(double A, double B, double C)
{
        double D;

        D = A * B + C;

        return D;
}

generates with "clang -O3 -std=gnu11 -march=native -c -S foo.c"

        vmulsd  %xmm1, %xmm0, %xmm0
        vaddsd  %xmm2, %xmm0, %xmm0
        retq

while gcc generates with "gcc -O3 -std=gnu11 -march=native -c -S foo.c"

        vfmadd132sd     %xmm1, %xmm2, %xmm0
        ret

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180321/fabe7ac9/attachment.html>


More information about the llvm-bugs mailing list