2 /* { dg-require-effective-target avx2 } */
3 /* { dg-options "-O2 -mavx2" } */
6 #include "avx2-check.h"
9 compute_i64gatherq256 (long long *s1
, long long *s2
, int scale
, long long *r
)
13 for (i
= 0; i
< 4; ++i
)
14 r
[i
] = *(long long *) (((unsigned char *) s1
) + s2
[i
] * scale
);
23 long long s1
[4], res_ref
[4] = { 0 };
25 for (i
= 0; i
< 4; ++i
)
28 s1
[i
] = 1983 * (i
+ 1) * (i
+ 2);
30 /* About to gather in reverse order,
31 divide by 2 to demonstrate scale */
32 idx
.a
[i
] = (32 - (i
+ 1) * 8) >> 1;
35 res
.x
= _mm256_i64gather_epi64 ((long long int *) s1
, idx
.x
, 2);
37 compute_i64gatherq256 (s1
, idx
.a
, 2, res_ref
);
39 if (check_union256i_q (res
, res_ref
) != 0)