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
8 #define SIZE (AVX512F_LEN / 64)
9 #include "avx512f-mask-type.h"
10
11 void
CALC(long long * r,long long * s)12 CALC (long long *r, long long *s)
13 {
14 int i;
15 for (i = 0; i < SIZE; i++)
16 {
17 r[i] = s[i % 2];
18 }
19 }
20
21 void
TEST(void)22 TEST (void)
23 {
24 int i, sign;
25 UNION_TYPE (AVX512F_LEN, i_q) res1, res2, res3;
26 UNION_TYPE (128, i_q) src;
27 MASK_TYPE mask = SIZE | 123;
28 long long res_ref[SIZE];
29
30 sign = -1;
31 for (i = 0; i < 2; i++)
32 {
33 src.a[i] = 34 * i * sign;
34 sign = sign * -1;
35 }
36 for (i = 0; i < SIZE; i++)
37 res2.a[i] = DEFAULT_VALUE;
38
39 res1.x = INTRINSIC (_broadcast_i64x2) (src.x);
40 res2.x = INTRINSIC (_mask_broadcast_i64x2) (res2.x, mask, src.x);
41 res3.x = INTRINSIC (_maskz_broadcast_i64x2) (mask, src.x);
42
43 CALC (res_ref, src.a);
44
45 if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref))
46 abort ();
47
48 MASK_MERGE (i_q) (res_ref, mask, SIZE);
49 if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref))
50 abort ();
51
52 MASK_ZERO (i_q) (res_ref, mask, SIZE);
53 if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref))
54 abort ();
55 }
56