summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/avx512f-vpmovusqd-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/avx512f-vpmovusqd-2.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-vpmovusqd-2.c45
1 files changed, 27 insertions, 18 deletions
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpmovusqd-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vpmovusqd-2.c
index 79613b36ac3..3b494f060eb 100644
--- a/gcc/testsuite/gcc.target/i386/avx512f-vpmovusqd-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx512f-vpmovusqd-2.c
@@ -11,25 +11,25 @@
#define SIZE_HALF (AVX512F_LEN_HALF / 32)
#include <limits.h>
-CALC (unsigned int *r, unsigned long long *s)
+void
+CALC (unsigned int *r, unsigned long long *s, int mem)
{
int i;
- for (i = 0; i < SIZE_HALF; i++)
- {
- r[i] = (s[i] > UINT_MAX) ? UINT_MAX : s[i];
- r[i] = (i < SIZE) ? r[i] : 0;
- }
+ int len = mem ? SIZE : SIZE_HALF;
+ for (i = 0; i < len; i++)
+ r[i] = (i < SIZE) ? ((s[i] > UINT_MAX) ? UINT_MAX : s[i]) : 0;
}
-void static
+void
TEST (void)
{
- int i, sign;
- UNION_TYPE (AVX512F_LEN_HALF, i_d) res1, res2, res3;
+ int i;
+ UNION_TYPE (AVX512F_LEN_HALF, i_ud) res1, res2, res3;
unsigned int res4[SIZE_HALF];
- UNION_TYPE (AVX512F_LEN, i_q) src;
+ UNION_TYPE (AVX512F_LEN, i_uq) src;
MASK_TYPE mask = MASK_VALUE;
unsigned int res_ref[SIZE_HALF];
+ unsigned int res_ref2[SIZE_HALF];
for (i = 0; i < SIZE; i++)
{
@@ -38,24 +38,33 @@ TEST (void)
res4[i] = DEFAULT_VALUE;
}
+ for (i = SIZE; i < SIZE_HALF; i++)
+ {
+ res_ref2[i] = DEFAULT_VALUE * 2;
+ res4[i] = DEFAULT_VALUE * 2;
+ }
+
res1.x = INTRINSIC (_cvtusepi64_epi32) (src.x);
res2.x = INTRINSIC (_mask_cvtusepi64_epi32) (res2.x, mask, src.x);
res3.x = INTRINSIC (_maskz_cvtusepi64_epi32) (mask, src.x);
- INTRINSIC (_mask_cvtusepi64_storeu_epi32) (res4, mask, src.x);
- CALC (res_ref, src.a);
+ CALC (res_ref, src.a, 0);
- if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res1, res_ref))
+ if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res1, res_ref))
abort ();
- MASK_MERGE (i_d) (res_ref, mask, SIZE);
- if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res2, res_ref))
+ MASK_MERGE (i_ud) (res_ref, mask, SIZE);
+ if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res2, res_ref))
abort ();
- if (checkVi (res4, res_ref, SIZE_HALF))
+ MASK_ZERO (i_ud) (res_ref, mask, SIZE);
+ if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res3, res_ref))
abort ();
- MASK_ZERO (i_d) (res_ref, mask, SIZE);
- if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res3, res_ref))
+ CALC (res_ref2, src.a, 1);
+ INTRINSIC (_mask_cvtusepi64_storeu_epi32) (res4, mask, src.x);
+
+ MASK_MERGE (i_d) (res_ref2, mask, SIZE);
+ if (checkVi (res4, res_ref2, SIZE_HALF))
abort ();
}