Commit c66f105
committed
[clang] Add _mm512_kunpackd and _mm512_kunpackw intrinsics with constexpr support
Add AVX-512 mask unpack intrinsics _mm512_kunpackd and _mm512_kunpackw
to avx512fintrin.h alongside the existing _mm512_kunpackb intrinsic.
These intrinsics extract and concatenate the lower halves of mask
registers, using the existing backend support for __builtin_ia32_kunpckdi
and __builtin_ia32_kunpcksi builtins.
Also adds __mmask32 and __mmask64 type definitions to avx512fintrin.h
for completeness.
This patch adds constexpr support for all three kunpack intrinsics by:
1. Using __DEFAULT_FN_ATTRS_CONSTEXPR attribute
2. Adding builtin interpretation in ExprConstant.cpp for compile-time
evaluation in constexpr contexts
3. Adding constexpr tests to verify correct behavior
Tests already exist in clang/test/CodeGen/X86/avx512bw-builtins.c for
runtime code generation validation.1 parent e91be48 commit c66f105
File tree
4 files changed
+79
-12
lines changed- clang
- lib
- AST
- Headers
- test/CodeGen/X86
4 files changed
+79
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16287 | 16287 | | |
16288 | 16288 | | |
16289 | 16289 | | |
| 16290 | + | |
| 16291 | + | |
| 16292 | + | |
| 16293 | + | |
| 16294 | + | |
| 16295 | + | |
| 16296 | + | |
| 16297 | + | |
| 16298 | + | |
| 16299 | + | |
| 16300 | + | |
| 16301 | + | |
| 16302 | + | |
| 16303 | + | |
| 16304 | + | |
| 16305 | + | |
| 16306 | + | |
| 16307 | + | |
| 16308 | + | |
| 16309 | + | |
| 16310 | + | |
| 16311 | + | |
| 16312 | + | |
| 16313 | + | |
| 16314 | + | |
| 16315 | + | |
| 16316 | + | |
| 16317 | + | |
| 16318 | + | |
| 16319 | + | |
| 16320 | + | |
| 16321 | + | |
| 16322 | + | |
| 16323 | + | |
| 16324 | + | |
| 16325 | + | |
16290 | 16326 | | |
16291 | 16327 | | |
16292 | 16328 | | |
| |||
16413 | 16449 | | |
16414 | 16450 | | |
16415 | 16451 | | |
| 16452 | + | |
| 16453 | + | |
| 16454 | + | |
| 16455 | + | |
| 16456 | + | |
| 16457 | + | |
| 16458 | + | |
| 16459 | + | |
| 16460 | + | |
| 16461 | + | |
| 16462 | + | |
| 16463 | + | |
| 16464 | + | |
| 16465 | + | |
| 16466 | + | |
16416 | 16467 | | |
16417 | 16468 | | |
16418 | 16469 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1606 | 1606 | | |
1607 | 1607 | | |
1608 | 1608 | | |
1609 | | - | |
1610 | | - | |
| 1609 | + | |
| 1610 | + | |
1611 | 1611 | | |
1612 | 1612 | | |
1613 | 1613 | | |
1614 | 1614 | | |
1615 | | - | |
| 1615 | + | |
1616 | 1616 | | |
1617 | 1617 | | |
1618 | 1618 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8096 | 8096 | | |
8097 | 8097 | | |
8098 | 8098 | | |
8099 | | - | |
| 8099 | + | |
8100 | 8100 | | |
8101 | 8101 | | |
8102 | 8102 | | |
8103 | 8103 | | |
8104 | 8104 | | |
8105 | | - | |
8106 | | - | |
8107 | | - | |
8108 | | - | |
| 8105 | + | |
| 8106 | + | |
| 8107 | + | |
8109 | 8108 | | |
8110 | 8109 | | |
8111 | | - | |
8112 | | - | |
8113 | | - | |
8114 | | - | |
| 8110 | + | |
| 8111 | + | |
| 8112 | + | |
8115 | 8113 | | |
8116 | 8114 | | |
8117 | 8115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9126 | 9126 | | |
9127 | 9127 | | |
9128 | 9128 | | |
| 9129 | + | |
| 9130 | + | |
| 9131 | + | |
| 9132 | + | |
| 9133 | + | |
| 9134 | + | |
| 9135 | + | |
| 9136 | + | |
| 9137 | + | |
| 9138 | + | |
| 9139 | + | |
| 9140 | + | |
| 9141 | + | |
| 9142 | + | |
| 9143 | + | |
| 9144 | + | |
| 9145 | + | |
| 9146 | + | |
9129 | 9147 | | |
9130 | 9148 | | |
9131 | 9149 | | |
| |||
0 commit comments