<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/154283>154283</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Headers][X86] VectorExprEvaluator::VisitCallExpr - allow SSE/AVX2/AVX512 pack intrinsics to be used in constexpr
</td>
</tr>
<tr>
<th>Labels</th>
<td>
good first issue,
backend:X86,
clang:frontend,
clang:headers,
constexpr
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
RKSimon
</td>
</tr>
</table>
<pre>
Handle the saturated truncation intrinsics inside VectorExprEvaluator::VisitCallExpr and add constexpr test coverage, similar to #152524
```
_mm_packs_epi16 _mm256_packs_epi16 _mm512_packs_epi16 _mm_packs_pi16
_mm_packs_epi32 _mm256_packs_epi32 _mm512_packs_epi32 _mm_packs_pi32
_mm_packus_epi16 _mm256_packus_epi16 _mm512_packus_epi16 _mm_packs_pu16
_mm_packus_epi32 _mm256_packus_epi32 _mm512_packus_epi32
```
(plus the AVX512BW mask/maskz variants)
Note that these are slightly more complex than regular elementwise intrinsics as the 2 operands are packed together at the 128-bit level.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMk89uqzoQxp_GbEaJYIgTsmBBm0aVrnQXt1Jud5Gxp-BTYyPbpO15-iMnaZP-WRwJNOJn883nGY8IQXeWqGb8hvFNJqbYO1__98-DHpzNWqfe6nthlSGIPUEQcfIikoLoJytF1M6CttFrG7QMkIIi2JGMzt-9jv7uIMwkovOsbFjZ7HTQ8VYYk9ZAWAVCKZDOhkiJRAoRpDuQFx0xvIWgB22Eh-iAYVlw5LhgecOW-fnJm_0w7Echn8OeRl0sYT8MyJefUGK8wG_sDNL3V6ESvwmV-F3ozD6ESkzuLlrTD66u2bvYNXsXmz65mn6wdc0-K518XFWJYTWaKRy72OweeYE3_8MgwjPDbQq_4SC8FjYGhuvTGf51MXVdxPRTIBCeIBjd9dG8weA8gXTDaOg1bbLgqZtSq8jQQDa-6EDXV0OcciO4kbywKhz1kuN0m1xHsScPp2RQYDVrdQRDBzLzTNWlWpdrkVFdrDjn64LzKutrlAWu2rySbYVigcuiamWxWK04PpVqhctM15gjz6tind6imvOFkEqWKynads05Z4ucBqHN3JjDMHe-y3QIE9UFX2BVZka0ZMJxOBA75xQ8aR8iHDcxRIa3DLFNh7CKlc1jtfyg0gjbsbJ58s7GtPx1oSehyIcLfx-DRPgm83UyNWunLrBFbnSI4WIz6miOU3t_VuEbxm9Sfr752_mbgTDGvcDDwx3DbbN7xFPgBR4bc92-6KAlmAIp0PYysdnkTd3HOIaUALcMt52O_dTOpRsYbpPfc5iN3v0iGRluj-ULDLfnMh9q_BMAAP__0rF_Xg">