aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/avx512f-vcmpps-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/avx512f-vcmpps-2.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-vcmpps-2.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vcmpps-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vcmpps-2.c
index 88dc8908596..2ffa2ed16b7 100644
--- a/gcc/testsuite/gcc.target/i386/avx512f-vcmpps-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx512f-vcmpps-2.c
@@ -12,6 +12,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++) \
@@ -26,6 +27,38 @@
if ((dst_ref & mask) != dst2) abort();
#endif
+#if AVX512F_LEN == 256
+#undef CMP
+#define CMP(imm, rel) \
+ dst_ref = 0; \
+ for (i = 0; i < 8; i++) \
+ { \
+ dst_ref = (((int) rel) << i) | dst_ref; \
+ } \
+ source1.x = _mm256_loadu_ps(s1); \
+ source2.x = _mm256_loadu_ps(s2); \
+ dst1 = _mm256_cmp_ps_mask(source1.x, source2.x, imm);\
+ dst2 = _mm256_mask_cmp_ps_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 < 4; i++) \
+ { \
+ dst_ref = (((int) rel) << i) | dst_ref; \
+ } \
+ source1.x = _mm_loadu_ps(s1); \
+ source2.x = _mm_loadu_ps(s2); \
+ dst1 = _mm_cmp_ps_mask(source1.x, source2.x, imm);\
+ dst2 = _mm_mask_cmp_ps_mask(mask, source1.x, source2.x, imm);\
+ if (dst_ref != dst1) abort(); \
+ if ((dst_ref & mask) != dst2) abort();
+#endif
+
void
TEST ()
{