Commit 8634919
committed
x86/clmul: allow VEX-encoded _mm256_clmulepi64_epi128 without AVX512VL
The Intel Intrinsics Guide lists VPCLMULQDQ + AVX512VL for
_mm256_clmulepi64_epi128, but that only describes the EVEX-encoded
form. The instruction also has a VEX.256 encoding which merely
requires VPCLMULQDQ + AVX, and compilers emit it when AVX-512 is not
enabled (GCC since 9.1 / PR target/88541, Clang since 10). Requiring
AVX512VL_NATIVE forced CPUs with VPCLMULQDQ but no AVX-512 -- notably
AMD Zen 3 -- onto the slow portable fallback.
Follow the pattern already used in gfni.h: use the native intrinsic
when AVX512VL is available, or when AVX is available without AVX512F
(the latter condition avoids compilers encoding the 256-bit form as
EVEX, which would require AVX512VL). The 512-bit intrinsic is
unchanged; ZMM has no VEX encoding.
Also fix the native alias guards to use OR instead of AND: an alias
must be defined whenever any required feature is missing, otherwise a
target with exactly one of the two features gets neither the native
definition nor the SIMDe alias and fails to compile under
SIMDE_ENABLE_NATIVE_ALIASES.1 parent c7e9883 commit 8634919
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
| 293 | + | |
294 | 294 | | |
295 | 295 | | |
296 | | - | |
| 296 | + | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | | - | |
| 393 | + | |
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
| |||
0 commit comments