[llvm-bugs] [Bug 28892] New: AVX512: fmsub intrinsic generates fmadd instruction

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Aug 7 12:07:25 PDT 2016


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

            Bug ID: 28892
           Summary: AVX512: fmsub intrinsic generates fmadd instruction
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: wenzel.jakob at epfl.ch
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Consider the following simple snippet which uses the fused multiply subtract
instruction on AVX512 and AVX:

=============

#include <immintrin.h>

__m512 test(__m512 a, __m512 b, __m512 c) {
    return _mm512_fmsub_ps(a, b, c);
}

__m256 test(__m256 a, __m256 b, __m256 c) {
    return _mm256_fmsub_ps(a, b, c);
}

=============

In the AVX512 case, LLVM trunk generates the following weird code which does a
sign flip first followed by a FMADD instruction. The AVX backend, in
comparison, generates the expected (single FMADD instruction).

__Z4testDv16_fS_S_:
    vpxord    LCPI0_0(%rip), %zmm2, %zmm2
    vfmadd213ps    %zmm2, %zmm1, %zmm0
    retq

__Z4testDv8_fS_S_:
    vfmsub213ps    %ymm2, %ymm1, %ymm0
    retq

-- 
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/20160807/ca506cdb/attachment.html>


More information about the llvm-bugs mailing list