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

    <tr>
        <th>Summary</th>
        <td>
            On Haswell: error: always_inline function '_mm512_setzero_si512' requires target feature 'evex512' while compiling nodejs 21.1.0
        </td>
    </tr>

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

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

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

<pre>
    Trying to compile nodejs 21.1.0 with c0a73918bfddc6a04a897aab57fb95e8d2da7ec0, I see the following AVX-512 related errors, my Haswell-EP clearly doesn't support these instructions.

```
./deps/simdutf/simdutf.cpp:18171:26: error: always_inline function '_mm512_setzero_si512' requires target feature 'evex512', but would be inlined into function 'detect_encodings' that is compiled without support for 'evex512'
 18171 |     __m512i currentmax = _mm512_setzero_si512();
       | ^
../deps/simdutf/simdutf.cpp:18171:26: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI
../deps/simdutf/simdutf.cpp:18173:20: error: always_inline function '_mm512_loadu_si512' requires target feature 'evex512', but would be inlined into function 'detect_encodings' that is compiled without support for 'evex512'
 18173 |       __m512i in = _mm512_loadu_si512((__m512i *)buf);
       | ^
../deps/simdutf/simdutf.cpp:18173:20: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI
../deps/simdutf/simdutf.cpp:18174:43: error: always_inline function '_mm512_set1_epi16' requires target feature 'evex512', but would be inlined into function 'detect_encodings' that is compiled without support for 'evex512'
 18174 |       __m512i diff = _mm512_sub_epi16(in, _mm512_set1_epi16(uint16_t(0xD800)));
       | ^
../deps/simdutf/simdutf.cpp:18174:43: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI
../deps/simdutf/simdutf.cpp:18174:22: error: always_inline function '_mm512_sub_epi16' requires target feature 'evex512', but would be inlined into function 'detect_encodings' that is compiled without support for 'evex512'
 18174 |       __m512i diff = _mm512_sub_epi16(in, _mm512_set1_epi16(uint16_t(0xD800)));
       | ^
../deps/simdutf/simdutf.cpp:18174:22: error: AVX vector argument of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI
../deps/simdutf/simdutf.cpp:18176:11: error: '__builtin_ia32_ucmpw512_mask' needs target feature avx512bw,evex512
 18176 |           _mm512_cmplt_epu16_mask(diff, _mm512_set1_epi16(uint16_t(0x0800)));
       | ^
/home/marcus/llvm18/lib/clang/18/include/avx512bwintrin.h:367:5: note: expanded from macro '_mm512_cmplt_epu16_mask'
  367 | _mm512_cmp_epu16_mask((A), (B), _MM_CMPINT_LT)
      | ^
/home/marcus/llvm18/lib/clang/18/include/avx512bwintrin.h:266:15: note: expanded from macro '_mm512_cmp_epu16_mask'
  266 | ((__mmask32)__builtin_ia32_ucmpw512_mask((__v32hi)(__m512i)(a), \
      | ^
../deps/simdutf/simdutf.cpp:18176:41: error: always_inline function '_mm512_set1_epi16' requires target feature 'evex512', but would be inlined into function 'detect_encodings' that is compiled without support for 'evex512'
 18176 |           _mm512_cmplt_epu16_mask(diff, _mm512_set1_epi16(uint16_t(0x0800)));
       | ^
../deps/simdutf/simdutf.cpp:18176:41: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI
../deps/simdutf/simdutf.cpp:18190:38: error: '__builtin_ia32_ucmpw512_mask' needs target feature avx512bw,evex512
 18190 |           __mmask32 highsurrogates = _mm512_cmplt_epu16_mask(
 | ^
/home/marcus/llvm18/lib/clang/18/include/avx512bwintrin.h:367:5: note: expanded from macro '_mm512_cmplt_epu16_mask'
  367 | _mm512_cmp_epu16_mask((A), (B), _MM_CMPINT_LT)
      | ^
/home/marcus/llvm18/lib/clang/18/include/avx512bwintrin.h:266:15: note: expanded from macro '_mm512_cmp_epu16_mask'
  266 | ((__mmask32)__builtin_ia32_ucmpw512_mask((__v32hi)(__m512i)(a), \
      | ^
../deps/simdutf/simdutf.cpp:18191:21: error: always_inline function '_mm512_set1_epi16' requires target feature 'evex512', but would be inlined into function 'detect_encodings' that is compiled without support for 'evex512'
 18191 |               diff, _mm512_set1_epi16(uint16_t(0x0400)));
       | ^
../deps/simdutf/simdutf.cpp:18191:21: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI
../deps/simdutf/simdutf.cpp:18234:20: error: always_inline function '_mm512_max_epu32' requires target feature 'evex512', but would be inlined into function 'detect_encodings' that is compiled without support for 'evex512'
 18234 |       currentmax = _mm512_max_epu32(in, currentmax);
       |                    ^

```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWFtv27YX_zT0CxFDJK3bgx-cpMa_wL9bH4qibwIlHlnsKFLjJU726QfKcmyn7tB06TYXEQxbtmjy_C7nUDrcObnRAEuUXqP0dsaD74xd9o7kxaw24mH5wT5IvcHe4Mb0g1SAtRHw2WFK5mSe4K30HW4SnrOSFHUrRJPxZMGLMue8TvO2LlMoBBU8hyZB9Aa_xQ4A-w5wa5Qy2zj76uOnq5RQbEFxDwKDtca6OLp_wP_jbgtKXb15jxsF3KoHLAw4jWjusQvDYKyP8znAUjtvQ-Ol0W6OkluUrKb3LJle49c5omsBg0N07WQvgm8PZ_NmGBBbkYLkBLEVzRBb7QKKJ1xt-YOrpFZSA26DHhfDiOZV36eEVg78H2BN5WRKKKI5tvB7kBYc9txuwOMWuA8W4l_gDu53oyLUOni8NUEJXEckcQGBpfbmZBkBHhpfgW6MkHrj4hK-4x5Lt1dIjKKYcGCnNfbJeiMNeASJUX6D41FVEYHETbAWtO_5PUbsFp8HViBaInY9TbQ74kQofTNx_P0krz5-wnfQeGOxBR-sxqbF_mEYSZuijLgRLaZhpsVFvKiM3uD4Fi_fcRXAIVo-8nHCAQbN68hW03G9iQJ1gFfXb58XPovhJ8_ziDJchMtxCHt0yMEjUh974wRQgWixH4boCtGyDu1LueUM3Zf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