<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 - clang-cl doesn't correctly map /arch:XXX options to corresponding features"
   href="https://bugs.llvm.org/show_bug.cgi?id=51480">51480</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-cl doesn't correctly map /arch:XXX options to corresponding features
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>peterghost86@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>While compiling for XNNPACK with Clang, the following error will be raised.

2021-08-15T04:34:10.8521621Z
C:\actions-runner\_work\XNNPACK\src\f32-dwconv2d-chw\gen\3x3p1-minmax-ssse3-2x4.c(100,48):
error: '__builtin_ia32_palignr128' needs target feature ssse3
2021-08-15T04:34:10.8523468Z       const __m128 vi0x3456 =
_mm_castsi128_ps(_mm_alignr_epi8(_mm_castps_si128(vi0x4567),
_mm_castps_si128(vi0x0123), 12));
2021-08-15T04:34:10.8524281Z                                                ^
2021-08-15T04:34:10.8525139Z
C:\PROGRA~1\LLVM\lib\clang\14.0.0\include\tmmintrin.h(148,13): note: expanded
from macro '_mm_alignr_epi8'
2021-08-15T04:34:10.8526120Z  
((__m128i)__builtin_ia32_palignr128((__v16qi)(__m128i)(a), \

However, the code compiles and links with MSVC cl.exe. To workaround it, I have
to pass `-clang:-mssse3` which shouldn't be needed.

Additional info
CMake script that sets the arch flags for different compilers:
<a href="https://github.com/google/XNNPACK/blob/79cd5f9e18ad0925ac9a050b00ea5a36230072db/CMakeLists.txt#L3504-L3531">https://github.com/google/XNNPACK/blob/79cd5f9e18ad0925ac9a050b00ea5a36230072db/CMakeLists.txt#L3504-L3531</a></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>