aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/avx512f-vpmovdb-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/avx512f-vpmovdb-2.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-vpmovdb-2.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpmovdb-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vpmovdb-2.c
index 0e418f98ed2..80cb2c3cb2f 100644
--- a/gcc/testsuite/gcc.target/i386/avx512f-vpmovdb-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx512f-vpmovdb-2.c
@@ -9,11 +9,12 @@
#define SIZE (AVX512F_LEN / 32)
#include "avx512f-mask-type.h"
-static void
-CALC (char *r, int *s)
+void
+CALC (char *r, int *s, int mem)
{
int i;
- for (i = 0; i < 16; i++)
+ int len = mem ? SIZE : 16;
+ for (i = 0; i < len; i++)
{
r[i] = (i < SIZE) ? (char) s[i] : 0;
}
@@ -28,6 +29,7 @@ TEST (void)
UNION_TYPE (AVX512F_LEN, i_d) src;
MASK_TYPE mask = MASK_VALUE;
char res_ref[16];
+ char res_ref2[16];
sign = -1;
for (i = 0; i < SIZE; i++)
@@ -38,12 +40,17 @@ TEST (void)
res4[i] = DEFAULT_VALUE;
}
+ for (i = SIZE; i < 16; i++)
+ {
+ res4[i] = DEFAULT_VALUE * 2;
+ res_ref2[i] = DEFAULT_VALUE * 2;
+ }
+
res1.x = INTRINSIC (_cvtepi32_epi8) (src.x);
res2.x = INTRINSIC (_mask_cvtepi32_epi8) (res2.x, mask, src.x);
res3.x = INTRINSIC (_maskz_cvtepi32_epi8) (mask, src.x);
- INTRINSIC (_mask_cvtepi32_storeu_epi8) (res4, mask, src.x);
- CALC (res_ref, src.a);
+ CALC (res_ref, src.a, 0);
if (UNION_CHECK (128, i_b) (res1, res_ref))
abort ();
@@ -52,10 +59,14 @@ TEST (void)
if (UNION_CHECK (128, i_b) (res2, res_ref))
abort ();
- if (checkVc (res4, res_ref, 16))
- abort ();
-
MASK_ZERO (i_b) (res_ref, mask, SIZE);
if (UNION_CHECK (128, i_b) (res3, res_ref))
abort ();
+
+ INTRINSIC (_mask_cvtepi32_storeu_epi8) (res4, mask, src.x);
+ CALC (res_ref2, src.a, 1);
+
+ MASK_MERGE (i_b) (res_ref2, mask, SIZE);
+ if (checkVc (res4, res_ref2, 16))
+ abort ();
}