2 /* { dg-options "-O2 -msse2" } */
3 /* { dg-require-effective-target sse2_runtime } */
5 extern void abort (void);
6 typedef unsigned long long uint64_t;
8 #define vector(elcount, type) \
9 __attribute__((vector_size((elcount)*sizeof(type)))) type
11 #define FN(elcount, type, idx) \
12 __attribute__((noinline, noclone)) \
13 type f##type##elcount##_##idx (vector (elcount, type) x) { return x[idx] + 1; }
14 #define T2(elcount, type) \
16 F (elcount, type, 0) \
18 #define T4(elcount, type) \
20 F (elcount, type, 2) \
22 #define T8(elcount, type) \
24 F (elcount, type, 4) \
25 F (elcount, type, 5) \
26 F (elcount, type, 6) \
28 #define T16(elcount, type) \
30 F (elcount, type, 8) \
31 F (elcount, type, 9) \
32 F (elcount, type, 10) \
33 F (elcount, type, 11) \
34 F (elcount, type, 12) \
35 F (elcount, type, 13) \
36 F (elcount, type, 14) \
38 #define T32(elcount, type) \
40 F (elcount, type, 16) \
41 F (elcount, type, 17) \
42 F (elcount, type, 18) \
43 F (elcount, type, 19) \
44 F (elcount, type, 20) \
45 F (elcount, type, 21) \
46 F (elcount, type, 22) \
47 F (elcount, type, 23) \
48 F (elcount, type, 24) \
49 F (elcount, type, 25) \
50 F (elcount, type, 26) \
51 F (elcount, type, 27) \
52 F (elcount, type, 28) \
53 F (elcount, type, 29) \
54 F (elcount, type, 30) \
71 #define TESTS TESTS_SSE2 TESTS_AVX
73 #define TESTS TESTS_SSE2
77 #define H(elcount, type)
87 #define H(elcount, type) \
88 vector (elcount, type) v##type##elcount = {
90 #define F(elcount, type, idx) idx + 1,
95 #define H(elcount, type)
97 #define F(elcount, type, idx) \
98 if (f##type##elcount##_##idx (v##type##elcount) != idx + 2) \