1 /* { dg-require-effective-target vect_int } */
13 unsigned short out[N*8];
14 unsigned short in[N*8];
15 unsigned int in2[N*8];
16 unsigned int out2[N*8];
18 for (i = 0; i < N*8; i++)
21 if (y) /* Avoid vectorization. */
25 /* Induction is not SLPable yet. */
26 for (i = 0; i < N; i++)
28 out[i*8] = in[i*8] + i;
29 out[i*8 + 1] = in[i*8 + 1] + i;
30 out[i*8 + 2] = in[i*8 + 2] + i;
31 out[i*8 + 3] = in[i*8 + 3] + i;
32 out[i*8 + 4] = in[i*8 + 4] + i;
33 out[i*8 + 5] = in[i*8 + 5] + i;
34 out[i*8 + 6] = in[i*8 + 6] + i;
35 out[i*8 + 7] = in[i*8 + 7] + i;
39 for (i = 0; i < N; i++)
41 if (out[i*8] != in[i*8] + i
42 || out[i*8 + 1] != in[i*8 + 1] + i
43 || out[i*8 + 2] != in[i*8 + 2] + i
44 || out[i*8 + 3] != in[i*8 + 3] + i
45 || out[i*8 + 4] != in[i*8 + 4] + i
46 || out[i*8 + 5] != in[i*8 + 5] + i
47 || out[i*8 + 6] != in[i*8 + 6] + i
48 || out[i*8 + 7] != in[i*8 + 7] + i)
52 /* Induction is not SLPable yet and strided group size must be a power of 2
54 for (i = 0; i < N/2; i++)
56 out2[i*12] = in2[i*12] + i;
57 out2[i*12 + 1] = in2[i*12 + 1] + i;
58 out2[i*12 + 2] = in2[i*12 + 2] + i;
59 out2[i*12 + 3] = in2[i*12 + 3] + i;
60 out2[i*12 + 4] = in2[i*12 + 4] + i;
61 out2[i*12 + 5] = in2[i*12 + 5] + i;
62 out2[i*12 + 6] = in2[i*12 + 6] + i;
63 out2[i*12 + 7] = in2[i*12 + 7] + i;
64 out2[i*12 + 8] = in2[i*12 + 8] + i;
65 out2[i*12 + 9] = in2[i*12 + 9] + i;
66 out2[i*12 + 10] = in2[i*12 + 10] + i;
67 out2[i*12 + 11] = in2[i*12 + 11] + i;
71 for (i = 0; i < N/2; i++)
73 if (out2[i*12] != in2[i*12] + i
74 || out2[i*12 + 1] != in2[i*12 + 1] + i
75 || out2[i*12 + 2] != in2[i*12 + 2] + i
76 || out2[i*12 + 3] != in2[i*12 + 3] + i
77 || out2[i*12 + 4] != in2[i*12 + 4] + i
78 || out2[i*12 + 5] != in2[i*12 + 5] + i
79 || out2[i*12 + 6] != in2[i*12 + 6] + i
80 || out2[i*12 + 7] != in2[i*12 + 7] + i
81 || out2[i*12 + 8] != in2[i*12 + 8] + i
82 || out2[i*12 + 9] != in2[i*12 + 9] + i
83 || out2[i*12 + 10] != in2[i*12 + 10] + i
84 || out2[i*12 + 11] != in2[i*12 + 11] + i)
88 /* Not power of 2 but SLPable. */
89 for (i = 0; i < N/2; i++)
91 out2[i*12] = in2[i*12] + 1;
92 out2[i*12 + 1] = in2[i*12 + 1] + 2;
93 out2[i*12 + 2] = in2[i*12 + 2] + 3;
94 out2[i*12 + 3] = in2[i*12 + 3] + 4;
95 out2[i*12 + 4] = in2[i*12 + 4] + 5;
96 out2[i*12 + 5] = in2[i*12 + 5] + 6;
97 out2[i*12 + 6] = in2[i*12 + 6] + 7;
98 out2[i*12 + 7] = in2[i*12 + 7] + 8;
99 out2[i*12 + 8] = in2[i*12 + 8] + 9;
100 out2[i*12 + 9] = in2[i*12 + 9] + 10;
101 out2[i*12 + 10] = in2[i*12 + 10] + 11;
102 out2[i*12 + 11] = in2[i*12 + 11] + 12;
106 for (i = 0; i < N/2; i++)
108 if (out2[i*12] != in2[i*12] + 1
109 || out2[i*12 + 1] != in2[i*12 + 1] + 2
110 || out2[i*12 + 2] != in2[i*12 + 2] + 3
111 || out2[i*12 + 3] != in2[i*12 + 3] + 4
112 || out2[i*12 + 4] != in2[i*12 + 4] + 5
113 || out2[i*12 + 5] != in2[i*12 + 5] + 6
114 || out2[i*12 + 6] != in2[i*12 + 6] + 7
115 || out2[i*12 + 7] != in2[i*12 + 7] + 8
116 || out2[i*12 + 8] != in2[i*12 + 8] + 9
117 || out2[i*12 + 9] != in2[i*12 + 9] + 10
118 || out2[i*12 + 10] != in2[i*12 + 10] + 11
119 || out2[i*12 + 11] != in2[i*12 + 11] + 12)
137 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
138 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { xfail *-*-* } } } */
139 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
140 /* { dg-final { cleanup-tree-dump "vect" } } */