diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/avx512f-vcmppd-2.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/avx512f-vcmppd-2.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcmppd-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vcmppd-2.c index add23d07a19..52e226d9f15 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vcmppd-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vcmppd-2.c @@ -26,7 +26,39 @@ if ((dst_ref & mask) != dst2) abort(); #endif -static void +#if AVX512F_LEN == 256 +#undef CMP +#define CMP(imm, rel) \ + dst_ref = 0; \ + for (i = 0; i < 4; i++) \ + { \ + dst_ref = (((int) rel) << i) | dst_ref; \ + } \ + source1.x = _mm256_loadu_pd(s1); \ + source2.x = _mm256_loadu_pd(s2); \ + dst1 = _mm256_cmp_pd_mask(source1.x, source2.x, imm);\ + dst2 = _mm256_mask_cmp_pd_mask(mask, source1.x, source2.x, imm);\ + if (dst_ref != dst1) abort(); \ + if ((dst_ref & mask) != dst2) abort(); +#endif + +#if AVX512F_LEN == 128 +#undef CMP +#define CMP(imm, rel) \ + dst_ref = 0; \ + for (i = 0; i < 2; i++) \ + { \ + dst_ref = (((int) rel) << i) | dst_ref; \ + } \ + source1.x = _mm_loadu_pd(s1); \ + source2.x = _mm_loadu_pd(s2); \ + dst1 = _mm_cmp_pd_mask(source1.x, source2.x, imm);\ + dst2 = _mm_mask_cmp_pd_mask(mask, source1.x, source2.x, imm);\ + if (dst_ref != dst1) abort(); \ + if ((dst_ref & mask) != dst2) abort(); +#endif + +void TEST () { UNION_TYPE (AVX512F_LEN, d) source1, source2; |