diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/avx512f-vpmovqw-2.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/avx512f-vpmovqw-2.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-vpmovqw-2.c b/gcc/testsuite/gcc.target/i386/avx512f-vpmovqw-2.c index 27b816511da..c527a977948 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-vpmovqw-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512f-vpmovqw-2.c @@ -9,11 +9,12 @@ #define SIZE (AVX512F_LEN / 64) #include "avx512f-mask-type.h" -static void -CALC (short *r, long long *s) +void +CALC (short *r, long long *s, int mem) { int i; - for (i = 0; i < 8; i++) + int len = mem ? SIZE : 8; + for (i = 0; i < len; i++) { r[i] = (i < SIZE) ? (short) s[i] : 0; } @@ -28,6 +29,7 @@ TEST (void) UNION_TYPE (AVX512F_LEN, i_q) src; MASK_TYPE mask = MASK_VALUE; short res_ref[8]; + short res_ref2[8]; sign = -1; for (i = 0; i < SIZE; i++) @@ -38,12 +40,17 @@ TEST (void) res4[i] = DEFAULT_VALUE; } + for (i = SIZE; i < 8; i++) + { + res_ref2[i] = DEFAULT_VALUE * 2; + res4[i] = DEFAULT_VALUE * 2; + } + res1.x = INTRINSIC (_cvtepi64_epi16) (src.x); res2.x = INTRINSIC (_mask_cvtepi64_epi16) (res2.x, mask, src.x); res3.x = INTRINSIC (_maskz_cvtepi64_epi16) (mask, src.x); - INTRINSIC (_mask_cvtepi64_storeu_epi16) (res4, mask, src.x); - CALC (res_ref, src.a); + CALC (res_ref, src.a, 0); if (UNION_CHECK (128, i_w) (res1, res_ref)) abort (); @@ -52,10 +59,14 @@ TEST (void) if (UNION_CHECK (128, i_w) (res2, res_ref)) abort (); - if (checkVs (res4, res_ref, 8)) - abort (); - MASK_ZERO (i_w) (res_ref, mask, SIZE); if (UNION_CHECK (128, i_w) (res3, res_ref)) abort (); + + INTRINSIC (_mask_cvtepi64_storeu_epi16) (res4, mask, src.x); + CALC (res_ref2, src.a, 1); + + MASK_MERGE (i_w) (res_ref2, mask, SIZE); + if (checkVs (res4, res_ref2, 8)) + abort (); } |