Commit 9dedfec
authored
Prefer avx512vl_256 over avxvnni for 256-bit sized batches (#1381)
When both AVX-VNNI and AVX512VL are available, make_sized_batch/sized_batch
walks all_x86_architectures in order and picks the first arch matching the
requested lane count. For 256-bit float/double batches this selected avxvnni,
whose masked load/store lower to vmaskmov{ps,pd} — a ~3-uop op on Intel that
also does not store-forward. avx512vl_256 (which inherits fma3<avx2>, so every
non-masked op is byte-identical) instead lowers masked load/store to EVEX
k-register moves (vmovups{k}, _mm256_mask*), 1 uop and forwardable.
Reordering avx512vl_256 ahead of avxvnni makes 256-bit sized batches select it
whenever AVX512VL is present. VNNI-only targets (e.g. Alder Lake client) still
resolve to avxvnni, since avx512vl_256 is filtered out of supported_architectures
there — so no target loses codegen, and AVX-512 targets gain clean k-masking.
Note: avx512vl_256 uses EVEX-encoded 256-bit ops, which do not trigger the
512-bit license-based downclock on Skylake-SP/Ice Lake/Sapphire Rapids.1 parent a4b9113 commit 9dedfec
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
0 commit comments