aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/avx512f-vpcmpud-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/avx512f-vpcmpud-2.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-vpcmpud-2.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpud-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpud-2.c
index 7a1ed898271..3f09e7d3ea0 100644
--- a/gcc/testsuite/gcc.target/i386/avx512f-vpcmpud-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx512f-vpcmpud-2.c
@@ -11,6 +11,7 @@
#include "avx512f-mask-type.h"
#if AVX512F_LEN == 512
+#undef CMP
#define CMP(imm, rel) \
dst_ref = 0; \
for (i = 0; i < 16; i++) \
@@ -25,6 +26,38 @@
if ((mask & dst_ref) != dst2) abort();
#endif
+#if AVX512F_LEN == 256
+#undef CMP
+#define CMP(imm, rel) \
+ dst_ref = 0; \
+ for (i = 0; i < 8; i++) \
+ { \
+ dst_ref = ((rel) << i) | dst_ref; \
+ } \
+ source1.x = _mm256_loadu_si256 ((__m256i*)s1); \
+ source2.x = _mm256_loadu_si256 ((__m256i*)s2); \
+ dst1 = _mm256_cmp_epu32_mask (source1.x, source2.x, imm);\
+ dst2 = _mm256_mask_cmp_epu32_mask (mask, source1.x, source2.x, imm);\
+ if (dst_ref != dst1) abort(); \
+ if ((mask & dst_ref) != dst2) abort();
+#endif
+
+#if AVX512F_LEN == 128
+#undef CMP
+#define CMP(imm, rel) \
+ dst_ref = 0; \
+ for (i = 0; i < 4; i++) \
+ { \
+ dst_ref = ((rel) << i) | dst_ref; \
+ } \
+ source1.x = _mm_loadu_si128 ((__m128i*)s1); \
+ source2.x = _mm_loadu_si128 ((__m128i*)s2); \
+ dst1 = _mm_cmp_epu32_mask (source1.x, source2.x, imm);\
+ dst2 = _mm_mask_cmp_epu32_mask (mask, source1.x, source2.x, imm);\
+ if (dst_ref != dst1) abort(); \
+ if ((mask & dst_ref) != dst2) abort();
+#endif
+
void
TEST ()
{