]> git.ipfire.org Git - thirdparty/gcc.git/commit
i386: Add PCLMUL dependency for VPCLMULQDQ
authorHaochen Jiang <haochen.jiang@intel.com>
Fri, 10 Mar 2023 02:38:50 +0000 (10:38 +0800)
committerHaochen Jiang <haochen.jiang@intel.com>
Thu, 20 Apr 2023 01:32:55 +0000 (09:32 +0800)
commit4246611d1915f1664c01f286dbeb946dd06e2a4d
treec6f39ca67f78eeac462324656fec52f47e09511a
parente8571019066d9820c5cd4b3019b816203d438e83
i386: Add PCLMUL dependency for VPCLMULQDQ

Currently in GCC, the 128 bit intrin for instruction vpclmulqdq is
under PCLMUL ISA. Because there is no dependency between ISA set PCLMUL
and VPCLMULQDQ, The 128 bit intrin is not available when we just use
compiler flag -mvpclmulqdq. But it should according to Intel SDM.

Since VPCLMULQDQ is a VEX/EVEX promotion for PCLMUL, it is natural to
add dependency between them.

Also, with -mvpclmulqdq, we can use ymm under VEX encoding, so
VPCLMULQDQ should imply AVX.

gcc/ChangeLog:

* common/config/i386/i386-common.cc
(OPTION_MASK_ISA_VPCLMULQDQ_SET):
Add OPTION_MASK_ISA_PCLMUL_SET and OPTION_MASK_ISA_AVX_SET.
(OPTION_MASK_ISA_AVX_UNSET):
Add OPTION_MASK_ISA_VPCLMULQDQ_UNSET.
(OPTION_MASK_ISA_PCLMUL_UNSET): Ditto.
* config/i386/i386.md (vpclmulqdqvl): New.
* config/i386/sse.md (pclmulqdq): Add evex encoding.
* config/i386/vpclmulqdqintrin.h: Remove redudant avx target
push.

gcc/testsuite/ChangeLog:

* gcc.target/i386/vpclmulqdq.c: Add compile test for xmm.
gcc/common/config/i386/i386-common.cc
gcc/config/i386/i386.md
gcc/config/i386/sse.md
gcc/config/i386/vpclmulqdqintrin.h
gcc/testsuite/gcc.target/i386/vpclmulqdq.c