Commit 0929f1a
authored
fix: route avxvnni FMA ops through fma3<avx2> kernels (#1368)
batch<T, avxvnni> derived from avx2, so fnma/fnms fell back to the
generic neg(x*y)+z form (vxorpd + vfmadd) instead of the hardware
vfnmadd/vfnmsub kernels registered for fma3<avx2>. This bites
-march=native on Alder/Meteor Lake and Zen 5, where default_arch
resolves to avxvnni.
Derive avxvnni from fma3<avx2> instead. fma3<avx2> always derives from
avx2 and its kernels are guarded by XSIMD_WITH_FMA3_AVX2, so when FMA
is disabled the base is transparent and dispatch falls through to avx2
unchanged.
Validated under Intel SDE across avxvnni+FMA (-adl), fma3<avx2> (-hsw),
avx2-only (-hsw) and avxvnni-without-FMA (-adl): correct results, full
test_batch suite passes, vfnmadd emitted only where FMA is enabled.1 parent 5d2490f commit 0929f1a
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
| |||
0 commit comments