<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [x86] After 16f3d698f2af, -march=amdfam10 incorrectly implies SSSE3 instructions"
   href="https://bugs.llvm.org/show_bug.cgi?id=47464">47464</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[x86] After 16f3d698f2af, -march=amdfam10 incorrectly implies SSSE3 instructions
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dimitry@andric.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>After <a href="https://reviews.llvm.org/D83273">https://reviews.llvm.org/D83273</a> /
<a href="https://github.com/llvm/llvm-project/commit/16f3d698f2af">https://github.com/llvm/llvm-project/commit/16f3d698f2af</a> ("[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
<a href="https://github.com/llvm/llvm-project/commit/16f3d698f2afbbea43e0c3df81df6f2a640ce806#diff-045a11495d5fad4e01af59c60f6a387aR500">https://github.com/llvm/llvm-project/commit/16f3d698f2afbbea43e0c3df81df6f2a640ce806#diff-045a11495d5fad4e01af59c60f6a387aR500</a>
makes SSE4_A now imply SSSE3, which is not correct (at least not always, I
think).</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>