1 /* { dg-do compile } */
2 /* { dg-options "-mavx512vl -O2" } */
3 /* { dg-final { scan-assembler-times "valign\[dq\]" 8 } } */
4 /* { dg-final { scan-assembler-times "vextract" 12 } } */
5 
6 typedef float v8sf __attribute__((vector_size(32)));
7 typedef float v16sf __attribute__((vector_size(64)));
8 typedef int v8si __attribute__((vector_size(32)));
9 typedef int v16si __attribute__((vector_size(64)));
10 typedef double v4df __attribute__((vector_size(32)));
11 typedef double v8df __attribute__((vector_size(64)));
12 typedef long long v4di __attribute__((vector_size(32)));
13 typedef long long v8di __attribute__((vector_size(64)));
14 
15 #define EXTRACT(V,S,IDX)			\
16   S						\
17   __attribute__((noipa))			\
18   foo_##V##_##IDX (V v)				\
19   {						\
20     return v[IDX];				\
21   }						\
22 
23 EXTRACT (v8sf, float, 4);
24 EXTRACT (v8sf, float, 7);
25 EXTRACT (v8si, int, 4);
26 EXTRACT (v8si, int, 7);
27 EXTRACT (v16sf, float, 4);
28 EXTRACT (v16sf, float, 8);
29 EXTRACT (v16sf, float, 12);
30 EXTRACT (v16sf, float, 15);
31 EXTRACT (v16si, int, 4);
32 EXTRACT (v16si, int, 8);
33 EXTRACT (v16si, int, 12);
34 EXTRACT (v16si, int, 15);
35 EXTRACT (v4df, double, 2);
36 EXTRACT (v4df, double, 3);
37 EXTRACT (v4di, long long, 2);
38 EXTRACT (v4di, long long, 3);
39 EXTRACT (v8df, double, 4);
40 EXTRACT (v8df, double, 7);
41 EXTRACT (v8di, long long, 4);
42 EXTRACT (v8di, long long, 7);
43