R600: Add missing test for concat_vectors
[oota-llvm.git] / test / CodeGen / R600 / concat_vectors.ll
1 ; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2
3 ; FUNC-LABEL: @test_concat_v1i32
4 ; SI-NOT: MOVREL
5 define void @test_concat_v1i32(<2 x i32> addrspace(1)* %out, <1 x i32> %a, <1 x i32> %b) nounwind {
6   %concat = shufflevector <1 x i32> %a, <1 x i32> %b, <2 x i32> <i32 0, i32 1>
7   store <2 x i32> %concat, <2 x i32> addrspace(1)* %out, align 8
8   ret void
9 }
10
11 ; FUNC-LABEL: @test_concat_v2i32
12 ; SI-NOT: MOVREL
13 define void @test_concat_v2i32(<4 x i32> addrspace(1)* %out, <2 x i32> %a, <2 x i32> %b) nounwind {
14   %concat = shufflevector <2 x i32> %a, <2 x i32> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
15   store <4 x i32> %concat, <4 x i32> addrspace(1)* %out, align 16
16   ret void
17 }
18
19 ; FUNC-LABEL: @test_concat_v4i32
20 ; SI-NOT: MOVREL
21 define void @test_concat_v4i32(<8 x i32> addrspace(1)* %out, <4 x i32> %a, <4 x i32> %b) nounwind {
22   %concat = shufflevector <4 x i32> %a, <4 x i32> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
23   store <8 x i32> %concat, <8 x i32> addrspace(1)* %out, align 32
24   ret void
25 }
26
27 ; FUNC-LABEL: @test_concat_v8i32
28 ; SI-NOT: MOVREL
29 define void @test_concat_v8i32(<16 x i32> addrspace(1)* %out, <8 x i32> %a, <8 x i32> %b) nounwind {
30   %concat = shufflevector <8 x i32> %a, <8 x i32> %b, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
31   store <16 x i32> %concat, <16 x i32> addrspace(1)* %out, align 64
32   ret void
33 }
34
35 ; FUNC-LABEL: @test_concat_v16i32
36 ; SI-NOT: MOVREL
37 define void @test_concat_v16i32(<32 x i32> addrspace(1)* %out, <16 x i32> %a, <16 x i32> %b) nounwind {
38   %concat = shufflevector <16 x i32> %a, <16 x i32> %b, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
39   store <32 x i32> %concat, <32 x i32> addrspace(1)* %out, align 128
40   ret void
41 }
42
43 ; FUNC-LABEL: @test_concat_v1f32
44 ; SI-NOT: MOVREL
45 define void @test_concat_v1f32(<2 x float> addrspace(1)* %out, <1 x float> %a, <1 x float> %b) nounwind {
46   %concat = shufflevector <1 x float> %a, <1 x float> %b, <2 x i32> <i32 0, i32 1>
47   store <2 x float> %concat, <2 x float> addrspace(1)* %out, align 8
48   ret void
49 }
50
51 ; FUNC-LABEL: @test_concat_v2f32
52 ; SI-NOT: MOVREL
53 define void @test_concat_v2f32(<4 x float> addrspace(1)* %out, <2 x float> %a, <2 x float> %b) nounwind {
54   %concat = shufflevector <2 x float> %a, <2 x float> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
55   store <4 x float> %concat, <4 x float> addrspace(1)* %out, align 16
56   ret void
57 }
58
59 ; FUNC-LABEL: @test_concat_v4f32
60 ; SI-NOT: MOVREL
61 define void @test_concat_v4f32(<8 x float> addrspace(1)* %out, <4 x float> %a, <4 x float> %b) nounwind {
62   %concat = shufflevector <4 x float> %a, <4 x float> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
63   store <8 x float> %concat, <8 x float> addrspace(1)* %out, align 32
64   ret void
65 }
66
67 ; FUNC-LABEL: @test_concat_v8f32
68 ; SI-NOT: MOVREL
69 define void @test_concat_v8f32(<16 x float> addrspace(1)* %out, <8 x float> %a, <8 x float> %b) nounwind {
70   %concat = shufflevector <8 x float> %a, <8 x float> %b, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
71   store <16 x float> %concat, <16 x float> addrspace(1)* %out, align 64
72   ret void
73 }
74
75 ; FUNC-LABEL: @test_concat_v16f32
76 ; SI-NOT: MOVREL
77 define void @test_concat_v16f32(<32 x float> addrspace(1)* %out, <16 x float> %a, <16 x float> %b) nounwind {
78   %concat = shufflevector <16 x float> %a, <16 x float> %b, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
79   store <32 x float> %concat, <32 x float> addrspace(1)* %out, align 128
80   ret void
81 }
82
83 ; FUNC-LABEL: @test_concat_v1i64
84 ; SI-NOT: MOVREL
85 define void @test_concat_v1i64(<2 x double> addrspace(1)* %out, <1 x double> %a, <1 x double> %b) nounwind {
86   %concat = shufflevector <1 x double> %a, <1 x double> %b, <2 x i32> <i32 0, i32 1>
87   store <2 x double> %concat, <2 x double> addrspace(1)* %out, align 16
88   ret void
89 }
90
91 ; FUNC-LABEL: @test_concat_v2i64
92 ; SI-NOT: MOVREL
93 define void @test_concat_v2i64(<4 x double> addrspace(1)* %out, <2 x double> %a, <2 x double> %b) nounwind {
94   %concat = shufflevector <2 x double> %a, <2 x double> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
95   store <4 x double> %concat, <4 x double> addrspace(1)* %out, align 32
96   ret void
97 }
98
99 ; FUNC-LABEL: @test_concat_v4i64
100 ; SI-NOT: MOVREL
101 define void @test_concat_v4i64(<8 x double> addrspace(1)* %out, <4 x double> %a, <4 x double> %b) nounwind {
102   %concat = shufflevector <4 x double> %a, <4 x double> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
103   store <8 x double> %concat, <8 x double> addrspace(1)* %out, align 64
104   ret void
105 }
106
107 ; FUNC-LABEL: @test_concat_v8i64
108 ; SI-NOT: MOVREL
109 define void @test_concat_v8i64(<16 x double> addrspace(1)* %out, <8 x double> %a, <8 x double> %b) nounwind {
110   %concat = shufflevector <8 x double> %a, <8 x double> %b, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
111   store <16 x double> %concat, <16 x double> addrspace(1)* %out, align 128
112   ret void
113 }
114
115 ; FUNC-LABEL: @test_concat_v16i64
116 ; SI-NOT: MOVREL
117 define void @test_concat_v16i64(<32 x double> addrspace(1)* %out, <16 x double> %a, <16 x double> %b) nounwind {
118   %concat = shufflevector <16 x double> %a, <16 x double> %b, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
119   store <32 x double> %concat, <32 x double> addrspace(1)* %out, align 256
120   ret void
121 }
122
123 ; FUNC-LABEL: @test_concat_v1f64
124 ; SI-NOT: MOVREL
125 define void @test_concat_v1f64(<2 x double> addrspace(1)* %out, <1 x double> %a, <1 x double> %b) nounwind {
126   %concat = shufflevector <1 x double> %a, <1 x double> %b, <2 x i32> <i32 0, i32 1>
127   store <2 x double> %concat, <2 x double> addrspace(1)* %out, align 16
128   ret void
129 }
130
131 ; FUNC-LABEL: @test_concat_v2f64
132 ; SI-NOT: MOVREL
133 define void @test_concat_v2f64(<4 x double> addrspace(1)* %out, <2 x double> %a, <2 x double> %b) nounwind {
134   %concat = shufflevector <2 x double> %a, <2 x double> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
135   store <4 x double> %concat, <4 x double> addrspace(1)* %out, align 32
136   ret void
137 }
138
139 ; FUNC-LABEL: @test_concat_v4f64
140 ; SI-NOT: MOVREL
141 define void @test_concat_v4f64(<8 x double> addrspace(1)* %out, <4 x double> %a, <4 x double> %b) nounwind {
142   %concat = shufflevector <4 x double> %a, <4 x double> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
143   store <8 x double> %concat, <8 x double> addrspace(1)* %out, align 64
144   ret void
145 }
146
147 ; FUNC-LABEL: @test_concat_v8f64
148 ; SI-NOT: MOVREL
149 define void @test_concat_v8f64(<16 x double> addrspace(1)* %out, <8 x double> %a, <8 x double> %b) nounwind {
150   %concat = shufflevector <8 x double> %a, <8 x double> %b, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
151   store <16 x double> %concat, <16 x double> addrspace(1)* %out, align 128
152   ret void
153 }
154
155 ; FUNC-LABEL: @test_concat_v16f64
156 ; SI-NOT: MOVREL
157 define void @test_concat_v16f64(<32 x double> addrspace(1)* %out, <16 x double> %a, <16 x double> %b) nounwind {
158   %concat = shufflevector <16 x double> %a, <16 x double> %b, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
159   store <32 x double> %concat, <32 x double> addrspace(1)* %out, align 256
160   ret void
161 }
162
163 ; FUNC-LABEL: @test_concat_v1i1
164 ; SI-NOT: MOVREL
165 define void @test_concat_v1i1(<2 x i1> addrspace(1)* %out, <1 x i1> %a, <1 x i1> %b) nounwind {
166   %concat = shufflevector <1 x i1> %a, <1 x i1> %b, <2 x i32> <i32 0, i32 1>
167   store <2 x i1> %concat, <2 x i1> addrspace(1)* %out
168   ret void
169 }
170
171 ; FUNC-LABEL: @test_concat_v2i1
172 ; SI-NOT: MOVREL
173 define void @test_concat_v2i1(<4 x i1> addrspace(1)* %out, <2 x i1> %a, <2 x i1> %b) nounwind {
174   %concat = shufflevector <2 x i1> %a, <2 x i1> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
175   store <4 x i1> %concat, <4 x i1> addrspace(1)* %out
176   ret void
177 }
178
179 ; FUNC-LABEL: @test_concat_v4i1
180 ; SI-NOT: MOVREL
181 define void @test_concat_v4i1(<8 x i1> addrspace(1)* %out, <4 x i1> %a, <4 x i1> %b) nounwind {
182   %concat = shufflevector <4 x i1> %a, <4 x i1> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
183   store <8 x i1> %concat, <8 x i1> addrspace(1)* %out
184   ret void
185 }
186
187 ; FUNC-LABEL: @test_concat_v8i1
188 ; SI-NOT: MOVREL
189 define void @test_concat_v8i1(<16 x i1> addrspace(1)* %out, <8 x i1> %a, <8 x i1> %b) nounwind {
190   %concat = shufflevector <8 x i1> %a, <8 x i1> %b, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
191   store <16 x i1> %concat, <16 x i1> addrspace(1)* %out
192   ret void
193 }
194
195 ; FUNC-LABEL: @test_concat_v16i1
196 ; SI-NOT: MOVREL
197 define void @test_concat_v16i1(<32 x i1> addrspace(1)* %out, <16 x i1> %a, <16 x i1> %b) nounwind {
198   %concat = shufflevector <16 x i1> %a, <16 x i1> %b, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
199   store <32 x i1> %concat, <32 x i1> addrspace(1)* %out
200   ret void
201 }
202
203 ; FUNC-LABEL: @test_concat_v32i1
204 ; SI-NOT: MOVREL
205 define void @test_concat_v32i1(<64 x i1> addrspace(1)* %out, <32 x i1> %a, <32 x i1> %b) nounwind {
206   %concat = shufflevector <32 x i1> %a, <32 x i1> %b, <64 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 32, i32 33, i32 34, i32 35, i32 36, i32 37, i32 38, i32 39, i32 40, i32 41, i32 42, i32 43, i32 44, i32 45, i32 46, i32 47, i32 48, i32 49, i32 50, i32 51, i32 52, i32 53, i32 54, i32 55, i32 56, i32 57, i32 58, i32 59, i32 60, i32 61, i32 62, i32 63>
207   store <64 x i1> %concat, <64 x i1> addrspace(1)* %out
208   ret void
209 }
210
211 ; FUNC-LABEL: @test_concat_v1i16
212 ; SI-NOT: MOVREL
213 define void @test_concat_v1i16(<2 x i16> addrspace(1)* %out, <1 x i16> %a, <1 x i16> %b) nounwind {
214   %concat = shufflevector <1 x i16> %a, <1 x i16> %b, <2 x i32> <i32 0, i32 1>
215   store <2 x i16> %concat, <2 x i16> addrspace(1)* %out, align 4
216   ret void
217 }
218
219 ; FUNC-LABEL: @test_concat_v2i16
220 ; SI-NOT: MOVREL
221 define void @test_concat_v2i16(<4 x i16> addrspace(1)* %out, <2 x i16> %a, <2 x i16> %b) nounwind {
222   %concat = shufflevector <2 x i16> %a, <2 x i16> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
223   store <4 x i16> %concat, <4 x i16> addrspace(1)* %out, align 8
224   ret void
225 }
226
227 ; FUNC-LABEL: @test_concat_v4i16
228 ; SI-NOT: MOVREL
229 define void @test_concat_v4i16(<8 x i16> addrspace(1)* %out, <4 x i16> %a, <4 x i16> %b) nounwind {
230   %concat = shufflevector <4 x i16> %a, <4 x i16> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
231   store <8 x i16> %concat, <8 x i16> addrspace(1)* %out, align 16
232   ret void
233 }
234
235 ; FUNC-LABEL: @test_concat_v8i16
236 ; SI-NOT: MOVREL
237 define void @test_concat_v8i16(<16 x i16> addrspace(1)* %out, <8 x i16> %a, <8 x i16> %b) nounwind {
238   %concat = shufflevector <8 x i16> %a, <8 x i16> %b, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
239   store <16 x i16> %concat, <16 x i16> addrspace(1)* %out, align 32
240   ret void
241 }
242
243 ; FUNC-LABEL: @test_concat_v16i16
244 ; SI-NOT: MOVREL
245 define void @test_concat_v16i16(<32 x i16> addrspace(1)* %out, <16 x i16> %a, <16 x i16> %b) nounwind {
246   %concat = shufflevector <16 x i16> %a, <16 x i16> %b, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
247   store <32 x i16> %concat, <32 x i16> addrspace(1)* %out, align 64
248   ret void
249 }