gnu/gcc/5be7b70e769e6e992dbf631cd37e24bd9da9e05e i386: Enable 512-bit byte dot-product only under AVX512BW [PR126098]
The byte sdot_prod/udot_prod expanders used the VI1_AVX512VNNIBW
iterator, which enabled V64QI under AVX512BW || AVX512VNNI. But VNNI
has no same-sign byte instruction (VPDPBUSD is mixed-sign, i.e. usdot),
so the same-sign byte case always emulates via vec_unpacks/vec_unpacku,
and for V64QI that widening is vpmov[sz]xbw, which needs AVX512BW. With
-mavx512vnni alone the optab was offered but couldn't be emulated:
(set (reg:V32HI) (sign_extend:V32HI (reg:V32QI)))
fails to match, ICEing in extract_insn during vregs.
Use the VI1_AVX512 iterator instead (V64QI under AVX512BW), matching the
sibling usdot_prod, and drop VI1_AVX512VNNIBW. The word sdot_prod uses a
separate iterator (VI2_AVX512VNNIBW) and is left unchanged: its V32HI VNNI
path is vpdpwssd on the 16-bit inputs directly, so no widening is needed.
gcc/ChangeLog:
PR target/126098
* config/i386/sse.md (VI1_AVX512VNNIBW): Remove.
(sdot_prod<ssedvecmodelower><mode>): Use VI1_AVX512 instead of
VI1_AVX512VNNIBW so V64QI is enabled only under AVX512BW.
(udot_prod<ssedvecmodelower><mode>): Likewise.
gcc/testsuite/ChangeLog:
PR target/126098
* gcc.target/i386/pr126098.c: New test.
2 files changed