1 /* { dg-require-effective-target vect_int } */
12 unsigned short out
[N
*8];
13 unsigned short in
[N
*8];
14 unsigned int in2
[N
*8];
15 unsigned int out2
[N
*8];
17 for (i
= 0; i
< N
*8; i
++)
20 asm volatile ("" ::: "memory");
23 /* Induction is SLPable. */
24 for (i
= 0; i
< N
; i
++)
26 out
[i
*8] = in
[i
*8] + i
;
27 out
[i
*8 + 1] = in
[i
*8 + 1] + i
;
28 out
[i
*8 + 2] = in
[i
*8 + 2] + i
;
29 out
[i
*8 + 3] = in
[i
*8 + 3] + i
;
30 out
[i
*8 + 4] = in
[i
*8 + 4] + i
;
31 out
[i
*8 + 5] = in
[i
*8 + 5] + i
;
32 out
[i
*8 + 6] = in
[i
*8 + 6] + i
;
33 out
[i
*8 + 7] = in
[i
*8 + 7] + i
;
38 for (i
= 0; i
< N
; i
++)
40 if (out
[i
*8] != in
[i
*8] + i
41 || out
[i
*8 + 1] != in
[i
*8 + 1] + i
42 || out
[i
*8 + 2] != in
[i
*8 + 2] + i
43 || out
[i
*8 + 3] != in
[i
*8 + 3] + i
44 || out
[i
*8 + 4] != in
[i
*8 + 4] + i
45 || out
[i
*8 + 5] != in
[i
*8 + 5] + i
46 || out
[i
*8 + 6] != in
[i
*8 + 6] + i
47 || out
[i
*8 + 7] != in
[i
*8 + 7] + i
)
51 /* Induction is SLPable. */
52 for (i
= 0; i
< N
/2; i
++)
54 out2
[i
*12] = in2
[i
*12] + i
;
55 out2
[i
*12 + 1] = in2
[i
*12 + 1] + i
;
56 out2
[i
*12 + 2] = in2
[i
*12 + 2] + i
;
57 out2
[i
*12 + 3] = in2
[i
*12 + 3] + i
;
58 out2
[i
*12 + 4] = in2
[i
*12 + 4] + i
;
59 out2
[i
*12 + 5] = in2
[i
*12 + 5] + i
;
60 out2
[i
*12 + 6] = in2
[i
*12 + 6] + i
;
61 out2
[i
*12 + 7] = in2
[i
*12 + 7] + i
;
62 out2
[i
*12 + 8] = in2
[i
*12 + 8] + i
;
63 out2
[i
*12 + 9] = in2
[i
*12 + 9] + i
;
64 out2
[i
*12 + 10] = in2
[i
*12 + 10] + i
;
65 out2
[i
*12 + 11] = in2
[i
*12 + 11] + i
;
70 for (i
= 0; i
< N
/2; i
++)
72 if (out2
[i
*12] != in2
[i
*12] + i
73 || out2
[i
*12 + 1] != in2
[i
*12 + 1] + i
74 || out2
[i
*12 + 2] != in2
[i
*12 + 2] + i
75 || out2
[i
*12 + 3] != in2
[i
*12 + 3] + i
76 || out2
[i
*12 + 4] != in2
[i
*12 + 4] + i
77 || out2
[i
*12 + 5] != in2
[i
*12 + 5] + i
78 || out2
[i
*12 + 6] != in2
[i
*12 + 6] + i
79 || out2
[i
*12 + 7] != in2
[i
*12 + 7] + i
80 || out2
[i
*12 + 8] != in2
[i
*12 + 8] + i
81 || out2
[i
*12 + 9] != in2
[i
*12 + 9] + i
82 || out2
[i
*12 + 10] != in2
[i
*12 + 10] + i
83 || out2
[i
*12 + 11] != in2
[i
*12 + 11] + i
)
87 /* Not power of 2 but SLPable. */
88 for (i
= 0; i
< N
/2; i
++)
90 out2
[i
*12] = in2
[i
*12] + 1;
91 out2
[i
*12 + 1] = in2
[i
*12 + 1] + 2;
92 out2
[i
*12 + 2] = in2
[i
*12 + 2] + 3;
93 out2
[i
*12 + 3] = in2
[i
*12 + 3] + 4;
94 out2
[i
*12 + 4] = in2
[i
*12 + 4] + 5;
95 out2
[i
*12 + 5] = in2
[i
*12 + 5] + 6;
96 out2
[i
*12 + 6] = in2
[i
*12 + 6] + 7;
97 out2
[i
*12 + 7] = in2
[i
*12 + 7] + 8;
98 out2
[i
*12 + 8] = in2
[i
*12 + 8] + 9;
99 out2
[i
*12 + 9] = in2
[i
*12 + 9] + 10;
100 out2
[i
*12 + 10] = in2
[i
*12 + 10] + 11;
101 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 } && { ! vect_pack_trunc } } } } } */
138 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { ! vect_pack_trunc } } } } */
139 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { { vect_interleave && vect_extract_even_odd } && vect_pack_trunc } } } } */
140 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { target vect_pack_trunc } } } */