1 /* { dg-require-effective-target vect_int } */
12 unsigned short out
[N
*8];
13 unsigned short in
[N
*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
14 unsigned int in2
[N
*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
15 unsigned int out2
[N
*8];
17 /* Induction is SLPable. */
18 for (i
= 0; i
< N
; i
++)
20 out
[i
*8] = in
[i
*8] + i
;
21 out
[i
*8 + 1] = in
[i
*8 + 1] + i
;
22 out
[i
*8 + 2] = in
[i
*8 + 2] + i
;
23 out
[i
*8 + 3] = in
[i
*8 + 3] + i
;
24 out
[i
*8 + 4] = in
[i
*8 + 4] + i
;
25 out
[i
*8 + 5] = in
[i
*8 + 5] + i
;
26 out
[i
*8 + 6] = in
[i
*8 + 6] + i
;
27 out
[i
*8 + 7] = in
[i
*8 + 7] + i
;
31 for (i
= 0; i
< N
; i
++)
33 if (out
[i
*8] != in
[i
*8] + i
34 || out
[i
*8 + 1] != in
[i
*8 + 1] + i
35 || out
[i
*8 + 2] != in
[i
*8 + 2] + i
36 || out
[i
*8 + 3] != in
[i
*8 + 3] + i
37 || out
[i
*8 + 4] != in
[i
*8 + 4] + i
38 || out
[i
*8 + 5] != in
[i
*8 + 5] + i
39 || out
[i
*8 + 6] != in
[i
*8 + 6] + i
40 || out
[i
*8 + 7] != in
[i
*8 + 7] + i
)
44 /* Induction is SLPable. */
45 for (i
= 0; i
< N
/2; i
++)
47 out2
[i
*12] = in2
[i
*12] + i
;
48 out2
[i
*12 + 1] = in2
[i
*12 + 1] + i
;
49 out2
[i
*12 + 2] = in2
[i
*12 + 2] + i
;
50 out2
[i
*12 + 3] = in2
[i
*12 + 3] + i
;
51 out2
[i
*12 + 4] = in2
[i
*12 + 4] + i
;
52 out2
[i
*12 + 5] = in2
[i
*12 + 5] + i
;
53 out2
[i
*12 + 6] = in2
[i
*12 + 6] + i
;
54 out2
[i
*12 + 7] = in2
[i
*12 + 7] + i
;
55 out2
[i
*12 + 8] = in2
[i
*12 + 8] + i
;
56 out2
[i
*12 + 9] = in2
[i
*12 + 9] + i
;
57 out2
[i
*12 + 10] = in2
[i
*12 + 10] + i
;
58 out2
[i
*12 + 11] = in2
[i
*12 + 11] + i
;
62 for (i
= 0; i
< N
/2; i
++)
64 if (out2
[i
*12] != in2
[i
*12] + i
65 || out2
[i
*12 + 1] != in2
[i
*12 + 1] + i
66 || out2
[i
*12 + 2] != in2
[i
*12 + 2] + i
67 || out2
[i
*12 + 3] != in2
[i
*12 + 3] + i
68 || out2
[i
*12 + 4] != in2
[i
*12 + 4] + i
69 || out2
[i
*12 + 5] != in2
[i
*12 + 5] + i
70 || out2
[i
*12 + 6] != in2
[i
*12 + 6] + i
71 || out2
[i
*12 + 7] != in2
[i
*12 + 7] + i
72 || out2
[i
*12 + 8] != in2
[i
*12 + 8] + i
73 || out2
[i
*12 + 9] != in2
[i
*12 + 9] + i
74 || out2
[i
*12 + 10] != in2
[i
*12 + 10] + i
75 || out2
[i
*12 + 11] != in2
[i
*12 + 11] + i
)
79 /* Not power of 2 but SLPable. */
80 for (i
= 0; i
< N
/2; i
++)
82 out2
[i
*12] = in2
[i
*12] + 1;
83 out2
[i
*12 + 1] = in2
[i
*12 + 1] + 2;
84 out2
[i
*12 + 2] = in2
[i
*12 + 2] + 3;
85 out2
[i
*12 + 3] = in2
[i
*12 + 3] + 4;
86 out2
[i
*12 + 4] = in2
[i
*12 + 4] + 5;
87 out2
[i
*12 + 5] = in2
[i
*12 + 5] + 6;
88 out2
[i
*12 + 6] = in2
[i
*12 + 6] + 7;
89 out2
[i
*12 + 7] = in2
[i
*12 + 7] + 8;
90 out2
[i
*12 + 8] = in2
[i
*12 + 8] + 9;
91 out2
[i
*12 + 9] = in2
[i
*12 + 9] + 10;
92 out2
[i
*12 + 10] = in2
[i
*12 + 10] + 11;
93 out2
[i
*12 + 11] = in2
[i
*12 + 11] + 12;
97 for (i
= 0; i
< N
/2; i
++)
99 if (out2
[i
*12] != in2
[i
*12] + 1
100 || out2
[i
*12 + 1] != in2
[i
*12 + 1] + 2
101 || out2
[i
*12 + 2] != in2
[i
*12 + 2] + 3
102 || out2
[i
*12 + 3] != in2
[i
*12 + 3] + 4
103 || out2
[i
*12 + 4] != in2
[i
*12 + 4] + 5
104 || out2
[i
*12 + 5] != in2
[i
*12 + 5] + 6
105 || out2
[i
*12 + 6] != in2
[i
*12 + 6] + 7
106 || out2
[i
*12 + 7] != in2
[i
*12 + 7] + 8
107 || out2
[i
*12 + 8] != in2
[i
*12 + 8] + 9
108 || out2
[i
*12 + 9] != in2
[i
*12 + 9] + 10
109 || out2
[i
*12 + 10] != in2
[i
*12 + 10] + 11
110 || out2
[i
*12 + 11] != in2
[i
*12 + 11] + 12)
128 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { { vect_interleave && vect_extract_even_odd } && { ! vect_pack_trunc } } } } } */
129 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { ! vect_pack_trunc } } } } */
130 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { { vect_interleave && vect_extract_even_odd } && vect_pack_trunc } } } } */
131 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { target vect_pack_trunc } } } */