2 /* { dg-options "-mavx512f -O2" } */
3 /* { dg-require-effective-target avx512f } */
5 #include "avx512f-check.h"
10 compute_gatherqps (float *res
, __mmask8 m8
, long long *idx
,
11 float *src
, int scale
, float *r
)
15 for (i
= 0; i
< 8; i
++)
18 r
[i
] = *(float *) (((unsigned char *) src
) + idx
[i
] * scale
);
34 res
.x
= _mm256_setzero_ps();
36 for (i
= 0; i
< 8; i
++)
38 src
[i
] = 2.718281828459045 * (i
+ 1) * (i
+ 2);
40 /* About to gather in reverse order,
41 divide by 2 to demonstrate scale */
42 idx
.a
[i
] = (32 - (i
+ 1) * 4) >> 1;
45 res
.x
= _mm512_mask_i64gather_ps (res
.x
, m8
, idx
.x
, src
, SCALE
);
46 compute_gatherqps (res
.a
, m8
, idx
.a
, src
, SCALE
, res_ref
);
48 if (check_union256 (res
, res_ref
))
51 res
.x
= _mm512_i64gather_ps (idx
.x
, src
, SCALE
);
52 compute_gatherqps (res
.a
, 0xFF, idx
.a
, src
, SCALE
, res_ref
);
54 if (check_union256 (res
, res_ref
))