2 /* { dg-options "-mavx512f -O2" } */
3 /* { dg-require-effective-target avx512f } */
5 #include "avx512f-check.h"
10 compute_gatherdd (int *res
, __mmask16 m16
, int *idx
,
11 int *src
, int scale
, int *r
)
15 for (i
= 0; i
< 16; i
++)
18 r
[i
] = *(int *) (((unsigned char *) src
) + idx
[i
] * scale
);
31 __mmask16 m16
= 0xBC5D;
33 for (i
= 0; i
< 16; i
++)
35 src
[i
] = 1973 * (i
+ 1) * (i
+ 2);
37 /* About to gather in reverse order,
38 divide by 2 to demonstrate scale */
39 idx
.a
[i
] = (64 - (i
+ 1) * 4) >> 1;
42 res
.x
= _mm512_mask_i32gather_epi32 (res
.x
, m16
, idx
.x
, src
, SCALE
);
43 compute_gatherdd (res
.a
, m16
, idx
.a
, src
, SCALE
, res_ref
);
45 if (check_union512i_d (res
, res_ref
))
48 res
.x
= _mm512_i32gather_epi32 (idx
.x
, src
, SCALE
);
49 compute_gatherdd (res
.a
, 0xFFFF, idx
.a
, src
, SCALE
, res_ref
);
51 if (check_union512i_d (res
, res_ref
))