1 /* { dg-require-effective-target vect_int } */
8 unsigned short in
[N
*8];
14 unsigned short out
[N
*8];
16 for (i
= 0; i
< N
*8; i
++)
19 asm volatile ("" ::: "memory");
22 for (i
= 0; i
< N
; i
++)
25 out
[i
*8 + 1] = in
[i
*8 + 1];
26 out
[i
*8 + 2] = in
[i
*8 + 2];
27 out
[i
*8 + 3] = in
[i
*8 + 3];
28 out
[i
*8 + 4] = in
[i
*8 + 4];
29 out
[i
*8 + 5] = in
[i
*8 + 5];
30 out
[i
*8 + 6] = in
[i
*8 + 6];
31 out
[i
*8 + 7] = in
[i
*8 + 7];
36 for (i
= 0; i
< N
; i
++)
38 if (out
[i
*8] != in
[i
*8]
39 || out
[i
*8 + 1] != in
[i
*8 + 1]
40 || out
[i
*8 + 2] != in
[i
*8 + 2]
41 || out
[i
*8 + 3] != in
[i
*8 + 3]
42 || out
[i
*8 + 4] != in
[i
*8 + 4]
43 || out
[i
*8 + 5] != in
[i
*8 + 5]
44 || out
[i
*8 + 6] != in
[i
*8 + 6]
45 || out
[i
*8 + 7] != in
[i
*8 + 7])
49 for (i
= 0; i
< N
*2; i
++)
52 out
[i
*4 + 1] = in
[i
*4 + 1];
53 out
[i
*4 + 2] = in
[i
*4 + 2];
54 out
[i
*4 + 3] = in
[i
*4 + 3];
59 for (i
= 0; i
< N
*2; i
++)
61 if (out
[i
*4] != in
[i
*4]
62 || out
[i
*4 + 1] != in
[i
*4 + 1]
63 || out
[i
*4 + 2] != in
[i
*4 + 2]
64 || out
[i
*4 + 3] != in
[i
*4 + 3])
68 for (i
= 0; i
< N
/2; i
++)
71 out
[i
*16 + 1] = in
[i
*16 + 1];
72 out
[i
*16 + 2] = in
[i
*16 + 2];
73 out
[i
*16 + 3] = in
[i
*16 + 3];
74 out
[i
*16 + 4] = in
[i
*16 + 4];
75 out
[i
*16 + 5] = in
[i
*16 + 5];
76 out
[i
*16 + 6] = in
[i
*16 + 6];
77 out
[i
*16 + 7] = in
[i
*16 + 7];
78 out
[i
*16 + 8] = in
[i
*16 + 8];
79 out
[i
*16 + 9] = in
[i
*16 + 9];
80 out
[i
*16 + 10] = in
[i
*16 + 10];
81 out
[i
*16 + 11] = in
[i
*16 + 11];
82 out
[i
*16 + 12] = in
[i
*16 + 12];
83 out
[i
*16 + 13] = in
[i
*16 + 13];
84 out
[i
*16 + 14] = in
[i
*16 + 14];
85 out
[i
*16 + 15] = in
[i
*16 + 15];
90 for (i
= 0; i
< N
/2; i
++)
92 if (out
[i
*16] != in
[i
*16]
93 || out
[i
*16 + 1] != in
[i
*16 + 1]
94 || out
[i
*16 + 2] != in
[i
*16 + 2]
95 || out
[i
*16 + 3] != in
[i
*16 + 3]
96 || out
[i
*16 + 4] != in
[i
*16 + 4]
97 || out
[i
*16 + 5] != in
[i
*16 + 5]
98 || out
[i
*16 + 6] != in
[i
*16 + 6]
99 || out
[i
*16 + 7] != in
[i
*16 + 7]
100 || out
[i
*16 + 8] != in
[i
*16 + 8]
101 || out
[i
*16 + 9] != in
[i
*16 + 9]
102 || out
[i
*16 + 10] != in
[i
*16 + 10]
103 || out
[i
*16 + 11] != in
[i
*16 + 11]
104 || out
[i
*16 + 12] != in
[i
*16 + 12]
105 || out
[i
*16 + 13] != in
[i
*16 + 13]
106 || out
[i
*16 + 14] != in
[i
*16 + 14]
107 || out
[i
*16 + 15] != in
[i
*16 + 15])
111 /* SLP with unrolling by 8. */
112 for (i
= 0; i
< N
/4; i
++)
115 out
[i
*9 + 1] = in
[i
*9 + 1];
116 out
[i
*9 + 2] = in
[i
*9 + 2];
117 out
[i
*9 + 3] = in
[i
*9 + 3];
118 out
[i
*9 + 4] = in
[i
*9 + 4];
119 out
[i
*9 + 5] = in
[i
*9 + 5];
120 out
[i
*9 + 6] = in
[i
*9 + 6];
121 out
[i
*9 + 7] = in
[i
*9 + 7];
122 out
[i
*9 + 8] = in
[i
*9 + 8];
127 for (i
= 0; i
< N
/4; i
++)
129 if (out
[i
*9] != in
[i
*9]
130 || out
[i
*9 + 1] != in
[i
*9 + 1]
131 || out
[i
*9 + 2] != in
[i
*9 + 2]
132 || out
[i
*9 + 3] != in
[i
*9 + 3]
133 || out
[i
*9 + 4] != in
[i
*9 + 4]
134 || out
[i
*9 + 5] != in
[i
*9 + 5]
135 || out
[i
*9 + 6] != in
[i
*9 + 6]
136 || out
[i
*9 + 7] != in
[i
*9 + 7]
137 || out
[i
*9 + 8] != in
[i
*9 + 8])
154 /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
155 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" } } */