Disable AArch64 fast-isel on big-endian call vector returns.
[oota-llvm.git] / test / CodeGen / AArch64 / arm64-big-endian-vector-caller.ll
1 ; RUN: llc -mtriple aarch64_be < %s -aarch64-load-store-opt=false -o - | FileCheck %s
2 ; RUN: llc -mtriple aarch64_be < %s -aarch64-load-store-opt=false -fast-isel=true -O0 -o - | FileCheck %s
3
4 ; Note, we split the functions in to multiple BBs below to isolate the call
5 ; instruction we want to test, from fast-isel failing to select instructions
6 ; after it.
7
8 ; CHECK-LABEL: test_i64_f64:
9 declare i64 @test_i64_f64_helper(double %p)
10 define void @test_i64_f64(double* %p, i64* %q) {
11 ; CHECK-NOT: rev
12     %1 = load double, double* %p
13     %2 = fadd double %1, %1
14     %3 = call i64 @test_i64_f64_helper(double %2)
15     br label %return_bb
16 return_bb:
17     %4 = add i64 %3, %3
18     store i64 %4, i64* %q
19     ret void
20 }
21
22 ; CHECK-LABEL: test_i64_v1i64:
23 declare i64 @test_i64_v1i64_helper(<1 x i64> %p)
24 define void @test_i64_v1i64(<1 x i64>* %p, i64* %q) {
25 ; CHECK-NOT: rev
26     %1 = load <1 x i64>, <1 x i64>* %p
27     %2 = add <1 x i64> %1, %1
28     %3 = call i64 @test_i64_v1i64_helper(<1 x i64> %2)
29     br label %return_bb
30 return_bb:
31     %4 = add i64 %3, %3
32     store i64 %4, i64* %q
33     ret void
34 }
35
36 ; CHECK-LABEL: test_i64_v2f32:
37 declare i64 @test_i64_v2f32_helper(<2 x float> %p)
38 define void @test_i64_v2f32(<2 x float>* %p, i64* %q) {
39 ; CHECK: rev64 v{{[0-9]+}}.2s
40     %1 = load <2 x float>, <2 x float>* %p
41     %2 = fadd <2 x float> %1, %1
42     %3 = call i64 @test_i64_v2f32_helper(<2 x float> %2)
43     br label %return_bb
44 return_bb:
45     %4 = add i64 %3, %3
46     store i64 %4, i64* %q
47     ret void
48 }
49
50 ; CHECK-LABEL: test_i64_v2i32:
51 declare i64 @test_i64_v2i32_helper(<2 x i32> %p)
52 define void @test_i64_v2i32(<2 x i32>* %p, i64* %q) {
53 ; CHECK: rev64 v{{[0-9]+}}.2s
54     %1 = load <2 x i32>, <2 x i32>* %p
55     %2 = add <2 x i32> %1, %1
56     %3 = call i64 @test_i64_v2i32_helper(<2 x i32> %2)
57     br label %return_bb
58 return_bb:
59     %4 = add i64 %3, %3
60     store i64 %4, i64* %q
61     ret void
62 }
63
64 ; CHECK-LABEL: test_i64_v4i16:
65 declare i64 @test_i64_v4i16_helper(<4 x i16> %p)
66 define void @test_i64_v4i16(<4 x i16>* %p, i64* %q) {
67 ; CHECK: rev64 v{{[0-9]+}}.4h
68     %1 = load <4 x i16>, <4 x i16>* %p
69     %2 = add <4 x i16> %1, %1
70     %3 = call i64 @test_i64_v4i16_helper(<4 x i16> %2)
71     br label %return_bb
72 return_bb:
73     %4 = add i64 %3, %3
74     store i64 %4, i64* %q
75     ret void
76 }
77
78 ; CHECK-LABEL: test_i64_v8i8:
79 declare i64 @test_i64_v8i8_helper(<8 x i8> %p)
80 define void @test_i64_v8i8(<8 x i8>* %p, i64* %q) {
81 ; CHECK: rev64 v{{[0-9]+}}.8b
82     %1 = load <8 x i8>, <8 x i8>* %p
83     %2 = add <8 x i8> %1, %1
84     %3 = call i64 @test_i64_v8i8_helper(<8 x i8> %2)
85     br label %return_bb
86 return_bb:
87     %4 = add i64 %3, %3
88     store i64 %4, i64* %q
89     ret void
90 }
91
92 ; CHECK-LABEL: test_f64_i64:
93 declare double @test_f64_i64_helper(i64 %p)
94 define void @test_f64_i64(i64* %p, double* %q) {
95 ; CHECK-NOT: rev
96     %1 = load i64, i64* %p
97     %2 = add i64 %1, %1
98     %3 = call double @test_f64_i64_helper(i64 %2)
99     br label %return_bb
100 return_bb:
101     %4 = fadd double %3, %3
102     store double %4, double* %q
103     ret void
104 }
105
106 ; CHECK-LABEL: test_f64_v1i64:
107 declare double @test_f64_v1i64_helper(<1 x i64> %p)
108 define void @test_f64_v1i64(<1 x i64>* %p, double* %q) {
109 ; CHECK-NOT: rev
110     %1 = load <1 x i64>, <1 x i64>* %p
111     %2 = add <1 x i64> %1, %1
112     %3 = call double @test_f64_v1i64_helper(<1 x i64> %2)
113     br label %return_bb
114 return_bb:
115     %4 = fadd double %3, %3
116     store double %4, double* %q
117     ret void
118 }
119
120 ; CHECK-LABEL: test_f64_v2f32:
121 declare double @test_f64_v2f32_helper(<2 x float> %p)
122 define void @test_f64_v2f32(<2 x float>* %p, double* %q) {
123 ; CHECK: rev64 v{{[0-9]+}}.2s
124     %1 = load <2 x float>, <2 x float>* %p
125     %2 = fadd <2 x float> %1, %1
126     %3 = call double @test_f64_v2f32_helper(<2 x float> %2)
127     br label %return_bb
128 return_bb:
129     %4 = fadd double %3, %3
130     store double %4, double* %q
131     ret void
132 }
133
134 ; CHECK-LABEL: test_f64_v2i32:
135 declare double @test_f64_v2i32_helper(<2 x i32> %p)
136 define void @test_f64_v2i32(<2 x i32>* %p, double* %q) {
137 ; CHECK: rev64 v{{[0-9]+}}.2s
138     %1 = load <2 x i32>, <2 x i32>* %p
139     %2 = add <2 x i32> %1, %1
140     %3 = call double @test_f64_v2i32_helper(<2 x i32> %2)
141     br label %return_bb
142 return_bb:
143     %4 = fadd double %3, %3
144     store double %4, double* %q
145     ret void
146 }
147
148 ; CHECK-LABEL: test_f64_v4i16:
149 declare double @test_f64_v4i16_helper(<4 x i16> %p)
150 define void @test_f64_v4i16(<4 x i16>* %p, double* %q) {
151 ; CHECK: rev64 v{{[0-9]+}}.4h
152     %1 = load <4 x i16>, <4 x i16>* %p
153     %2 = add <4 x i16> %1, %1
154     %3 = call double @test_f64_v4i16_helper(<4 x i16> %2)
155     br label %return_bb
156 return_bb:
157     %4 = fadd double %3, %3
158     store double %4, double* %q
159     ret void
160 }
161
162 ; CHECK-LABEL: test_f64_v8i8:
163 declare double @test_f64_v8i8_helper(<8 x i8> %p)
164 define void @test_f64_v8i8(<8 x i8>* %p, double* %q) {
165 ; CHECK: rev64 v{{[0-9]+}}.8b
166     %1 = load <8 x i8>, <8 x i8>* %p
167     %2 = add <8 x i8> %1, %1
168     %3 = call double @test_f64_v8i8_helper(<8 x i8> %2)
169     br label %return_bb
170 return_bb:
171     %4 = fadd double %3, %3
172     store double %4, double* %q
173     ret void
174 }
175
176 ; CHECK-LABEL: test_v1i64_i64:
177 declare <1 x i64> @test_v1i64_i64_helper(i64 %p)
178 define void @test_v1i64_i64(i64* %p, <1 x i64>* %q) {
179 ; CHECK-NOT: rev
180     %1 = load i64, i64* %p
181     %2 = add i64 %1, %1
182     %3 = call <1 x i64> @test_v1i64_i64_helper(i64 %2)
183     br label %return_bb
184 return_bb:
185     %4 = add <1 x i64> %3, %3
186     store <1 x i64> %4, <1 x i64>* %q
187     ret void
188 }
189
190 ; CHECK-LABEL: test_v1i64_f64:
191 declare <1 x i64> @test_v1i64_f64_helper(double %p)
192 define void @test_v1i64_f64(double* %p, <1 x i64>* %q) {
193 ; CHECK-NOT: rev
194     %1 = load double, double* %p
195     %2 = fadd double %1, %1
196     %3 = call <1 x i64> @test_v1i64_f64_helper(double %2)
197     br label %return_bb
198 return_bb:
199     %4 = add <1 x i64> %3, %3
200     store <1 x i64> %4, <1 x i64>* %q
201     ret void
202 }
203
204 ; CHECK-LABEL: test_v1i64_v2f32:
205 declare <1 x i64> @test_v1i64_v2f32_helper(<2 x float> %p)
206 define void @test_v1i64_v2f32(<2 x float>* %p, <1 x i64>* %q) {
207 ; CHECK: rev64 v{{[0-9]+}}.2s
208     %1 = load <2 x float>, <2 x float>* %p
209     %2 = fadd <2 x float> %1, %1
210     %3 = call <1 x i64> @test_v1i64_v2f32_helper(<2 x float> %2)
211     br label %return_bb
212 return_bb:
213     %4 = add <1 x i64> %3, %3
214     store <1 x i64> %4, <1 x i64>* %q
215     ret void
216 }
217
218 ; CHECK-LABEL: test_v1i64_v2i32:
219 declare <1 x i64> @test_v1i64_v2i32_helper(<2 x i32> %p)
220 define void @test_v1i64_v2i32(<2 x i32>* %p, <1 x i64>* %q) {
221 ; CHECK: rev64 v{{[0-9]+}}.2s
222     %1 = load <2 x i32>, <2 x i32>* %p
223     %2 = add <2 x i32> %1, %1
224     %3 = call <1 x i64> @test_v1i64_v2i32_helper(<2 x i32> %2)
225     br label %return_bb
226 return_bb:
227     %4 = add <1 x i64> %3, %3
228     store <1 x i64> %4, <1 x i64>* %q
229     ret void
230 }
231
232 ; CHECK-LABEL: test_v1i64_v4i16:
233 declare <1 x i64> @test_v1i64_v4i16_helper(<4 x i16> %p)
234 define void @test_v1i64_v4i16(<4 x i16>* %p, <1 x i64>* %q) {
235 ; CHECK: rev64 v{{[0-9]+}}.4h
236     %1 = load <4 x i16>, <4 x i16>* %p
237     %2 = add <4 x i16> %1, %1
238     %3 = call <1 x i64> @test_v1i64_v4i16_helper(<4 x i16> %2)
239     br label %return_bb
240 return_bb:
241     %4 = add <1 x i64> %3, %3
242     store <1 x i64> %4, <1 x i64>* %q
243     ret void
244 }
245
246 ; CHECK-LABEL: test_v1i64_v8i8:
247 declare <1 x i64> @test_v1i64_v8i8_helper(<8 x i8> %p)
248 define void @test_v1i64_v8i8(<8 x i8>* %p, <1 x i64>* %q) {
249 ; CHECK: rev64 v{{[0-9]+}}.8b
250     %1 = load <8 x i8>, <8 x i8>* %p
251     %2 = add <8 x i8> %1, %1
252     %3 = call <1 x i64> @test_v1i64_v8i8_helper(<8 x i8> %2)
253     br label %return_bb
254 return_bb:
255     %4 = add <1 x i64> %3, %3
256     store <1 x i64> %4, <1 x i64>* %q
257     ret void
258 }
259
260 ; CHECK-LABEL: test_v2f32_i64:
261 declare <2 x float> @test_v2f32_i64_helper(i64 %p)
262 define void @test_v2f32_i64(i64* %p, <2 x float>* %q) {
263 ; CHECK: rev64 v{{[0-9]+}}.2s
264     %1 = load i64, i64* %p
265     %2 = add i64 %1, %1
266     %3 = call <2 x float> @test_v2f32_i64_helper(i64 %2)
267     br label %return_bb
268 return_bb:
269     %4 = fadd <2 x float> %3, %3
270     store <2 x float> %4, <2 x float>* %q
271     ret void
272 }
273
274 ; CHECK-LABEL: test_v2f32_f64:
275 declare <2 x float> @test_v2f32_f64_helper(double %p)
276 define void @test_v2f32_f64(double* %p, <2 x float>* %q) {
277 ; CHECK: rev64 v{{[0-9]+}}.2s
278     %1 = load double, double* %p
279     %2 = fadd double %1, %1
280     %3 = call <2 x float> @test_v2f32_f64_helper(double %2)
281     br label %return_bb
282 return_bb:
283     %4 = fadd <2 x float> %3, %3
284     store <2 x float> %4, <2 x float>* %q
285     ret void
286 }
287
288 ; CHECK-LABEL: test_v2f32_v1i64:
289 declare <2 x float> @test_v2f32_v1i64_helper(<1 x i64> %p)
290 define void @test_v2f32_v1i64(<1 x i64>* %p, <2 x float>* %q) {
291 ; CHECK: rev64 v{{[0-9]+}}.2s
292     %1 = load <1 x i64>, <1 x i64>* %p
293     %2 = add <1 x i64> %1, %1
294     %3 = call <2 x float> @test_v2f32_v1i64_helper(<1 x i64> %2)
295     br label %return_bb
296 return_bb:
297     %4 = fadd <2 x float> %3, %3
298     store <2 x float> %4, <2 x float>* %q
299     ret void
300 }
301
302 ; CHECK-LABEL: test_v2f32_v2i32:
303 declare <2 x float> @test_v2f32_v2i32_helper(<2 x i32> %p)
304 define void @test_v2f32_v2i32(<2 x i32>* %p, <2 x float>* %q) {
305 ; CHECK: rev64 v{{[0-9]+}}.2s
306 ; CHECK: rev64 v{{[0-9]+}}.2s
307     %1 = load <2 x i32>, <2 x i32>* %p
308     %2 = add <2 x i32> %1, %1
309     %3 = call <2 x float> @test_v2f32_v2i32_helper(<2 x i32> %2)
310     br label %return_bb
311 return_bb:
312     %4 = fadd <2 x float> %3, %3
313     store <2 x float> %4, <2 x float>* %q
314     ret void
315 }
316
317 ; CHECK-LABEL: test_v2f32_v4i16:
318 declare <2 x float> @test_v2f32_v4i16_helper(<4 x i16> %p)
319 define void @test_v2f32_v4i16(<4 x i16>* %p, <2 x float>* %q) {
320 ; CHECK: rev64 v{{[0-9]+}}.4h
321 ; CHECK: rev64 v{{[0-9]+}}.2s
322     %1 = load <4 x i16>, <4 x i16>* %p
323     %2 = add <4 x i16> %1, %1
324     %3 = call <2 x float> @test_v2f32_v4i16_helper(<4 x i16> %2)
325     br label %return_bb
326 return_bb:
327     %4 = fadd <2 x float> %3, %3
328     store <2 x float> %4, <2 x float>* %q
329     ret void
330 }
331
332 ; CHECK-LABEL: test_v2f32_v8i8:
333 declare <2 x float> @test_v2f32_v8i8_helper(<8 x i8> %p)
334 define void @test_v2f32_v8i8(<8 x i8>* %p, <2 x float>* %q) {
335 ; CHECK: rev64 v{{[0-9]+}}.8b
336 ; CHECK: rev64 v{{[0-9]+}}.2s
337     %1 = load <8 x i8>, <8 x i8>* %p
338     %2 = add <8 x i8> %1, %1
339     %3 = call <2 x float> @test_v2f32_v8i8_helper(<8 x i8> %2)
340     br label %return_bb
341 return_bb:
342     %4 = fadd <2 x float> %3, %3
343     store <2 x float> %4, <2 x float>* %q
344     ret void
345 }
346
347 ; CHECK-LABEL: test_v2i32_i64:
348 declare <2 x i32> @test_v2i32_i64_helper(i64 %p)
349 define void @test_v2i32_i64(i64* %p, <2 x i32>* %q) {
350 ; CHECK: rev64 v{{[0-9]+}}.2s
351     %1 = load i64, i64* %p
352     %2 = add i64 %1, %1
353     %3 = call <2 x i32> @test_v2i32_i64_helper(i64 %2)
354     br label %return_bb
355 return_bb:
356     %4 = add <2 x i32> %3, %3
357     store <2 x i32> %4, <2 x i32>* %q
358     ret void
359 }
360
361 ; CHECK-LABEL: test_v2i32_f64:
362 declare <2 x i32> @test_v2i32_f64_helper(double %p)
363 define void @test_v2i32_f64(double* %p, <2 x i32>* %q) {
364 ; CHECK: rev64 v{{[0-9]+}}.2s
365     %1 = load double, double* %p
366     %2 = fadd double %1, %1
367     %3 = call <2 x i32> @test_v2i32_f64_helper(double %2)
368     br label %return_bb
369 return_bb:
370     %4 = add <2 x i32> %3, %3
371     store <2 x i32> %4, <2 x i32>* %q
372     ret void
373 }
374
375 ; CHECK-LABEL: test_v2i32_v1i64:
376 declare <2 x i32> @test_v2i32_v1i64_helper(<1 x i64> %p)
377 define void @test_v2i32_v1i64(<1 x i64>* %p, <2 x i32>* %q) {
378 ; CHECK: rev64 v{{[0-9]+}}.2s
379     %1 = load <1 x i64>, <1 x i64>* %p
380     %2 = add <1 x i64> %1, %1
381     %3 = call <2 x i32> @test_v2i32_v1i64_helper(<1 x i64> %2)
382     br label %return_bb
383 return_bb:
384     %4 = add <2 x i32> %3, %3
385     store <2 x i32> %4, <2 x i32>* %q
386     ret void
387 }
388
389 ; CHECK-LABEL: test_v2i32_v2f32:
390 declare <2 x i32> @test_v2i32_v2f32_helper(<2 x float> %p)
391 define void @test_v2i32_v2f32(<2 x float>* %p, <2 x i32>* %q) {
392 ; CHECK: rev64 v{{[0-9]+}}.2s
393 ; CHECK: rev64 v{{[0-9]+}}.2s
394     %1 = load <2 x float>, <2 x float>* %p
395     %2 = fadd <2 x float> %1, %1
396     %3 = call <2 x i32> @test_v2i32_v2f32_helper(<2 x float> %2)
397     br label %return_bb
398 return_bb:
399     %4 = add <2 x i32> %3, %3
400     store <2 x i32> %4, <2 x i32>* %q
401     ret void
402 }
403
404 ; CHECK-LABEL: test_v2i32_v4i16:
405 declare <2 x i32> @test_v2i32_v4i16_helper(<4 x i16> %p)
406 define void @test_v2i32_v4i16(<4 x i16>* %p, <2 x i32>* %q) {
407 ; CHECK: rev64 v{{[0-9]+}}.4h
408 ; CHECK: rev64 v{{[0-9]+}}.2s
409     %1 = load <4 x i16>, <4 x i16>* %p
410     %2 = add <4 x i16> %1, %1
411     %3 = call <2 x i32> @test_v2i32_v4i16_helper(<4 x i16> %2)
412     br label %return_bb
413 return_bb:
414     %4 = add <2 x i32> %3, %3
415     store <2 x i32> %4, <2 x i32>* %q
416     ret void
417 }
418
419 ; CHECK-LABEL: test_v2i32_v8i8:
420 declare <2 x i32> @test_v2i32_v8i8_helper(<8 x i8> %p)
421 define void @test_v2i32_v8i8(<8 x i8>* %p, <2 x i32>* %q) {
422 ; CHECK: rev64 v{{[0-9]+}}.8b
423 ; CHECK: rev64 v{{[0-9]+}}.2s
424     %1 = load <8 x i8>, <8 x i8>* %p
425     %2 = add <8 x i8> %1, %1
426     %3 = call <2 x i32> @test_v2i32_v8i8_helper(<8 x i8> %2)
427     br label %return_bb
428 return_bb:
429     %4 = add <2 x i32> %3, %3
430     store <2 x i32> %4, <2 x i32>* %q
431     ret void
432 }
433
434 ; CHECK-LABEL: test_v4i16_i64:
435 declare <4 x i16> @test_v4i16_i64_helper(i64 %p)
436 define void @test_v4i16_i64(i64* %p, <4 x i16>* %q) {
437 ; CHECK: rev64 v{{[0-9]+}}.4h
438     %1 = load i64, i64* %p
439     %2 = add i64 %1, %1
440     %3 = call <4 x i16> @test_v4i16_i64_helper(i64 %2)
441     br label %return_bb
442 return_bb:
443     %4 = add <4 x i16> %3, %3
444     store <4 x i16> %4, <4 x i16>* %q
445     ret void
446 }
447
448 ; CHECK-LABEL: test_v4i16_f64:
449 declare <4 x i16> @test_v4i16_f64_helper(double %p)
450 define void @test_v4i16_f64(double* %p, <4 x i16>* %q) {
451 ; CHECK: rev64 v{{[0-9]+}}.4h
452     %1 = load double, double* %p
453     %2 = fadd double %1, %1
454     %3 = call <4 x i16> @test_v4i16_f64_helper(double %2)
455     br label %return_bb
456 return_bb:
457     %4 = add <4 x i16> %3, %3
458     store <4 x i16> %4, <4 x i16>* %q
459     ret void
460 }
461
462 ; CHECK-LABEL: test_v4i16_v1i64:
463 declare <4 x i16> @test_v4i16_v1i64_helper(<1 x i64> %p)
464 define void @test_v4i16_v1i64(<1 x i64>* %p, <4 x i16>* %q) {
465 ; CHECK: rev64 v{{[0-9]+}}.4h
466     %1 = load <1 x i64>, <1 x i64>* %p
467     %2 = add <1 x i64> %1, %1
468     %3 = call <4 x i16> @test_v4i16_v1i64_helper(<1 x i64> %2)
469     br label %return_bb
470 return_bb:
471     %4 = add <4 x i16> %3, %3
472     store <4 x i16> %4, <4 x i16>* %q
473     ret void
474 }
475
476 ; CHECK-LABEL: test_v4i16_v2f32:
477 declare <4 x i16> @test_v4i16_v2f32_helper(<2 x float> %p)
478 define void @test_v4i16_v2f32(<2 x float>* %p, <4 x i16>* %q) {
479 ; CHECK: rev64 v{{[0-9]+}}.2s
480 ; CHECK: rev64 v{{[0-9]+}}.4h
481     %1 = load <2 x float>, <2 x float>* %p
482     %2 = fadd <2 x float> %1, %1
483     %3 = call <4 x i16> @test_v4i16_v2f32_helper(<2 x float> %2)
484     br label %return_bb
485 return_bb:
486     %4 = add <4 x i16> %3, %3
487     store <4 x i16> %4, <4 x i16>* %q
488     ret void
489 }
490
491 ; CHECK-LABEL: test_v4i16_v2i32:
492 declare <4 x i16> @test_v4i16_v2i32_helper(<2 x i32> %p)
493 define void @test_v4i16_v2i32(<2 x i32>* %p, <4 x i16>* %q) {
494 ; CHECK: rev64 v{{[0-9]+}}.2s
495 ; CHECK: rev64 v{{[0-9]+}}.4h
496     %1 = load <2 x i32>, <2 x i32>* %p
497     %2 = add <2 x i32> %1, %1
498     %3 = call <4 x i16> @test_v4i16_v2i32_helper(<2 x i32> %2)
499     br label %return_bb
500 return_bb:
501     %4 = add <4 x i16> %3, %3
502     store <4 x i16> %4, <4 x i16>* %q
503     ret void
504 }
505
506 ; CHECK-LABEL: test_v4i16_v8i8:
507 declare <4 x i16> @test_v4i16_v8i8_helper(<8 x i8> %p)
508 define void @test_v4i16_v8i8(<8 x i8>* %p, <4 x i16>* %q) {
509 ; CHECK: rev64 v{{[0-9]+}}.8b
510 ; CHECK: rev64 v{{[0-9]+}}.4h
511     %1 = load <8 x i8>, <8 x i8>* %p
512     %2 = add <8 x i8> %1, %1
513     %3 = call <4 x i16> @test_v4i16_v8i8_helper(<8 x i8> %2)
514     br label %return_bb
515 return_bb:
516     %4 = add <4 x i16> %3, %3
517     store <4 x i16> %4, <4 x i16>* %q
518     ret void
519 }
520
521 ; CHECK-LABEL: test_v8i8_i64:
522 declare <8 x i8> @test_v8i8_i64_helper(i64 %p)
523 define void @test_v8i8_i64(i64* %p, <8 x i8>* %q) {
524 ; CHECK: rev64 v{{[0-9]+}}.8b
525     %1 = load i64, i64* %p
526     %2 = add i64 %1, %1
527     %3 = call <8 x i8> @test_v8i8_i64_helper(i64 %2)
528     br label %return_bb
529 return_bb:
530     %4 = add <8 x i8> %3, %3
531     store <8 x i8> %4, <8 x i8>* %q
532     ret void
533 }
534
535 ; CHECK-LABEL: test_v8i8_f64:
536 declare <8 x i8> @test_v8i8_f64_helper(double %p)
537 define void @test_v8i8_f64(double* %p, <8 x i8>* %q) {
538 ; CHECK: rev64 v{{[0-9]+}}.8b
539     %1 = load double, double* %p
540     %2 = fadd double %1, %1
541     %3 = call <8 x i8> @test_v8i8_f64_helper(double %2)
542     br label %return_bb
543 return_bb:
544     %4 = add <8 x i8> %3, %3
545     store <8 x i8> %4, <8 x i8>* %q
546     ret void
547 }
548
549 ; CHECK-LABEL: test_v8i8_v1i64:
550 declare <8 x i8> @test_v8i8_v1i64_helper(<1 x i64> %p)
551 define void @test_v8i8_v1i64(<1 x i64>* %p, <8 x i8>* %q) {
552 ; CHECK: rev64 v{{[0-9]+}}.8b
553     %1 = load <1 x i64>, <1 x i64>* %p
554     %2 = add <1 x i64> %1, %1
555     %3 = call <8 x i8> @test_v8i8_v1i64_helper(<1 x i64> %2)
556     br label %return_bb
557 return_bb:
558     %4 = add <8 x i8> %3, %3
559     store <8 x i8> %4, <8 x i8>* %q
560     ret void
561 }
562
563 ; CHECK-LABEL: test_v8i8_v2f32:
564 declare <8 x i8> @test_v8i8_v2f32_helper(<2 x float> %p)
565 define void @test_v8i8_v2f32(<2 x float>* %p, <8 x i8>* %q) {
566 ; CHECK: rev64 v{{[0-9]+}}.2s
567 ; CHECK: rev64 v{{[0-9]+}}.8b
568     %1 = load <2 x float>, <2 x float>* %p
569     %2 = fadd <2 x float> %1, %1
570     %3 = call <8 x i8> @test_v8i8_v2f32_helper(<2 x float> %2)
571     br label %return_bb
572 return_bb:
573     %4 = add <8 x i8> %3, %3
574     store <8 x i8> %4, <8 x i8>* %q
575     ret void
576 }
577
578 ; CHECK-LABEL: test_v8i8_v2i32:
579 declare <8 x i8> @test_v8i8_v2i32_helper(<2 x i32> %p)
580 define void @test_v8i8_v2i32(<2 x i32>* %p, <8 x i8>* %q) {
581 ; CHECK: rev64 v{{[0-9]+}}.2s
582 ; CHECK: rev64 v{{[0-9]+}}.8b
583     %1 = load <2 x i32>, <2 x i32>* %p
584     %2 = add <2 x i32> %1, %1
585     %3 = call <8 x i8> @test_v8i8_v2i32_helper(<2 x i32> %2)
586     br label %return_bb
587 return_bb:
588     %4 = add <8 x i8> %3, %3
589     store <8 x i8> %4, <8 x i8>* %q
590     ret void
591 }
592
593 ; CHECK-LABEL: test_v8i8_v4i16:
594 declare <8 x i8> @test_v8i8_v4i16_helper(<4 x i16> %p)
595 define void @test_v8i8_v4i16(<4 x i16>* %p, <8 x i8>* %q) {
596 ; CHECK: rev64 v{{[0-9]+}}.4h
597 ; CHECK: rev64 v{{[0-9]+}}.8b
598     %1 = load <4 x i16>, <4 x i16>* %p
599     %2 = add <4 x i16> %1, %1
600     %3 = call <8 x i8> @test_v8i8_v4i16_helper(<4 x i16> %2)
601     br label %return_bb
602 return_bb:
603     %4 = add <8 x i8> %3, %3
604     store <8 x i8> %4, <8 x i8>* %q
605     ret void
606 }
607
608 ; CHECK-LABEL: test_f128_v2f64:
609 declare fp128 @test_f128_v2f64_helper(<2 x double> %p)
610 define void @test_f128_v2f64(<2 x double>* %p, fp128* %q) {
611 ; CHECK: ext
612     %1 = load <2 x double>, <2 x double>* %p
613     %2 = fadd <2 x double> %1, %1
614     %3 = call fp128 @test_f128_v2f64_helper(<2 x double> %2)
615     br label %return_bb
616 return_bb:
617     %4 = fadd fp128 %3, %3
618     store fp128 %4, fp128* %q
619     ret void
620 }
621
622 ; CHECK-LABEL: test_f128_v2i64:
623 declare fp128 @test_f128_v2i64_helper(<2 x i64> %p)
624 define void @test_f128_v2i64(<2 x i64>* %p, fp128* %q) {
625 ; CHECK: ext
626     %1 = load <2 x i64>, <2 x i64>* %p
627     %2 = add <2 x i64> %1, %1
628     %3 = call fp128 @test_f128_v2i64_helper(<2 x i64> %2)
629     br label %return_bb
630 return_bb:
631     %4 = fadd fp128 %3, %3
632     store fp128 %4, fp128* %q
633     ret void
634 }
635
636 ; CHECK-LABEL: test_f128_v4f32:
637 declare fp128 @test_f128_v4f32_helper(<4 x float> %p)
638 define void @test_f128_v4f32(<4 x float>* %p, fp128* %q) {
639 ; CHECK: rev64 v{{[0-9]+}}.4s
640 ; CHECK: ext
641     %1 = load <4 x float>, <4 x float>* %p
642     %2 = fadd <4 x float> %1, %1
643     %3 = call fp128 @test_f128_v4f32_helper(<4 x float> %2)
644     br label %return_bb
645 return_bb:
646     %4 = fadd fp128 %3, %3
647     store fp128 %4, fp128* %q
648     ret void
649 }
650
651 ; CHECK-LABEL: test_f128_v4i32:
652 declare fp128 @test_f128_v4i32_helper(<4 x i32> %p)
653 define void @test_f128_v4i32(<4 x i32>* %p, fp128* %q) {
654 ; CHECK: rev64 v{{[0-9]+}}.4s
655 ; CHECK: ext
656     %1 = load <4 x i32>, <4 x i32>* %p
657     %2 = add <4 x i32> %1, %1
658     %3 = call fp128 @test_f128_v4i32_helper(<4 x i32> %2)
659     br label %return_bb
660 return_bb:
661     %4 = fadd fp128 %3, %3
662     store fp128 %4, fp128* %q
663     ret void
664 }
665
666 ; CHECK-LABEL: test_f128_v8i16:
667 declare fp128 @test_f128_v8i16_helper(<8 x i16> %p)
668 define void @test_f128_v8i16(<8 x i16>* %p, fp128* %q) {
669 ; CHECK: rev64 v{{[0-9]+}}.8h
670 ; CHECK: ext
671     %1 = load <8 x i16>, <8 x i16>* %p
672     %2 = add <8 x i16> %1, %1
673     %3 = call fp128 @test_f128_v8i16_helper(<8 x i16> %2)
674     br label %return_bb
675 return_bb:
676     %4 = fadd fp128 %3, %3
677     store fp128 %4, fp128* %q
678     ret void
679 }
680
681 ; CHECK-LABEL: test_f128_v16i8:
682 declare fp128 @test_f128_v16i8_helper(<16 x i8> %p)
683 define void @test_f128_v16i8(<16 x i8>* %p, fp128* %q) {
684 ; CHECK: rev64 v{{[0-9]+}}.16b
685 ; CHECK: ext
686     %1 = load <16 x i8>, <16 x i8>* %p
687     %2 = add <16 x i8> %1, %1
688     %3 = call fp128 @test_f128_v16i8_helper(<16 x i8> %2)
689     br label %return_bb
690 return_bb:
691     %4 = fadd fp128 %3, %3
692     store fp128 %4, fp128* %q
693     ret void
694 }
695
696 ; CHECK-LABEL: test_v2f64_f128:
697 declare <2 x double> @test_v2f64_f128_helper(fp128 %p)
698 define void @test_v2f64_f128(fp128* %p, <2 x double>* %q) {
699 ; CHECK: ext
700     %1 = load fp128, fp128* %p
701     %2 = fadd fp128 %1, %1
702     %3 = call <2 x double> @test_v2f64_f128_helper(fp128 %2)
703     br label %return_bb
704 return_bb:
705     %4 = fadd <2 x double> %3, %3
706     store <2 x double> %4, <2 x double>* %q
707     ret void
708 }
709
710 ; CHECK-LABEL: test_v2f64_v2i64:
711 declare <2 x double> @test_v2f64_v2i64_helper(<2 x i64> %p)
712 define void @test_v2f64_v2i64(<2 x i64>* %p, <2 x double>* %q) {
713 ; CHECK: ext
714 ; CHECK: ext
715     %1 = load <2 x i64>, <2 x i64>* %p
716     %2 = add <2 x i64> %1, %1
717     %3 = call <2 x double> @test_v2f64_v2i64_helper(<2 x i64> %2)
718     br label %return_bb
719 return_bb:
720     %4 = fadd <2 x double> %3, %3
721     store <2 x double> %4, <2 x double>* %q
722     ret void
723 }
724
725 ; CHECK-LABEL: test_v2f64_v4f32:
726 declare <2 x double> @test_v2f64_v4f32_helper(<4 x float> %p)
727 define void @test_v2f64_v4f32(<4 x float>* %p, <2 x double>* %q) {
728 ; CHECK: rev64 v{{[0-9]+}}.4s
729 ; CHECK: ext
730 ; CHECK: ext
731     %1 = load <4 x float>, <4 x float>* %p
732     %2 = fadd <4 x float> %1, %1
733     %3 = call <2 x double> @test_v2f64_v4f32_helper(<4 x float> %2)
734     br label %return_bb
735 return_bb:
736     %4 = fadd <2 x double> %3, %3
737     store <2 x double> %4, <2 x double>* %q
738     ret void
739 }
740
741 ; CHECK-LABEL: test_v2f64_v4i32:
742 declare <2 x double> @test_v2f64_v4i32_helper(<4 x i32> %p)
743 define void @test_v2f64_v4i32(<4 x i32>* %p, <2 x double>* %q) {
744 ; CHECK: rev64 v{{[0-9]+}}.4s
745 ; CHECK: ext
746 ; CHECK: ext
747     %1 = load <4 x i32>, <4 x i32>* %p
748     %2 = add <4 x i32> %1, %1
749     %3 = call <2 x double> @test_v2f64_v4i32_helper(<4 x i32> %2)
750     br label %return_bb
751 return_bb:
752     %4 = fadd <2 x double> %3, %3
753     store <2 x double> %4, <2 x double>* %q
754     ret void
755 }
756
757 ; CHECK-LABEL: test_v2f64_v8i16:
758 declare <2 x double> @test_v2f64_v8i16_helper(<8 x i16> %p)
759 define void @test_v2f64_v8i16(<8 x i16>* %p, <2 x double>* %q) {
760 ; CHECK: rev64 v{{[0-9]+}}.8h
761 ; CHECK: ext
762 ; CHECK: ext
763     %1 = load <8 x i16>, <8 x i16>* %p
764     %2 = add <8 x i16> %1, %1
765     %3 = call <2 x double> @test_v2f64_v8i16_helper(<8 x i16> %2)
766     br label %return_bb
767 return_bb:
768     %4 = fadd <2 x double> %3, %3
769     store <2 x double> %4, <2 x double>* %q
770     ret void
771 }
772
773 ; CHECK-LABEL: test_v2f64_v16i8:
774 declare <2 x double> @test_v2f64_v16i8_helper(<16 x i8> %p)
775 define void @test_v2f64_v16i8(<16 x i8>* %p, <2 x double>* %q) {
776 ; CHECK: rev64 v{{[0-9]+}}.16b
777 ; CHECK: ext
778 ; CHECK: ext
779     %1 = load <16 x i8>, <16 x i8>* %p
780     %2 = add <16 x i8> %1, %1
781     %3 = call <2 x double> @test_v2f64_v16i8_helper(<16 x i8> %2)
782     br label %return_bb
783 return_bb:
784     %4 = fadd <2 x double> %3, %3
785     store <2 x double> %4, <2 x double>* %q
786     ret void
787 }
788
789 ; CHECK-LABEL: test_v2i64_f128:
790 declare <2 x i64> @test_v2i64_f128_helper(fp128 %p)
791 define void @test_v2i64_f128(fp128* %p, <2 x i64>* %q) {
792 ; CHECK: ext
793     %1 = load fp128, fp128* %p
794     %2 = fadd fp128 %1, %1
795     %3 = call <2 x i64> @test_v2i64_f128_helper(fp128 %2)
796     br label %return_bb
797 return_bb:
798     %4 = add <2 x i64> %3, %3
799     store <2 x i64> %4, <2 x i64>* %q
800     ret void
801 }
802
803 ; CHECK-LABEL: test_v2i64_v2f64:
804 declare <2 x i64> @test_v2i64_v2f64_helper(<2 x double> %p)
805 define void @test_v2i64_v2f64(<2 x double>* %p, <2 x i64>* %q) {
806 ; CHECK: ext
807 ; CHECK: ext
808     %1 = load <2 x double>, <2 x double>* %p
809     %2 = fadd <2 x double> %1, %1
810     %3 = call <2 x i64> @test_v2i64_v2f64_helper(<2 x double> %2)
811     br label %return_bb
812 return_bb:
813     %4 = add <2 x i64> %3, %3
814     store <2 x i64> %4, <2 x i64>* %q
815     ret void
816 }
817
818 ; CHECK-LABEL: test_v2i64_v4f32:
819 declare <2 x i64> @test_v2i64_v4f32_helper(<4 x float> %p)
820 define void @test_v2i64_v4f32(<4 x float>* %p, <2 x i64>* %q) {
821 ; CHECK: rev64 v{{[0-9]+}}.4s
822 ; CHECK: ext
823 ; CHECK: ext
824     %1 = load <4 x float>, <4 x float>* %p
825     %2 = fadd <4 x float> %1, %1
826     %3 = call <2 x i64> @test_v2i64_v4f32_helper(<4 x float> %2)
827     br label %return_bb
828 return_bb:
829     %4 = add <2 x i64> %3, %3
830     store <2 x i64> %4, <2 x i64>* %q
831     ret void
832 }
833
834 ; CHECK-LABEL: test_v2i64_v4i32:
835 declare <2 x i64> @test_v2i64_v4i32_helper(<4 x i32> %p)
836 define void @test_v2i64_v4i32(<4 x i32>* %p, <2 x i64>* %q) {
837 ; CHECK: rev64 v{{[0-9]+}}.4s
838 ; CHECK: ext
839 ; CHECK: ext
840     %1 = load <4 x i32>, <4 x i32>* %p
841     %2 = add <4 x i32> %1, %1
842     %3 = call <2 x i64> @test_v2i64_v4i32_helper(<4 x i32> %2)
843     br label %return_bb
844 return_bb:
845     %4 = add <2 x i64> %3, %3
846     store <2 x i64> %4, <2 x i64>* %q
847     ret void
848 }
849
850 ; CHECK-LABEL: test_v2i64_v8i16:
851 declare <2 x i64> @test_v2i64_v8i16_helper(<8 x i16> %p)
852 define void @test_v2i64_v8i16(<8 x i16>* %p, <2 x i64>* %q) {
853 ; CHECK: rev64 v{{[0-9]+}}.8h
854 ; CHECK: ext
855 ; CHECK: ext
856     %1 = load <8 x i16>, <8 x i16>* %p
857     %2 = add <8 x i16> %1, %1
858     %3 = call <2 x i64> @test_v2i64_v8i16_helper(<8 x i16> %2)
859     br label %return_bb
860 return_bb:
861     %4 = add <2 x i64> %3, %3
862     store <2 x i64> %4, <2 x i64>* %q
863     ret void
864 }
865
866 ; CHECK-LABEL: test_v2i64_v16i8:
867 declare <2 x i64> @test_v2i64_v16i8_helper(<16 x i8> %p)
868 define void @test_v2i64_v16i8(<16 x i8>* %p, <2 x i64>* %q) {
869 ; CHECK: rev64 v{{[0-9]+}}.16b
870 ; CHECK: ext
871 ; CHECK: ext
872     %1 = load <16 x i8>, <16 x i8>* %p
873     %2 = add <16 x i8> %1, %1
874     %3 = call <2 x i64> @test_v2i64_v16i8_helper(<16 x i8> %2)
875     br label %return_bb
876 return_bb:
877     %4 = add <2 x i64> %3, %3
878     store <2 x i64> %4, <2 x i64>* %q
879     ret void
880 }
881
882 ; CHECK-LABEL: test_v4f32_f128:
883 declare <4 x float> @test_v4f32_f128_helper(fp128 %p)
884 define void @test_v4f32_f128(fp128* %p, <4 x float>* %q) {
885 ; CHECK: rev64 v{{[0-9]+}}.4s
886 ; CHECK: ext
887     %1 = load fp128, fp128* %p
888     %2 = fadd fp128 %1, %1
889     %3 = call <4 x float> @test_v4f32_f128_helper(fp128 %2)
890     br label %return_bb
891 return_bb:
892     %4 = fadd <4 x float> %3, %3
893     store <4 x float> %4, <4 x float>* %q
894     ret void
895 }
896
897 ; CHECK-LABEL: test_v4f32_v2f64:
898 declare <4 x float> @test_v4f32_v2f64_helper(<2 x double> %p)
899 define void @test_v4f32_v2f64(<2 x double>* %p, <4 x float>* %q) {
900 ; CHECK: ext
901 ; CHECK: rev64 v{{[0-9]+}}.4s
902 ; CHECK: ext
903     %1 = load <2 x double>, <2 x double>* %p
904     %2 = fadd <2 x double> %1, %1
905     %3 = call <4 x float> @test_v4f32_v2f64_helper(<2 x double> %2)
906     br label %return_bb
907 return_bb:
908     %4 = fadd <4 x float> %3, %3
909     store <4 x float> %4, <4 x float>* %q
910     ret void
911 }
912
913 ; CHECK-LABEL: test_v4f32_v2i64:
914 declare <4 x float> @test_v4f32_v2i64_helper(<2 x i64> %p)
915 define void @test_v4f32_v2i64(<2 x i64>* %p, <4 x float>* %q) {
916 ; CHECK: ext
917 ; CHECK: rev64 v{{[0-9]+}}.4s
918 ; CHECK: ext
919     %1 = load <2 x i64>, <2 x i64>* %p
920     %2 = add <2 x i64> %1, %1
921     %3 = call <4 x float> @test_v4f32_v2i64_helper(<2 x i64> %2)
922     br label %return_bb
923 return_bb:
924     %4 = fadd <4 x float> %3, %3
925     store <4 x float> %4, <4 x float>* %q
926     ret void
927 }
928
929 ; CHECK-LABEL: test_v4f32_v4i32:
930 declare <4 x float> @test_v4f32_v4i32_helper(<4 x i32> %p)
931 define void @test_v4f32_v4i32(<4 x i32>* %p, <4 x float>* %q) {
932 ; CHECK: rev64 v{{[0-9]+}}.4s
933 ; CHECK: ext
934 ; CHECK: rev64 v{{[0-9]+}}.4s
935 ; CHECK: ext
936     %1 = load <4 x i32>, <4 x i32>* %p
937     %2 = add <4 x i32> %1, %1
938     %3 = call <4 x float> @test_v4f32_v4i32_helper(<4 x i32> %2)
939     br label %return_bb
940 return_bb:
941     %4 = fadd <4 x float> %3, %3
942     store <4 x float> %4, <4 x float>* %q
943     ret void
944 }
945
946 ; CHECK-LABEL: test_v4f32_v8i16:
947 declare <4 x float> @test_v4f32_v8i16_helper(<8 x i16> %p)
948 define void @test_v4f32_v8i16(<8 x i16>* %p, <4 x float>* %q) {
949 ; CHECK: rev64 v{{[0-9]+}}.8h
950 ; CHECK: ext
951 ; CHECK: rev64 v{{[0-9]+}}.4s
952 ; CHECK: ext
953     %1 = load <8 x i16>, <8 x i16>* %p
954     %2 = add <8 x i16> %1, %1
955     %3 = call <4 x float> @test_v4f32_v8i16_helper(<8 x i16> %2)
956     br label %return_bb
957 return_bb:
958     %4 = fadd <4 x float> %3, %3
959     store <4 x float> %4, <4 x float>* %q
960     ret void
961 }
962
963 ; CHECK-LABEL: test_v4f32_v16i8:
964 declare <4 x float> @test_v4f32_v16i8_helper(<16 x i8> %p)
965 define void @test_v4f32_v16i8(<16 x i8>* %p, <4 x float>* %q) {
966 ; CHECK: rev64 v{{[0-9]+}}.16b
967 ; CHECK: ext
968 ; CHECK: rev64 v{{[0-9]+}}.4s
969 ; CHECK: ext
970     %1 = load <16 x i8>, <16 x i8>* %p
971     %2 = add <16 x i8> %1, %1
972     %3 = call <4 x float> @test_v4f32_v16i8_helper(<16 x i8> %2)
973     br label %return_bb
974 return_bb:
975     %4 = fadd <4 x float> %3, %3
976     store <4 x float> %4, <4 x float>* %q
977     ret void
978 }
979
980 ; CHECK-LABEL: test_v4i32_f128:
981 declare <4 x i32> @test_v4i32_f128_helper(fp128 %p)
982 define void @test_v4i32_f128(fp128* %p, <4 x i32>* %q) {
983 ; CHECK: rev64 v{{[0-9]+}}.4s
984 ; CHECK: ext
985     %1 = load fp128, fp128* %p
986     %2 = fadd fp128 %1, %1
987     %3 = call <4 x i32> @test_v4i32_f128_helper(fp128 %2)
988     br label %return_bb
989 return_bb:
990     %4 = add <4 x i32> %3, %3
991     store <4 x i32> %4, <4 x i32>* %q
992     ret void
993 }
994
995 ; CHECK-LABEL: test_v4i32_v2f64:
996 declare <4 x i32> @test_v4i32_v2f64_helper(<2 x double> %p)
997 define void @test_v4i32_v2f64(<2 x double>* %p, <4 x i32>* %q) {
998 ; CHECK: ext
999 ; CHECK: rev64 v{{[0-9]+}}.4s
1000 ; CHECK: ext
1001     %1 = load <2 x double>, <2 x double>* %p
1002     %2 = fadd <2 x double> %1, %1
1003     %3 = call <4 x i32> @test_v4i32_v2f64_helper(<2 x double> %2)
1004     br label %return_bb
1005 return_bb:
1006     %4 = add <4 x i32> %3, %3
1007     store <4 x i32> %4, <4 x i32>* %q
1008     ret void
1009 }
1010
1011 ; CHECK-LABEL: test_v4i32_v2i64:
1012 declare <4 x i32> @test_v4i32_v2i64_helper(<2 x i64> %p)
1013 define void @test_v4i32_v2i64(<2 x i64>* %p, <4 x i32>* %q) {
1014 ; CHECK: ext
1015 ; CHECK: rev64 v{{[0-9]+}}.4s
1016 ; CHECK: ext
1017     %1 = load <2 x i64>, <2 x i64>* %p
1018     %2 = add <2 x i64> %1, %1
1019     %3 = call <4 x i32> @test_v4i32_v2i64_helper(<2 x i64> %2)
1020     br label %return_bb
1021 return_bb:
1022     %4 = add <4 x i32> %3, %3
1023     store <4 x i32> %4, <4 x i32>* %q
1024     ret void
1025 }
1026
1027 ; CHECK-LABEL: test_v4i32_v4f32:
1028 declare <4 x i32> @test_v4i32_v4f32_helper(<4 x float> %p)
1029 define void @test_v4i32_v4f32(<4 x float>* %p, <4 x i32>* %q) {
1030 ; CHECK: rev64 v{{[0-9]+}}.4s
1031 ; CHECK: ext
1032 ; CHECK: rev64 v{{[0-9]+}}.4s
1033 ; CHECK: ext
1034     %1 = load <4 x float>, <4 x float>* %p
1035     %2 = fadd <4 x float> %1, %1
1036     %3 = call <4 x i32> @test_v4i32_v4f32_helper(<4 x float> %2)
1037     br label %return_bb
1038 return_bb:
1039     %4 = add <4 x i32> %3, %3
1040     store <4 x i32> %4, <4 x i32>* %q
1041     ret void
1042 }
1043
1044 ; CHECK-LABEL: test_v4i32_v8i16:
1045 declare <4 x i32> @test_v4i32_v8i16_helper(<8 x i16> %p)
1046 define void @test_v4i32_v8i16(<8 x i16>* %p, <4 x i32>* %q) {
1047 ; CHECK: rev64 v{{[0-9]+}}.8h
1048 ; CHECK: ext
1049 ; CHECK: rev64 v{{[0-9]+}}.4s
1050 ; CHECK: ext
1051     %1 = load <8 x i16>, <8 x i16>* %p
1052     %2 = add <8 x i16> %1, %1
1053     %3 = call <4 x i32> @test_v4i32_v8i16_helper(<8 x i16> %2)
1054     br label %return_bb
1055 return_bb:
1056     %4 = add <4 x i32> %3, %3
1057     store <4 x i32> %4, <4 x i32>* %q
1058     ret void
1059 }
1060
1061 ; CHECK-LABEL: test_v4i32_v16i8:
1062 declare <4 x i32> @test_v4i32_v16i8_helper(<16 x i8> %p)
1063 define void @test_v4i32_v16i8(<16 x i8>* %p, <4 x i32>* %q) {
1064 ; CHECK: rev64 v{{[0-9]+}}.16b
1065 ; CHECK: ext
1066 ; CHECK: rev64 v{{[0-9]+}}.4s
1067 ; CHECK: ext
1068     %1 = load <16 x i8>, <16 x i8>* %p
1069     %2 = add <16 x i8> %1, %1
1070     %3 = call <4 x i32> @test_v4i32_v16i8_helper(<16 x i8> %2)
1071     br label %return_bb
1072 return_bb:
1073     %4 = add <4 x i32> %3, %3
1074     store <4 x i32> %4, <4 x i32>* %q
1075     ret void
1076 }
1077
1078 ; CHECK-LABEL: test_v8i16_f128:
1079 declare <8 x i16> @test_v8i16_f128_helper(fp128 %p)
1080 define void @test_v8i16_f128(fp128* %p, <8 x i16>* %q) {
1081 ; CHECK: rev64 v{{[0-9]+}}.8h
1082 ; CHECK: ext
1083     %1 = load fp128, fp128* %p
1084     %2 = fadd fp128 %1, %1
1085     %3 = call <8 x i16> @test_v8i16_f128_helper(fp128 %2)
1086     br label %return_bb
1087 return_bb:
1088     %4 = add <8 x i16> %3, %3
1089     store <8 x i16> %4, <8 x i16>* %q
1090     ret void
1091 }
1092
1093 ; CHECK-LABEL: test_v8i16_v2f64:
1094 declare <8 x i16> @test_v8i16_v2f64_helper(<2 x double> %p)
1095 define void @test_v8i16_v2f64(<2 x double>* %p, <8 x i16>* %q) {
1096 ; CHECK: ext
1097 ; CHECK: rev64 v{{[0-9]+}}.8h
1098 ; CHECK: ext
1099     %1 = load <2 x double>, <2 x double>* %p
1100     %2 = fadd <2 x double> %1, %1
1101     %3 = call <8 x i16> @test_v8i16_v2f64_helper(<2 x double> %2)
1102     br label %return_bb
1103 return_bb:
1104     %4 = add <8 x i16> %3, %3
1105     store <8 x i16> %4, <8 x i16>* %q
1106     ret void
1107 }
1108
1109 ; CHECK-LABEL: test_v8i16_v2i64:
1110 declare <8 x i16> @test_v8i16_v2i64_helper(<2 x i64> %p)
1111 define void @test_v8i16_v2i64(<2 x i64>* %p, <8 x i16>* %q) {
1112 ; CHECK: ext
1113 ; CHECK: rev64 v{{[0-9]+}}.8h
1114 ; CHECK: ext
1115     %1 = load <2 x i64>, <2 x i64>* %p
1116     %2 = add <2 x i64> %1, %1
1117     %3 = call <8 x i16> @test_v8i16_v2i64_helper(<2 x i64> %2)
1118     br label %return_bb
1119 return_bb:
1120     %4 = add <8 x i16> %3, %3
1121     store <8 x i16> %4, <8 x i16>* %q
1122     ret void
1123 }
1124
1125 ; CHECK-LABEL: test_v8i16_v4f32:
1126 declare <8 x i16> @test_v8i16_v4f32_helper(<4 x float> %p)
1127 define void @test_v8i16_v4f32(<4 x float>* %p, <8 x i16>* %q) {
1128 ; CHECK: rev64 v{{[0-9]+}}.4s
1129 ; CHECK: ext
1130 ; CHECK: rev64 v{{[0-9]+}}.8h
1131 ; CHECK: ext
1132     %1 = load <4 x float>, <4 x float>* %p
1133     %2 = fadd <4 x float> %1, %1
1134     %3 = call <8 x i16> @test_v8i16_v4f32_helper(<4 x float> %2)
1135     br label %return_bb
1136 return_bb:
1137     %4 = add <8 x i16> %3, %3
1138     store <8 x i16> %4, <8 x i16>* %q
1139     ret void
1140 }
1141
1142 ; CHECK-LABEL: test_v8i16_v4i32:
1143 declare <8 x i16> @test_v8i16_v4i32_helper(<4 x i32> %p)
1144 define void @test_v8i16_v4i32(<4 x i32>* %p, <8 x i16>* %q) {
1145 ; CHECK: rev64 v{{[0-9]+}}.4s
1146 ; CHECK: ext
1147 ; CHECK: rev64 v{{[0-9]+}}.8h
1148 ; CHECK: ext
1149     %1 = load <4 x i32>, <4 x i32>* %p
1150     %2 = add <4 x i32> %1, %1
1151     %3 = call <8 x i16> @test_v8i16_v4i32_helper(<4 x i32> %2)
1152     br label %return_bb
1153 return_bb:
1154     %4 = add <8 x i16> %3, %3
1155     store <8 x i16> %4, <8 x i16>* %q
1156     ret void
1157 }
1158
1159 ; CHECK-LABEL: test_v8i16_v16i8:
1160 declare <8 x i16> @test_v8i16_v16i8_helper(<16 x i8> %p)
1161 define void @test_v8i16_v16i8(<16 x i8>* %p, <8 x i16>* %q) {
1162 ; CHECK: rev64 v{{[0-9]+}}.16b
1163 ; CHECK: ext
1164 ; CHECK: rev64 v{{[0-9]+}}.8h
1165 ; CHECK: ext
1166     %1 = load <16 x i8>, <16 x i8>* %p
1167     %2 = add <16 x i8> %1, %1
1168     %3 = call <8 x i16> @test_v8i16_v16i8_helper(<16 x i8> %2)
1169     br label %return_bb
1170 return_bb:
1171     %4 = add <8 x i16> %3, %3
1172     store <8 x i16> %4, <8 x i16>* %q
1173     ret void
1174 }
1175
1176 ; CHECK-LABEL: test_v16i8_f128:
1177 declare <16 x i8> @test_v16i8_f128_helper(fp128 %p)
1178 define void @test_v16i8_f128(fp128* %p, <16 x i8>* %q) {
1179 ; CHECK: rev64 v{{[0-9]+}}.16b
1180 ; CHECK: ext
1181     %1 = load fp128, fp128* %p
1182     %2 = fadd fp128 %1, %1
1183     %3 = call <16 x i8> @test_v16i8_f128_helper(fp128 %2)
1184     br label %return_bb
1185 return_bb:
1186     %4 = add <16 x i8> %3, %3
1187     store <16 x i8> %4, <16 x i8>* %q
1188     ret void
1189 }
1190
1191 ; CHECK-LABEL: test_v16i8_v2f64:
1192 declare <16 x i8> @test_v16i8_v2f64_helper(<2 x double> %p)
1193 define void @test_v16i8_v2f64(<2 x double>* %p, <16 x i8>* %q) {
1194 ; CHECK: ext
1195 ; CHECK: rev64 v{{[0-9]+}}.16b
1196 ; CHECK: ext
1197     %1 = load <2 x double>, <2 x double>* %p
1198     %2 = fadd <2 x double> %1, %1
1199     %3 = call <16 x i8> @test_v16i8_v2f64_helper(<2 x double> %2)
1200     br label %return_bb
1201 return_bb:
1202     %4 = add <16 x i8> %3, %3
1203     store <16 x i8> %4, <16 x i8>* %q
1204     ret void
1205 }
1206
1207 ; CHECK-LABEL: test_v16i8_v2i64:
1208 declare <16 x i8> @test_v16i8_v2i64_helper(<2 x i64> %p)
1209 define void @test_v16i8_v2i64(<2 x i64>* %p, <16 x i8>* %q) {
1210 ; CHECK: ext
1211 ; CHECK: rev64 v{{[0-9]+}}.16b
1212 ; CHECK: ext
1213     %1 = load <2 x i64>, <2 x i64>* %p
1214     %2 = add <2 x i64> %1, %1
1215     %3 = call <16 x i8> @test_v16i8_v2i64_helper(<2 x i64> %2)
1216     br label %return_bb
1217 return_bb:
1218     %4 = add <16 x i8> %3, %3
1219     store <16 x i8> %4, <16 x i8>* %q
1220     ret void
1221 }
1222
1223 ; CHECK-LABEL: test_v16i8_v4f32:
1224 declare <16 x i8> @test_v16i8_v4f32_helper(<4 x float> %p)
1225 define void @test_v16i8_v4f32(<4 x float>* %p, <16 x i8>* %q) {
1226 ; CHECK: rev64 v{{[0-9]+}}.4s
1227 ; CHECK: ext
1228 ; CHECK: rev64 v{{[0-9]+}}.16b
1229 ; CHECK: ext
1230     %1 = load <4 x float>, <4 x float>* %p
1231     %2 = fadd <4 x float> %1, %1
1232     %3 = call <16 x i8> @test_v16i8_v4f32_helper(<4 x float> %2)
1233     br label %return_bb
1234 return_bb:
1235     %4 = add <16 x i8> %3, %3
1236     store <16 x i8> %4, <16 x i8>* %q
1237     ret void
1238 }
1239
1240 ; CHECK-LABEL: test_v16i8_v4i32:
1241 declare <16 x i8> @test_v16i8_v4i32_helper(<4 x i32> %p)
1242 define void @test_v16i8_v4i32(<4 x i32>* %p, <16 x i8>* %q) {
1243 ; CHECK: rev64 v{{[0-9]+}}.4s
1244 ; CHECK: ext
1245 ; CHECK: rev64 v{{[0-9]+}}.16b
1246 ; CHECK: ext
1247     %1 = load <4 x i32>, <4 x i32>* %p
1248     %2 = add <4 x i32> %1, %1
1249     %3 = call <16 x i8> @test_v16i8_v4i32_helper(<4 x i32> %2)
1250     br label %return_bb
1251 return_bb:
1252     %4 = add <16 x i8> %3, %3
1253     store <16 x i8> %4, <16 x i8>* %q
1254     ret void
1255 }
1256
1257 ; CHECK-LABEL: test_v16i8_v8i16:
1258 declare <16 x i8> @test_v16i8_v8i16_helper(<8 x i16> %p)
1259 define void @test_v16i8_v8i16(<8 x i16>* %p, <16 x i8>* %q) {
1260 ; CHECK: rev64 v{{[0-9]+}}.8h
1261 ; CHECK: ext
1262 ; CHECK: rev64 v{{[0-9]+}}.16b
1263 ; CHECK: ext
1264     %1 = load <8 x i16>, <8 x i16>* %p
1265     %2 = add <8 x i16> %1, %1
1266     %3 = call <16 x i8> @test_v16i8_v8i16_helper(<8 x i16> %2)
1267     br label %return_bb
1268 return_bb:
1269     %4 = add <16 x i8> %3, %3
1270     store <16 x i8> %4, <16 x i8>* %q
1271     ret void
1272 }