i386: Auto vectorize sdot_prod, usdot_prod with VNNI instruction.
authorHongyu Wang <hongyu.wang@intel.com>
Tue, 26 Oct 2021 05:07:31 +0000 (13:07 +0800)
committerHongyu Wang <hongyu.wang@intel.com>
Thu, 4 Nov 2021 06:41:30 +0000 (14:41 +0800)
commit3fd0723f0a388817def293e606a99bfbf3a4ced4
treea31682307d152b6b773ab258f623fa0f0caa8383
parent7fcc22dae70af4202fe83b9ecb642fd6333464a2
i386: Auto vectorize sdot_prod, usdot_prod with VNNI instruction.

AVX512VNNI/AVXVNNI has vpdpwssd for HImode, vpdpbusd for QImode, so
Adjust HImode sdot_prod expander and add QImode usdot_prod expander
to enhance vectorization for dotprod.

gcc/ChangeLog:

* config/i386/sse.md (VI2_AVX512VNNIBW): New mode iterator.
(VI1_AVX512VNNI): Likewise.
(SDOT_VPDP_SUF): New mode_attr.
(VI1SI): Likewise.
(vi1si): Likewise.
(sdot_prod<mode>): Use VI2_AVX512F iterator, expand to
vpdpwssd when VNNI targets available.
(usdot_prod<mode>): New expander for vector QImode.

gcc/testsuite/ChangeLog:

* gcc.target/i386/vnni-auto-vectorize-1.c: New test.
* gcc.target/i386/vnni-auto-vectorize-2.c: Ditto.
gcc/config/i386/sse.md
gcc/testsuite/gcc.target/i386/vnni-auto-vectorize-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/vnni-auto-vectorize-2.c [new file with mode: 0644]