Lower AVX512 vector comparison to AVX version when dest is vector.
authorliuhongt <hongtao.liu@intel.com>
Fri, 18 Dec 2020 07:56:06 +0000 (15:56 +0800)
committerliuhongt <hongtao.liu@intel.com>
Fri, 22 Jan 2021 04:35:14 +0000 (12:35 +0800)
commitee78c20e74d30284fee36e22a64e86e45e676029
treef36f196ec99d2fb29394a30cb5d4df8ddd9ff448
parentbca467e56fe111fa6d876656c60d5704065e83fe
Lower AVX512 vector comparison to AVX version when dest is vector.

gcc/ChangeLog:

PR target/96891
PR target/98348
* config/i386/sse.md (VI_128_256): New mode iterator.
(*avx_cmp<mode>3_1, *avx_cmp<mode>3_2, *avx_cmp<mode>3_3,
 *avx_cmp<mode>3_4, *avx2_eq<mode>3, *avx2_pcmp<mode>3_1,
 *avx2_pcmp<mode>3_2, *avx2_gt<mode>3): New
define_insn_and_split to lower avx512 vector comparison to avx
version when dest is vector.
(*<avx512>_cmp<mode>3,*<avx512>_cmp<mode>3,*<avx512>_ucmp<mode>3):
define_insn_and_split for negating the comparison result.
* config/i386/predicates.md (float_vector_all_ones_operand):
New predicate.
* config/i386/i386-expand.c (ix86_expand_sse_movcc): Use
general NOT operator without UNSPEC_MASKOP.

gcc/testsuite/ChangeLog:

PR target/96891
PR target/98348
* gcc.target/i386/avx512bw-pr96891-1.c: New test.
* gcc.target/i386/avx512f-pr96891-1.c: New test.
* gcc.target/i386/avx512f-pr96891-2.c: New test.
* gcc.target/i386/avx512f-pr96891-3.c: New test.
* g++.target/i386/avx512f-pr96891-1.C: New test.
* gcc.target/i386/bitwise_mask_op-3.c: Adjust testcase.
gcc/config/i386/i386-expand.c
gcc/config/i386/predicates.md
gcc/config/i386/sse.md
gcc/testsuite/g++.target/i386/avx512f-pr96891-1.C [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512bw-pr96891-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512f-pr96891-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512f-pr96891-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512f-pr96891-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/bitwise_mask_op-3.c