1 /* { dg-do compile { target { ! ia32 } } } */
2 /* { dg-require-effective-target maybe_x32 } */
3 /* { dg-options "-mx32 -O2 -march=haswell" } */
4 /* { dg-final { scan-assembler "\tvgather" } } */
5 /* { dg-final { scan-assembler-not "addr32 vgather" } } */
6 
7 typedef double __v2df __attribute__ ((__vector_size__ (16)));
8 typedef int __v4si __attribute__ ((__vector_size__ (16)));
9 typedef long long __v2di __attribute__ ((__vector_size__ (16)));
10 
11 typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
12 typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__));
13 
14 extern __inline __m128d
15 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm_i64gather_pd(double const * __base,__m128i __index,const int __scale)16 _mm_i64gather_pd (double const *__base, __m128i __index, const int __scale)
17 {
18   __v2df __zero = { 0.0, 0.0 };
19   __v2df __mask = __builtin_ia32_cmpeqpd (__zero, __zero);
20 
21   return (__m128d) __builtin_ia32_gatherdiv2df (__zero,
22 						__base,
23 						(__v2di)__index,
24 						__mask,
25 						__scale);
26 }
27 
28 __m128d x;
29 double *base;
30 __m128i idx;
31 
32 void extern
avx2_test(void)33 avx2_test (void)
34 {
35   x = _mm_i64gather_pd (base, idx, 1);
36 }
37