2 /* { dg-options "-mavx512f -O2" } */
3 /* { dg-require-effective-target avx512f } */
5 #include "avx512f-check.h"
10 compute_gatherdq (long long *res
, __mmask8 m8
, int *idx
,
11 long long *src
, int scale
, long long *r
)
15 for (i
= 0; i
< 8; i
++)
19 (((unsigned char *) src
) + idx
[i
] * scale
);
35 for (i
= 0; i
< 8; i
++)
37 src
[i
] = 1983 * (i
+ 1) * (i
+ 2);
39 /* About to gather in reverse order,
40 divide by 2 to demonstrate scale */
41 idx
.a
[i
] = (64 - (i
+ 1) * 8) >> 1;
44 res
.x
= _mm512_mask_i32gather_epi64 (res
.x
, m8
, idx
.x
, src
, SCALE
);
45 compute_gatherdq (res
.a
, m8
, idx
.a
, src
, SCALE
, res_ref
);
47 if (check_union512i_q (res
, res_ref
))
50 res
.x
= _mm512_i32gather_epi64 (idx
.x
, src
, SCALE
);
51 compute_gatherdq (res
.a
, 0xFF, idx
.a
, src
, SCALE
, res_ref
);
53 if (check_union512i_q (res
, res_ref
))