2 /* { dg-options "-mavx512f -O2" } */
3 /* { dg-require-effective-target avx512f } */
5 #include "avx512f-check.h"
10 compute_scatterqq (__mmask8 m8
, long long *idx
, long long *src
,
11 int scale
, long long *r
)
15 for (i
= 0; i
< 8; i
++)
18 *(long long *) (((unsigned char *) r
) + idx
[i
] * scale
) =
28 long long res
[8] = { 0 };
29 long long res_ref
[8] = { 0 };
32 for (i
= 0; i
< 8; i
++)
34 src
.a
[i
] = 1983 * (i
+ 1) * (i
+ 2);
36 /* About to gather in reverse order,
37 divide by 2 to demonstrate scale */
38 idx
.a
[i
] = (64 - (i
+ 1) * 8) >> 1;
41 _mm512_mask_i64scatter_epi64 (res
, m8
, idx
.x
, src
.x
, SCALE
);
42 compute_scatterqq (m8
, idx
.a
, src
.a
, SCALE
, res_ref
);
44 if (checkVl (res
, res_ref
, 8))
47 _mm512_i64scatter_epi64 (res
, idx
.x
, src
.x
, SCALE
);
48 compute_scatterqq (0xFF, idx
.a
, src
.a
, SCALE
, res_ref
);
50 if (checkVl (res
, res_ref
, 8))