[llvm-bugs] [Bug 47464] New: [x86] After 16f3d698f2af, -march=amdfam10 incorrectly implies SSSE3 instructions

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 8 10:06:04 PDT 2020


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

            Bug ID: 47464
           Summary: [x86] After 16f3d698f2af, -march=amdfam10 incorrectly
                    implies SSSE3 instructions
           Product: new-bugs
           Version: 11.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dimitry at andric.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

After https://reviews.llvm.org/D83273 /
https://github.com/llvm/llvm-project/commit/16f3d698f2af ("[X86] Move
the feature dependency handling in X86TargetInfo::setFeatureEnabledImpl
to a table based lookup in X86TargetParser.cpp"), compiling with
-march=amdfam10 incorrectly starts using SSSE3 instructions, in particular
pshufb.

Test case:

#include <xmmintrin.h>

__m128i foo(unsigned char c) {
  return _mm_set1_epi8(c);
}

Asm output before:

foo:                                    # @foo
        .cfi_startproc
# %bb.0:                                # %entry
        movd    %edi, %xmm0
        punpcklbw       %xmm0, %xmm0            # xmm0 =
xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
        pshuflw $224, %xmm0, %xmm0              # xmm0 = xmm0[0,0,2,3,4,5,6,7]
        pshufd  $0, %xmm0, %xmm0                # xmm0 = xmm0[0,0,0,0]
        retq

After:

foo:                                    # @foo
        .cfi_startproc
# %bb.0:                                # %entry
        movd    %edi, %xmm0
        pxor    %xmm1, %xmm1
        pshufb  %xmm1, %xmm0
        retq

Apparently
https://github.com/llvm/llvm-project/commit/16f3d698f2afbbea43e0c3df81df6f2a640ce806#diff-045a11495d5fad4e01af59c60f6a387aR500
makes SSE4_A now imply SSSE3, which is not correct (at least not always, I
think).

-- 
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/20200908/b3ca1d5b/attachment.html>


More information about the llvm-bugs mailing list