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

    <tr>
        <th>Summary</th>
        <td>
            [Headers][X86] Allow MMX/SSE/AVX2/AVX512 integer min/max intrinsics to be used in constexpr
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            good first issue,
            backend:X86,
            clang:headers
      </td>
    </tr>

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

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

<pre>
    Now that #152278 is done, the x86 intrinsics which wrap the integer __builtin_elementwise_max/min builtins can be updated to work with constexpr
```
_mm_max_epi8  _mm256_max_epi8  _mm256_max_epi8 
_mm_max_epi16 _mm256_max_epi16 _mm256_max_epi16 _mm_max_pi16
_mm_max_epi32 _mm256_max_epi32 _mm256_max_epi32
_mm_max_epi64 _mm256_max_epi64 _mm256_max_epi64

_mm_max_epu8  _mm256_max_epu8  _mm256_max_epu8 
_mm_max_epu16 _mm256_max_epu16 _mm256_max_epu16 _mm_max_pu16
_mm_max_epu32 _mm256_max_epu32 _mm256_max_epu32
_mm_max_epu64 _mm256_max_epu64 _mm256_max_epu64

_mm_min_epi8  _mm256_min_epi8  _mm256_min_epi8 
_mm_min_epi16 _mm256_min_epi16 _mm256_min_epi16 _mm_min_pi16
_mm_min_epi32 _mm256_min_epi32 _mm256_min_epi32
_mm_min_epi64 _mm256_min_epi64 _mm256_min_epi64

_mm_min_epu8  _mm256_min_epu8  _mm256_min_epu8 
_mm_min_epu16 _mm256_min_epu16 _mm256_min_epu16 _mm_min_pu16
_mm_min_epu32 _mm256_min_epu32 _mm256_min_epu32
_mm_min_epu64 _mm256_min_epu64 _mm256_min_epu64
```
(ignore the AVX512 mask/maskz variants for now)

You can use https://github.com/llvm/llvm-project/pull/152296 for reference
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUlF-LszgUhz9NvAlb9GisXnjhTFcWltmLHRi6VyXVU81Wk5I_Y3c__Yt25p0a7MALBcmT_NI-np7DjRGtRCwIeyJsF3BnO6WLv_98FYOSwVE1_xV_qZHajltKII4YwDajwtBGSSTwTG2H9JqlVEirhTSiNnTsRN3RUfPLvCukxRY1PRyOTvRWyAP2OKC0ozB4GPiVQDUIST92Da25pEek7tJwiw21io5Kn-kobEdrJY3F60WTsCRp-PEJy8MwTFcd8CIySg_DACz9BiwTUeodeADm1bRYxmPwTq-AZSJNvAMrYBK8DzlfYw0sE77GI3Dzcp6X8zXWwDLha6yBO6_pr7Aoz0OwTNxpfAvm1X29bpt3Gg_BMnGn8RD4Xs7XWAPLhK_xCNy8nOflfI01sEz4GmvAazQCmWil0jj3dvm2ZxHQgZvz1MXcnP-n71wLLq2hJ6WpVCOB_PZu_lFu7m1nkHbWXgyJSwIVgaoVtnPHTa0GAlXfv38-frto9S_WlkB1cX1PoJoGUJ7OV2s8oUZZY9AUcZPHOQ-wiLYsybMM0jzoCkyQR5hsG77N0tM24wxZiGEUQZhtsWGBKCAEFmYTSBLIN1ECdV7Hedg0DPkpIkmIAxf9Zvo1G6XbQBjjsIhYHLE46PkRezMPT4BWqYaehDaWzocIAIFnAnDk9RllQ-Jyn6U_ad1z2ZK47JA3qM3E2S7Qxex9dK0hSdgLY83Xd1th-3lU__GRYTvCnqZL2Y6Wfa9G-vKyJ1C9vv5OoCrf9nB7TDX6HMODkHOprvcj26p54hpsqJBfQzZwui9-uVSzvZmLNb-l9wJ-BAAA___g_BrO">