AVX512F: Add helper enumeration for ternary logic intrinsics.
authorHongyu Wang <hongyu.wang@intel.com>
Fri, 25 Feb 2022 07:09:03 +0000 (15:09 +0800)
committerHongyu Wang <hongyu.wang@intel.com>
Mon, 28 Feb 2022 01:37:25 +0000 (09:37 +0800)
commit50d9ca7104d40f0a331d0dd01e3c069ecf7f6c97
tree3d665e8ae8b734f13e033e5ed20fb0eba22c8639
parent88c1b0385aab2d83836bbd814fbb6abb72259d80
AVX512F: Add helper enumeration for ternary logic intrinsics.

Sync with llvm change in https://reviews.llvm.org/D120307 to
add enumeration and truncate imm to unsigned char, so users could
use ~ on immediates.

gcc/ChangeLog:

* config/i386/avx512fintrin.h (_MM_TERNLOG_ENUM): New enum.
(_mm512_ternarylogic_epi64): Truncate imm to unsigned
char to avoid error when using ~enum as parameter.
(_mm512_mask_ternarylogic_epi64): Likewise.
(_mm512_maskz_ternarylogic_epi64): Likewise.
(_mm512_ternarylogic_epi32): Likewise.
(_mm512_mask_ternarylogic_epi32): Likewise.
(_mm512_maskz_ternarylogic_epi32): Likewise.
* config/i386/avx512vlintrin.h (_mm256_ternarylogic_epi64):
Adjust imm param type to unsigned char.
(_mm256_mask_ternarylogic_epi64): Likewise.
(_mm256_maskz_ternarylogic_epi64): Likewise.
(_mm256_ternarylogic_epi32): Likewise.
(_mm256_mask_ternarylogic_epi32): Likewise.
(_mm256_maskz_ternarylogic_epi32): Likewise.
(_mm_ternarylogic_epi64): Likewise.
(_mm_mask_ternarylogic_epi64): Likewise.
(_mm_maskz_ternarylogic_epi64): Likewise.
(_mm_ternarylogic_epi32): Likewise.
(_mm_mask_ternarylogic_epi32): Likewise.
(_mm_maskz_ternarylogic_epi32): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx512f-vpternlogd-1.c: Use new enum.
* gcc.target/i386/avx512f-vpternlogq-1.c: Likewise.
* gcc.target/i386/avx512vl-vpternlogd-1.c: Likewise.
* gcc.target/i386/avx512vl-vpternlogq-1.c: Likewise.
* gcc.target/i386/testimm-10.c: Remove imm check for vpternlog
insns since the imm has been truncated in intrinsic.
gcc/config/i386/avx512fintrin.h
gcc/config/i386/avx512vlintrin.h
gcc/testsuite/gcc.target/i386/avx512f-vpternlogd-1.c
gcc/testsuite/gcc.target/i386/avx512f-vpternlogq-1.c
gcc/testsuite/gcc.target/i386/avx512vl-vpternlogd-1.c
gcc/testsuite/gcc.target/i386/avx512vl-vpternlogq-1.c
gcc/testsuite/gcc.target/i386/testimm-10.c