https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126098
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-16 branch has been updated by hongtao Liu <[email protected]>: https://gcc.gnu.org/g:07e373ee846a8d60bad3ce480a363164d3e0dc18 commit r16-9231-g07e373ee846a8d60bad3ce480a363164d3e0dc18 Author: liuhongt <[email protected]> Date: Fri Jul 3 06:46:32 2026 -0700 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. (cherry picked from commit 5be7b70e769e6e992dbf631cd37e24bd9da9e05e)
