| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O2 -mavx512dq" } */ |
| 3 |
/* { dg-require-effective-target avx512dq } */ |
| 4 |
|
| 5 |
#define AVX512DQ |
| 6 |
#include "avx512f-helper.h" |
| 7 |
#include "string.h" |
| 8 |
|
| 9 |
#define SIZE (AVX512F_LEN / 64) |
| 10 |
#include "avx512f-mask-type.h" |
| 11 |
|
| 12 |
void |
| 13 |
CALC (UNION_TYPE (AVX512F_LEN, i_q) s1, union128i_q s2, |
| 14 |
long long *res_ref, int mask) |
| 15 |
{ |
| 16 |
memcpy (res_ref, s1.a, SIZE * sizeof (long long)); |
| 17 |
memcpy (res_ref + mask * 2, s2.a, 16); |
| 18 |
} |
| 19 |
|
| 20 |
void |
| 21 |
TEST (void) |
| 22 |
{ |
| 23 |
UNION_TYPE (AVX512F_LEN, i_q) s1, res1, res2, res3; |
| 24 |
union128i_q s2; |
| 25 |
long long res_ref[SIZE]; |
| 26 |
MASK_TYPE mask = MASK_VALUE; |
| 27 |
int j; |
| 28 |
|
| 29 |
for (j = 0; j < SIZE; j++) |
| 30 |
{ |
| 31 |
s1.a[j] = j * j; |
| 32 |
res1.a[j] = DEFAULT_VALUE; |
| 33 |
res2.a[j] = DEFAULT_VALUE; |
| 34 |
res3.a[j] = DEFAULT_VALUE; |
| 35 |
} |
| 36 |
|
| 37 |
for (j = 0; j < 2; j++) |
| 38 |
s2.a[j] = j * j * j; |
| 39 |
|
| 40 |
res1.x = INTRINSIC (_inserti64x2) (s1.x, s2.x, 1); |
| 41 |
res2.x = INTRINSIC (_mask_inserti64x2) (res2.x, mask, s1.x, s2.x, 1); |
| 42 |
res3.x = INTRINSIC (_maskz_inserti64x2) (mask, s1.x, s2.x, 1); |
| 43 |
|
| 44 |
CALC (s1, s2, res_ref, 1); |
| 45 |
|
| 46 |
if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref)) |
| 47 |
abort (); |
| 48 |
|
| 49 |
MASK_MERGE (i_q) (res_ref, mask, SIZE); |
| 50 |
if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref)) |
| 51 |
abort (); |
| 52 |
|
| 53 |
MASK_ZERO (i_q) (res_ref, mask, SIZE); |
| 54 |
if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref)) |
| 55 |
abort (); |
| 56 |
} |