<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/56161>56161</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Building BLAKE3 assembler implementation fails on MacOS
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Bu11etmagnet
      </td>
    </tr>
</table>

<pre>
    After `[acd64d8e85f69467c64af833ef6b38b807bd9b4b] [Support/BLAKE3] CMake: Check for 'IS_X64' or 'CMAKE_OSX_ARCHITECTURES' before adding the assembly files`, building on a Mac Mini (Mid 2011, Core i5, MacOS 10.13.6 High Sierra) doesn't work anymore:

```
FAILED: lib/Support/BLAKE3/CMakeFiles/LLVMSupportBlake3.dir/blake3_avx512_x86-64_unix.S.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -DGTEST_HAS_RTTI=0 -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/csaba/wk/llvm-project/__build/lib/Support/BLAKE3 -I/Users/csaba/wk/llvm-project/llvm/lib/Support/BLAKE3 -I/Users/csaba/wk/llvm-project/__build/include -I/Users/csaba/wk/llvm-project/llvm/include -fPIC -O3 -DNDEBUG -MD -MT lib/Support/BLAKE3/CMakeFiles/LLVMSupportBlake3.dir/blake3_avx512_x86-64_unix.S.o -MF lib/Support/BLAKE3/CMakeFiles/LLVMSupportBlake3.dir/blake3_avx512_x86-64_unix.S.o.d -o lib/Support/BLAKE3/CMakeFiles/LLVMSupportBlake3.dir/blake3_avx512_x86-64_unix.S.o -c /Users/csaba/wk/llvm-project/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S
/Users/csaba/wk/llvm-project/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S:56:9: error: instruction requires: AVX-512 ISA
        kmovw k1, r9d
        ^
/Users/csaba/wk/llvm-project/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S:66:9: error: instruction requires: AVX-512 ISA AVX-512 VL ISA
        vpcmpltud k2, ymm2, ymm0
        ^
/Users/csaba/wk/llvm-project/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S:67:9: error: instruction requires: AVX-512 ISA AVX-512 VL ISA
        vpcmpltud k3, ymm3, ymm0
        ^
/Users/csaba/wk/llvm-project/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S:68:21: error: unexpected token in argument list
        vpaddd ymm4 {k2}, ymm4, dword ptr [ADD1+rip] {1to8}
                    ^
/Users/csaba/wk/llvm-project/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S:69:21: error: unexpected token in argument list
        vpaddd ymm5 {k3}, ymm5, dword ptr [ADD1+rip] {1to8}
                    ^
/Users/csaba/wk/llvm-project/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S:70:9: error: instruction requires: AVX-512 ISA
        knotw k2, k1
        ^
```

It was working perfectly fine until then. The commit was found by `git bisect`; versions before that still compile.

```
$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -v
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
``` 


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzVV1tz6jYQ_jXmRYPHlm_wwIPBcMIUTjqxk8mbR7ZkUJEt15Yh-fddGZOEpj3TdpK0NSBkXXb325VWnzJJn2dhoViDDN8yvDnJqe_SCZt4hT91_SD3XVJMHIcVfuZMsokVZHSauZnhRQiGx11dy0YZeDXfhD8tHd282JIDM5wQLfYsP6BCgmwcrOP00Xehgs7viy2MT2_jxzS8W9ysk-Uiub9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