1 // REQUIRES: powerpc-registered-target
2 // RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector \
3 // RUN:   -triple powerpc64-unknown-unknown -emit-llvm %s \
4 // RUN:   -flax-vector-conversions=integer \
5 // RUN:   -o - | FileCheck %s -check-prefix=CHECK-BE
6 
7 // RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector \
8 // RUN:   -triple powerpc64le-unknown-unknown -emit-llvm %s \
9 // RUN:   -flax-vector-conversions=integer \
10 // RUN:   -o - | FileCheck %s
11 
12 // FIXME: This last test is intended to fail if the default is changed to
13 // -flax-vector-conversions=none and <altivec.h> isn't fixed first.
14 // RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector \
15 // RUN:   -triple powerpc64-unknown-unknown -emit-llvm %s \
16 // RUN:   -o - | FileCheck %s -check-prefix=CHECK-BE
17 
18 #include <altivec.h>
19 
20 vector signed char vsca, vscb;
21 vector unsigned char vuca, vucb;
22 vector bool char vbca, vbcb;
23 vector signed short vssa, vssb;
24 vector unsigned short vusa, vusb;
25 vector bool short vbsa, vbsb;
26 vector signed int vsia, vsib;
27 vector unsigned int vuia, vuib;
28 vector bool int vbia, vbib;
29 vector signed long long vsla, vslb;
30 vector unsigned long long vula, vulb;
31 vector bool long long vbla, vblb;
32 vector float vfa, vfb;
33 vector double vda, vdb;
34 vector unsigned __int128 vui128a, vui128b;
35 vector signed __int128 vsi128a, vsi128b;
36 
37 float f[4] = { 23.4f, 56.7f, 89.0f, 12.3f };
38 double d[2] = { 23.4, 56.7 };
39 signed char sc[16] = { -8,  9, -10, 11, -12, 13, -14, 15,
40                         -0,  1,  -2,  3,  -4,  5,  -6,  7 };
41 unsigned char uc[16] = { 8,  9, 10, 11, 12, 13, 14, 15,
42                           0,  1,  2,  3,  4,  5,  6,  7 };
43 signed short ss[8] = { -1, 2, -3, 4, -5, 6, -7, 8 };
44 unsigned short us[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
45 signed int si[4] = { -1, 2, -3, 4 };
46 unsigned int ui[4] = { 0, 1, 2, 3 };
47 signed long sl[2] = { -1L, 2L };
48 unsigned long ul[2] = { 1L, 2L };
49 signed long long sll[2] = { 1LL, 1LL };
50 unsigned long long ull[2] = { -1LL, 1LL };
51 signed __int128 sint128[1] = { -1 };
52 unsigned __int128 uint128[1] = { 1 };
53 
test1(void)54 unsigned test1(void) {
55 // CHECK-BE: @llvm.ppc.altivec.vcmpequb(<16 x i8>
56 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
57 // CHECK-BE: extractelement <2 x i64>
58 // CHECK-BE: icmp eq i64 {{.*}}, 64
59 // CHECK-BE: extractelement <2 x i64>
60 // CHECK-BE: add i64 {{.*}}, 64
61 // CHECK-BE: lshr i64 {{.*}}, 3
62 // CHECK: @llvm.ppc.altivec.vcmpequb(<16 x i8>
63 // CHECK: @llvm.cttz.v2i64(<2 x i64>
64 // CHECK: extractelement <2 x i64>
65 // CHECK: icmp eq i64 {{.*}}, 64
66 // CHECK: extractelement <2 x i64>
67 // CHECK: add i64 {{.*}}, 64
68 // CHECK: lshr i64 {{.*}}, 3
69   return vec_first_match_index (vsca, vscb);
70 }
test2(void)71 unsigned test2(void) {
72 // CHECK-BE: @llvm.ppc.altivec.vcmpequb(<16 x i8>
73 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
74 // CHECK-BE: extractelement <2 x i64>
75 // CHECK-BE: icmp eq i64 {{.*}}, 64
76 // CHECK-BE: extractelement <2 x i64>
77 // CHECK-BE: add i64 {{.*}}, 64
78 // CHECK-BE: lshr i64 {{.*}}, 3
79 // CHECK: @llvm.ppc.altivec.vcmpequb(<16 x i8>
80 // CHECK: @llvm.cttz.v2i64(<2 x i64>
81 // CHECK: extractelement <2 x i64>
82 // CHECK: icmp eq i64 {{.*}}, 64
83 // CHECK: extractelement <2 x i64>
84 // CHECK: add i64 {{.*}}, 64
85 // CHECK: lshr i64 {{.*}}, 3
86   return vec_first_match_index (vuca, vucb);
87 }
test3(void)88 unsigned test3(void) {
89 // CHECK-BE: @llvm.ppc.altivec.vcmpequw(<4 x i32>
90 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
91 // CHECK-BE: extractelement <2 x i64>
92 // CHECK-BE: icmp eq i64 {{.*}}, 64
93 // CHECK-BE: extractelement <2 x i64>
94 // CHECK-BE: add i64 {{.*}}, 64
95 // CHECK-BE: lshr i64 {{.*}}, 5
96 // CHECK: @llvm.ppc.altivec.vcmpequw(<4 x i32>
97 // CHECK: @llvm.cttz.v2i64(<2 x i64>
98 // CHECK: extractelement <2 x i64>
99 // CHECK: icmp eq i64 {{.*}}, 64
100 // CHECK: extractelement <2 x i64>
101 // CHECK: add i64 {{.*}}, 64
102 // CHECK: lshr i64 {{.*}}, 5
103   return vec_first_match_index (vsia, vsib);
104 }
test4(void)105 unsigned test4(void) {
106 // CHECK-BE: @llvm.ppc.altivec.vcmpequw(<4 x i32>
107 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
108 // CHECK-BE: extractelement <2 x i64>
109 // CHECK-BE: icmp eq i64 {{.*}}, 64
110 // CHECK-BE: extractelement <2 x i64>
111 // CHECK-BE: add i64 {{.*}}, 64
112 // CHECK-BE: lshr i64 {{.*}}, 5
113 // CHECK: @llvm.ppc.altivec.vcmpequw(<4 x i32>
114 // CHECK: @llvm.cttz.v2i64(<2 x i64>
115 // CHECK: extractelement <2 x i64>
116 // CHECK: icmp eq i64 {{.*}}, 64
117 // CHECK: extractelement <2 x i64>
118 // CHECK: add i64 {{.*}}, 64
119 // CHECK: lshr i64 {{.*}}, 5
120   return vec_first_match_index (vuia, vuib);
121 }
test5(void)122 unsigned test5(void) {
123 // CHECK-BE: @llvm.ppc.altivec.vcmpequh(<8 x i16>
124 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
125 // CHECK-BE: extractelement <2 x i64>
126 // CHECK-BE: icmp eq i64 {{.*}}, 64
127 // CHECK-BE: extractelement <2 x i64>
128 // CHECK-BE: add i64 {{.*}}, 64
129 // CHECK-BE: lshr i64 {{.*}}, 4
130 // CHECK: @llvm.ppc.altivec.vcmpequh(<8 x i16>
131 // CHECK: @llvm.cttz.v2i64(<2 x i64>
132 // CHECK: extractelement <2 x i64>
133 // CHECK: icmp eq i64 {{.*}}, 64
134 // CHECK: extractelement <2 x i64>
135 // CHECK: add i64 {{.*}}, 64
136 // CHECK: lshr i64 {{.*}}, 4
137   return vec_first_match_index (vssa, vssb);
138 }
test6(void)139 unsigned test6(void) {
140 // CHECK-BE: @llvm.ppc.altivec.vcmpequh(<8 x i16>
141 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
142 // CHECK-BE: extractelement <2 x i64>
143 // CHECK-BE: icmp eq i64 {{.*}}, 64
144 // CHECK-BE: extractelement <2 x i64>
145 // CHECK-BE: add i64 {{.*}}, 64
146 // CHECK-BE: lshr i64 {{.*}}, 4
147 // CHECK: @llvm.ppc.altivec.vcmpequh(<8 x i16>
148 // CHECK: @llvm.cttz.v2i64(<2 x i64>
149 // CHECK: extractelement <2 x i64>
150 // CHECK: icmp eq i64 {{.*}}, 64
151 // CHECK: extractelement <2 x i64>
152 // CHECK: add i64 {{.*}}, 64
153 // CHECK: lshr i64 {{.*}}, 4
154   return vec_first_match_index (vusa, vusb);
155 }
test7(void)156 unsigned test7(void) {
157 // CHECK-BE: @llvm.ppc.altivec.vcmpequb(<16 x i8>
158 // CHECK-BE: @llvm.ppc.altivec.vcmpequb(<16 x i8>
159 // CHECK-BE: or <16 x i8>
160 // CHECK-BE: @llvm.ppc.altivec.vcmpequb(<16 x i8>
161 // CHECK-BE: or <16 x i8>
162 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
163 // CHECK-BE: extractelement <2 x i64>
164 // CHECK-BE: icmp eq i64 {{.*}}, 64
165 // CHECK-BE: extractelement <2 x i64>
166 // CHECK-BE: add i64 {{.*}}, 64
167 // CHECK-BE: lshr i64 {{.*}}, 3
168 // CHECK: @llvm.ppc.altivec.vcmpequb(<16 x i8>
169 // CHECK: @llvm.ppc.altivec.vcmpequb(<16 x i8>
170 // CHECK: or <16 x i8>
171 // CHECK: @llvm.ppc.altivec.vcmpequb(<16 x i8>
172 // CHECK: or <16 x i8>
173 // CHECK: @llvm.cttz.v2i64(<2 x i64>
174 // CHECK: extractelement <2 x i64>
175 // CHECK: icmp eq i64 {{.*}}, 64
176 // CHECK: extractelement <2 x i64>
177 // CHECK: add i64 {{.*}}, 64
178 // CHECK: lshr i64 {{.*}}, 3
179   return vec_first_match_or_eos_index (vsca, vscb);
180 }
test8(void)181 unsigned test8(void) {
182 // CHECK-BE: @llvm.ppc.altivec.vcmpequb(<16 x i8>
183 // CHECK-BE: @llvm.ppc.altivec.vcmpequb(<16 x i8>
184 // CHECK-BE: or <16 x i8>
185 // CHECK-BE: @llvm.ppc.altivec.vcmpequb(<16 x i8>
186 // CHECK-BE: or <16 x i8>
187 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
188 // CHECK-BE: extractelement <2 x i64>
189 // CHECK-BE: icmp eq i64 {{.*}}, 64
190 // CHECK-BE: extractelement <2 x i64>
191 // CHECK-BE: add i64 {{.*}}, 64
192 // CHECK-BE: lshr i64 {{.*}}, 3
193 // CHECK: @llvm.ppc.altivec.vcmpequb(<16 x i8>
194 // CHECK: @llvm.ppc.altivec.vcmpequb(<16 x i8>
195 // CHECK: or <16 x i8>
196 // CHECK: @llvm.ppc.altivec.vcmpequb(<16 x i8>
197 // CHECK: or <16 x i8>
198 // CHECK: @llvm.cttz.v2i64(<2 x i64>
199 // CHECK: extractelement <2 x i64>
200 // CHECK: icmp eq i64 {{.*}}, 64
201 // CHECK: extractelement <2 x i64>
202 // CHECK: add i64 {{.*}}, 64
203 // CHECK: lshr i64 {{.*}}, 3
204   return vec_first_match_or_eos_index (vuca, vucb);
205 }
test9(void)206 unsigned test9(void) {
207 // CHECK-BE: @llvm.ppc.altivec.vcmpequw(<4 x i32>
208 // CHECK-BE: @llvm.ppc.altivec.vcmpequw(<4 x i32>
209 // CHECK-BE: or <4 x i32>
210 // CHECK-BE: @llvm.ppc.altivec.vcmpequw(<4 x i32>
211 // CHECK-BE: or <4 x i32>
212 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
213 // CHECK-BE: extractelement <2 x i64>
214 // CHECK-BE: icmp eq i64 {{.*}}, 64
215 // CHECK-BE: extractelement <2 x i64>
216 // CHECK-BE: add i64 {{.*}}, 64
217 // CHECK-BE: lshr i64 {{.*}}, 5
218 // CHECK: @llvm.ppc.altivec.vcmpequw(<4 x i32>
219 // CHECK: @llvm.ppc.altivec.vcmpequw(<4 x i32>
220 // CHECK: or <4 x i32>
221 // CHECK: @llvm.ppc.altivec.vcmpequw(<4 x i32>
222 // CHECK: or <4 x i32>
223 // CHECK: @llvm.cttz.v2i64(<2 x i64>
224 // CHECK: extractelement <2 x i64>
225 // CHECK: icmp eq i64 {{.*}}, 64
226 // CHECK: extractelement <2 x i64>
227 // CHECK: add i64 {{.*}}, 64
228 // CHECK: lshr i64 {{.*}}, 5
229   return vec_first_match_or_eos_index (vsia, vsib);
230 }
test10(void)231 unsigned test10(void) {
232 // CHECK-BE: @llvm.ppc.altivec.vcmpequw(<4 x i32>
233 // CHECK-BE: @llvm.ppc.altivec.vcmpequw(<4 x i32>
234 // CHECK-BE: or <4 x i32>
235 // CHECK-BE: @llvm.ppc.altivec.vcmpequw(<4 x i32>
236 // CHECK-BE: or <4 x i32>
237 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
238 // CHECK-BE: extractelement <2 x i64>
239 // CHECK-BE: icmp eq i64 {{.*}}, 64
240 // CHECK-BE: extractelement <2 x i64>
241 // CHECK-BE: add i64 {{.*}}, 64
242 // CHECK-BE: lshr i64 {{.*}}, 5
243 // CHECK: @llvm.ppc.altivec.vcmpequw(<4 x i32>
244 // CHECK: @llvm.ppc.altivec.vcmpequw(<4 x i32>
245 // CHECK: or <4 x i32>
246 // CHECK: @llvm.ppc.altivec.vcmpequw(<4 x i32>
247 // CHECK: or <4 x i32>
248 // CHECK: @llvm.cttz.v2i64(<2 x i64>
249 // CHECK: extractelement <2 x i64>
250 // CHECK: icmp eq i64 {{.*}}, 64
251 // CHECK: extractelement <2 x i64>
252 // CHECK: add i64 {{.*}}, 64
253 // CHECK: lshr i64 {{.*}}, 5
254   return vec_first_match_or_eos_index (vuia, vuib);
255 }
test11(void)256 unsigned test11(void) {
257 // CHECK-BE: @llvm.ppc.altivec.vcmpequh(<8 x i16>
258 // CHECK-BE: @llvm.ppc.altivec.vcmpequh(<8 x i16>
259 // CHECK-BE: or <8 x i16>
260 // CHECK-BE: @llvm.ppc.altivec.vcmpequh(<8 x i16>
261 // CHECK-BE: or <8 x i16>
262 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
263 // CHECK-BE: extractelement <2 x i64>
264 // CHECK-BE: icmp eq i64 {{.*}}, 64
265 // CHECK-BE: extractelement <2 x i64>
266 // CHECK-BE: add i64 {{.*}}, 64
267 // CHECK-BE: lshr i64 {{.*}}, 4
268 // CHECK: @llvm.ppc.altivec.vcmpequh(<8 x i16>
269 // CHECK: @llvm.ppc.altivec.vcmpequh(<8 x i16>
270 // CHECK: or <8 x i16>
271 // CHECK: @llvm.ppc.altivec.vcmpequh(<8 x i16>
272 // CHECK: or <8 x i16>
273 // CHECK: @llvm.cttz.v2i64(<2 x i64>
274 // CHECK: extractelement <2 x i64>
275 // CHECK: icmp eq i64 {{.*}}, 64
276 // CHECK: extractelement <2 x i64>
277 // CHECK: add i64 {{.*}}, 64
278 // CHECK: lshr i64 {{.*}}, 4
279   return vec_first_match_or_eos_index (vssa, vssb);
280 }
test12(void)281 unsigned test12(void) {
282 // CHECK-BE: @llvm.ppc.altivec.vcmpequh(<8 x i16>
283 // CHECK-BE: @llvm.ppc.altivec.vcmpequh(<8 x i16>
284 // CHECK-BE: or <8 x i16>
285 // CHECK-BE: @llvm.ppc.altivec.vcmpequh(<8 x i16>
286 // CHECK-BE: or <8 x i16>
287 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
288 // CHECK-BE: extractelement <2 x i64>
289 // CHECK-BE: icmp eq i64 {{.*}}, 64
290 // CHECK-BE: extractelement <2 x i64>
291 // CHECK-BE: add i64 {{.*}}, 64
292 // CHECK-BE: lshr i64 {{.*}}, 4
293 // CHECK: @llvm.ppc.altivec.vcmpequh(<8 x i16>
294 // CHECK: @llvm.ppc.altivec.vcmpequh(<8 x i16>
295 // CHECK: or <8 x i16>
296 // CHECK: @llvm.ppc.altivec.vcmpequh(<8 x i16>
297 // CHECK: or <8 x i16>
298 // CHECK: @llvm.cttz.v2i64(<2 x i64>
299 // CHECK: extractelement <2 x i64>
300 // CHECK: icmp eq i64 {{.*}}, 64
301 // CHECK: extractelement <2 x i64>
302 // CHECK: add i64 {{.*}}, 64
303 // CHECK: lshr i64 {{.*}}, 4
304   return vec_first_match_or_eos_index (vusa, vusb);
305 }
test13(void)306 unsigned test13(void) {
307 // CHECK-BE: @llvm.ppc.altivec.vcmpneb(<16 x i8>
308 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
309 // CHECK-BE: extractelement <2 x i64>
310 // CHECK-BE: icmp eq i64 {{.*}}, 64
311 // CHECK-BE: extractelement <2 x i64>
312 // CHECK-BE: add i64 {{.*}}, 64
313 // CHECK-BE: lshr i64 {{.*}}, 3
314 // CHECK: @llvm.ppc.altivec.vcmpneb(<16 x i8>
315 // CHECK: @llvm.cttz.v2i64(<2 x i64>
316 // CHECK: extractelement <2 x i64>
317 // CHECK: icmp eq i64 {{.*}}, 64
318 // CHECK: extractelement <2 x i64>
319 // CHECK: add i64 {{.*}}, 64
320 // CHECK: lshr i64 {{.*}}, 3
321   return vec_first_mismatch_index (vsca, vscb);
322 }
test14(void)323 unsigned test14(void) {
324 // CHECK-BE: @llvm.ppc.altivec.vcmpneb(<16 x i8>
325 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
326 // CHECK-BE: extractelement <2 x i64>
327 // CHECK-BE: icmp eq i64 {{.*}}, 64
328 // CHECK-BE: extractelement <2 x i64>
329 // CHECK-BE: add i64 {{.*}}, 64
330 // CHECK-BE: lshr i64 {{.*}}, 3
331 // CHECK: @llvm.ppc.altivec.vcmpneb(<16 x i8>
332 // CHECK: @llvm.cttz.v2i64(<2 x i64>
333 // CHECK: extractelement <2 x i64>
334 // CHECK: icmp eq i64 {{.*}}, 64
335 // CHECK: extractelement <2 x i64>
336 // CHECK: add i64 {{.*}}, 64
337 // CHECK: lshr i64 {{.*}}, 3
338   return vec_first_mismatch_index (vuca, vucb);
339 }
test15(void)340 unsigned test15(void) {
341 // CHECK-BE: @llvm.ppc.altivec.vcmpnew(<4 x i32>
342 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
343 // CHECK-BE: extractelement <2 x i64>
344 // CHECK-BE: icmp eq i64 {{.*}}, 64
345 // CHECK-BE: extractelement <2 x i64>
346 // CHECK-BE: add i64 {{.*}}, 64
347 // CHECK-BE: lshr i64 {{.*}}, 5
348 // CHECK: @llvm.ppc.altivec.vcmpnew(<4 x i32>
349 // CHECK: @llvm.cttz.v2i64(<2 x i64>
350 // CHECK: extractelement <2 x i64>
351 // CHECK: icmp eq i64 {{.*}}, 64
352 // CHECK: extractelement <2 x i64>
353 // CHECK: add i64 {{.*}}, 64
354 // CHECK: lshr i64 {{.*}}, 5
355   return vec_first_mismatch_index (vsia, vsib);
356 }
test16(void)357 unsigned test16(void) {
358 // CHECK-BE: @llvm.ppc.altivec.vcmpnew(<4 x i32>
359 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
360 // CHECK-BE: extractelement <2 x i64>
361 // CHECK-BE: icmp eq i64 {{.*}}, 64
362 // CHECK-BE: extractelement <2 x i64>
363 // CHECK-BE: add i64 {{.*}}, 64
364 // CHECK-BE: lshr i64 {{.*}}, 5
365 // CHECK: @llvm.ppc.altivec.vcmpnew(<4 x i32>
366 // CHECK: @llvm.cttz.v2i64(<2 x i64>
367 // CHECK: extractelement <2 x i64>
368 // CHECK: icmp eq i64 {{.*}}, 64
369 // CHECK: extractelement <2 x i64>
370 // CHECK: add i64 {{.*}}, 64
371 // CHECK: lshr i64 {{.*}}, 5
372   return vec_first_mismatch_index (vuia, vuib);
373 }
test17(void)374 unsigned test17(void) {
375 // CHECK-BE: @llvm.ppc.altivec.vcmpneh(<8 x i16>
376 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
377 // CHECK-BE: extractelement <2 x i64>
378 // CHECK-BE: icmp eq i64 {{.*}}, 64
379 // CHECK-BE: extractelement <2 x i64>
380 // CHECK-BE: add i64 {{.*}}, 64
381 // CHECK-BE: lshr i64 {{.*}}, 4
382 // CHECK: @llvm.ppc.altivec.vcmpneh(<8 x i16>
383 // CHECK: @llvm.cttz.v2i64(<2 x i64>
384 // CHECK: extractelement <2 x i64>
385 // CHECK: icmp eq i64 {{.*}}, 64
386 // CHECK: extractelement <2 x i64>
387 // CHECK: add i64 {{.*}}, 64
388 // CHECK: lshr i64 {{.*}}, 4
389   return vec_first_mismatch_index (vssa, vssb);
390 }
test18(void)391 unsigned test18(void) {
392 // CHECK-BE: @llvm.ppc.altivec.vcmpneh(<8 x i16>
393 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
394 // CHECK-BE: extractelement <2 x i64>
395 // CHECK-BE: icmp eq i64 {{.*}}, 64
396 // CHECK-BE: extractelement <2 x i64>
397 // CHECK-BE: add i64 {{.*}}, 64
398 // CHECK-BE: lshr i64 {{.*}}, 4
399 // CHECK: @llvm.ppc.altivec.vcmpneh(<8 x i16>
400 // CHECK: @llvm.cttz.v2i64(<2 x i64>
401 // CHECK: extractelement <2 x i64>
402 // CHECK: icmp eq i64 {{.*}}, 64
403 // CHECK: extractelement <2 x i64>
404 // CHECK: add i64 {{.*}}, 64
405 // CHECK: lshr i64 {{.*}}, 4
406   return vec_first_mismatch_index (vusa, vusb);
407 }
test19(void)408 unsigned test19(void) {
409 // CHECK-BE: @llvm.ppc.altivec.vcmpnezb(<16 x i8>
410 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
411 // CHECK-BE: extractelement <2 x i64>
412 // CHECK-BE: icmp eq i64 {{.*}}, 64
413 // CHECK-BE: extractelement <2 x i64>
414 // CHECK-BE: add i64 {{.*}}, 64
415 // CHECK-BE: lshr i64 {{.*}}, 3
416 // CHECK: @llvm.ppc.altivec.vcmpnezb(<16 x i8>
417 // CHECK: @llvm.cttz.v2i64(<2 x i64>
418 // CHECK: extractelement <2 x i64>
419 // CHECK: icmp eq i64 {{.*}}, 64
420 // CHECK: extractelement <2 x i64>
421 // CHECK: add i64 {{.*}}, 64
422 // CHECK: lshr i64 {{.*}}, 3
423   return vec_first_mismatch_or_eos_index (vsca, vscb);
424 }
test20(void)425 unsigned test20(void) {
426 // CHECK-BE: @llvm.ppc.altivec.vcmpnezb(<16 x i8>
427 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
428 // CHECK-BE: extractelement <2 x i64>
429 // CHECK-BE: icmp eq i64 {{.*}}, 64
430 // CHECK-BE: extractelement <2 x i64>
431 // CHECK-BE: add i64 {{.*}}, 64
432 // CHECK-BE: lshr i64 {{.*}}, 3
433 // CHECK: @llvm.ppc.altivec.vcmpnezb(<16 x i8>
434 // CHECK: @llvm.cttz.v2i64(<2 x i64>
435 // CHECK: extractelement <2 x i64>
436 // CHECK: icmp eq i64 {{.*}}, 64
437 // CHECK: extractelement <2 x i64>
438 // CHECK: add i64 {{.*}}, 64
439 // CHECK: lshr i64 {{.*}}, 3
440   return vec_first_mismatch_or_eos_index (vuca, vucb);
441 }
test21(void)442 unsigned test21(void) {
443 // CHECK-BE: @llvm.ppc.altivec.vcmpnezw(<4 x i32>
444 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
445 // CHECK-BE: extractelement <2 x i64>
446 // CHECK-BE: icmp eq i64 {{.*}}, 64
447 // CHECK-BE: extractelement <2 x i64>
448 // CHECK-BE: add i64 {{.*}}, 64
449 // CHECK-BE: lshr i64 {{.*}}, 5
450 // CHECK: @llvm.ppc.altivec.vcmpnezw(<4 x i32>
451 // CHECK: @llvm.cttz.v2i64(<2 x i64>
452 // CHECK: extractelement <2 x i64>
453 // CHECK: icmp eq i64 {{.*}}, 64
454 // CHECK: extractelement <2 x i64>
455 // CHECK: add i64 {{.*}}, 64
456 // CHECK: lshr i64 {{.*}}, 5
457   return vec_first_mismatch_or_eos_index (vsia, vsib);
458 }
test22(void)459 unsigned test22(void) {
460 // CHECK-BE: @llvm.ppc.altivec.vcmpnezw(<4 x i32>
461 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
462 // CHECK-BE: extractelement <2 x i64>
463 // CHECK-BE: icmp eq i64 {{.*}}, 64
464 // CHECK-BE: extractelement <2 x i64>
465 // CHECK-BE: add i64 {{.*}}, 64
466 // CHECK-BE: lshr i64 {{.*}}, 5
467 // CHECK: @llvm.ppc.altivec.vcmpnezw(<4 x i32>
468 // CHECK: @llvm.cttz.v2i64(<2 x i64>
469 // CHECK: extractelement <2 x i64>
470 // CHECK: icmp eq i64 {{.*}}, 64
471 // CHECK: extractelement <2 x i64>
472 // CHECK: add i64 {{.*}}, 64
473 // CHECK: lshr i64 {{.*}}, 5
474   return vec_first_mismatch_or_eos_index (vuia, vuib);
475 }
test23(void)476 unsigned test23(void) {
477 // CHECK-BE: @llvm.ppc.altivec.vcmpnezh(<8 x i16>
478 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
479 // CHECK-BE: extractelement <2 x i64>
480 // CHECK-BE: icmp eq i64 {{.*}}, 64
481 // CHECK-BE: extractelement <2 x i64>
482 // CHECK-BE: add i64 {{.*}}, 64
483 // CHECK-BE: lshr i64 {{.*}}, 4
484 // CHECK: @llvm.ppc.altivec.vcmpnezh(<8 x i16>
485 // CHECK: @llvm.cttz.v2i64(<2 x i64>
486 // CHECK: extractelement <2 x i64>
487 // CHECK: icmp eq i64 {{.*}}, 64
488 // CHECK: extractelement <2 x i64>
489 // CHECK: add i64 {{.*}}, 64
490 // CHECK: lshr i64 {{.*}}, 4
491   return vec_first_mismatch_or_eos_index (vssa, vssb);
492 }
test24(void)493 unsigned test24(void) {
494 // CHECK-BE: @llvm.ppc.altivec.vcmpnezh(<8 x i16>
495 // CHECK-BE: @llvm.ctlz.v2i64(<2 x i64>
496 // CHECK-BE: extractelement <2 x i64>
497 // CHECK-BE: icmp eq i64 {{.*}}, 64
498 // CHECK-BE: extractelement <2 x i64>
499 // CHECK-BE: add i64 {{.*}}, 64
500 // CHECK-BE: lshr i64 {{.*}}, 4
501 // CHECK: @llvm.ppc.altivec.vcmpnezh(<8 x i16>
502 // CHECK: @llvm.cttz.v2i64(<2 x i64>
503 // CHECK: extractelement <2 x i64>
504 // CHECK: icmp eq i64 {{.*}}, 64
505 // CHECK: extractelement <2 x i64>
506 // CHECK: add i64 {{.*}}, 64
507 // CHECK: lshr i64 {{.*}}, 4
508   return vec_first_mismatch_or_eos_index (vusa, vusb);
509 }
test25(void)510 vector bool char test25(void) {
511 // CHECK-BE: @llvm.ppc.altivec.vcmpneb(<16 x i8>
512 // CHECK-BE-NEXT: ret <16 x i8>
513 // CHECK: @llvm.ppc.altivec.vcmpneb(<16 x i8>
514 // CHECK-NEXT: ret <16 x i8>
515   return vec_cmpne (vbca, vbcb);
516 }
test26(void)517 vector bool char test26(void) {
518 // CHECK-BE: @llvm.ppc.altivec.vcmpneb(<16 x i8>
519 // CHECK-BE-NEXT: ret <16 x i8>
520 // CHECK: @llvm.ppc.altivec.vcmpneb(<16 x i8>
521 // CHECK-NEXT: ret <16 x i8>
522   return vec_cmpne (vsca, vscb);
523 }
test27(void)524 vector bool char test27(void) {
525 // CHECK-BE: @llvm.ppc.altivec.vcmpneb(<16 x i8>
526 // CHECK-BE-NEXT: ret <16 x i8>
527 // CHECK: @llvm.ppc.altivec.vcmpneb(<16 x i8>
528 // CHECK-NEXT: ret <16 x i8>
529   return vec_cmpne (vuca, vucb);
530 }
test28(void)531 vector bool int test28(void) {
532 // CHECK-BE: @llvm.ppc.altivec.vcmpnew(<4 x i32>
533 // CHECK-BE-NEXT: ret <4 x i32>
534 // CHECK: @llvm.ppc.altivec.vcmpnew(<4 x i32>
535 // CHECK-NEXT: ret <4 x i32>
536   return vec_cmpne (vbia, vbib);
537 }
test29(void)538 vector bool int test29(void) {
539 // CHECK-BE: @llvm.ppc.altivec.vcmpnew(<4 x i32>
540 // CHECK-BE-NEXT: ret <4 x i32>
541 // CHECK: @llvm.ppc.altivec.vcmpnew(<4 x i32>
542 // CHECK-NEXT: ret <4 x i32>
543   return vec_cmpne (vsia, vsib);
544 }
test30(void)545 vector bool int test30(void) {
546 // CHECK-BE: @llvm.ppc.altivec.vcmpnew(<4 x i32>
547 // CHECK-BE-NEXT: ret <4 x i32>
548 // CHECK: @llvm.ppc.altivec.vcmpnew(<4 x i32>
549 // CHECK-NEXT: ret <4 x i32>
550   return vec_cmpne (vuia, vuib);
551 }
test31(void)552 vector bool long long test31(void) {
553 // CHECK-BE: @llvm.ppc.altivec.vcmpequd(<2 x i64>
554 // CHECK-BE: xor <2 x i64>
555 // CHECK-BE-NEXT: ret <2 x i64>
556 // CHECK: @llvm.ppc.altivec.vcmpequd(<2 x i64>
557 // CHECK: xor <2 x i64>
558 // CHECK-NEXT: ret <2 x i64>
559   return vec_cmpne (vbla, vblb);
560 }
test32(void)561 vector bool long long test32(void) {
562 // CHECK-BE: @llvm.ppc.altivec.vcmpequd(<2 x i64>
563 // CHECK-BE: xor <2 x i64>
564 // CHECK-BE-NEXT: ret <2 x i64>
565 // CHECK: @llvm.ppc.altivec.vcmpequd(<2 x i64>
566 // CHECK: xor <2 x i64>
567 // CHECK-NEXT: ret <2 x i64>
568   return vec_cmpne (vsla, vslb);
569 }
test33(void)570 vector bool long long test33(void) {
571 // CHECK-BE: @llvm.ppc.altivec.vcmpequd(<2 x i64>
572 // CHECK-BE: xor <2 x i64>
573 // CHECK-BE-NEXT: ret <2 x i64>
574 // CHECK: @llvm.ppc.altivec.vcmpequd(<2 x i64>
575 // CHECK: xor <2 x i64>
576 // CHECK-NEXT: ret <2 x i64>
577   return vec_cmpne (vula, vulb);
578 }
test34(void)579 vector bool short test34(void) {
580 // CHECK-BE: @llvm.ppc.altivec.vcmpneh(<8 x i16>
581 // CHECK-BE-NEXT: ret <8 x i16>
582 // CHECK: @llvm.ppc.altivec.vcmpneh(<8 x i16>
583 // CHECK-NEXT: ret <8 x i16>
584   return vec_cmpne (vbsa, vbsb);
585 }
test35(void)586 vector bool short test35(void) {
587 // CHECK-BE: @llvm.ppc.altivec.vcmpneh(<8 x i16>
588 // CHECK-BE-NEXT: ret <8 x i16>
589 // CHECK: @llvm.ppc.altivec.vcmpneh(<8 x i16>
590 // CHECK-NEXT: ret <8 x i16>
591   return vec_cmpne (vssa, vssb);
592 }
test36(void)593 vector bool short test36(void) {
594 // CHECK-BE: @llvm.ppc.altivec.vcmpneh(<8 x i16>
595 // CHECK-BE-NEXT: ret <8 x i16>
596 // CHECK: @llvm.ppc.altivec.vcmpneh(<8 x i16>
597 // CHECK-NEXT: ret <8 x i16>
598   return vec_cmpne (vusa, vusb);
599 }
test37(void)600 vector bool long long test37(void) {
601 // CHECK-BE: @llvm.ppc.altivec.vcmpequd(<2 x i64>
602 // CHECK-BE: xor <2 x i64>
603 // CHECK-BE-NEXT: ret <2 x i64>
604 // CHECK: @llvm.ppc.altivec.vcmpequd(<2 x i64>
605 // CHECK: xor <2 x i64>
606 // CHECK-NEXT: ret <2 x i64>
607   return vec_cmpne (vda, vdb);
608 }
test38(void)609 vector bool int test38(void) {
610 // CHECK-BE: @llvm.ppc.altivec.vcmpnew(<4 x i32>
611 // CHECK-BE-NEXT: ret <4 x i32>
612 // CHECK: @llvm.ppc.altivec.vcmpnew(<4 x i32>
613 // CHECK-NEXT: ret <4 x i32>
614   return vec_cmpne (vfa, vfb);
615 }
test39(void)616 vector signed char test39(void) {
617 // CHECK-BE: @llvm.cttz.v16i8(<16 x i8>
618 // CHECK-BE-NEXT: ret <16 x i8>
619 // CHECK: @llvm.cttz.v16i8(<16 x i8>
620 // CHECK-NEXT: ret <16 x i8>
621   return vec_cnttz (vsca);
622 }
test40(void)623 vector unsigned char test40(void) {
624 // CHECK-BE: @llvm.cttz.v16i8(<16 x i8>
625 // CHECK-BE-NEXT: ret <16 x i8>
626 // CHECK: @llvm.cttz.v16i8(<16 x i8>
627 // CHECK-NEXT: ret <16 x i8>
628   return vec_cnttz (vuca);
629 }
test41(void)630 vector signed int test41(void) {
631 // CHECK-BE: @llvm.cttz.v4i32(<4 x i32>
632 // CHECK-BE-NEXT: ret <4 x i32>
633 // CHECK: @llvm.cttz.v4i32(<4 x i32>
634 // CHECK-NEXT: ret <4 x i32>
635   return vec_cnttz (vsia);
636 }
test42(void)637 vector unsigned int test42(void) {
638 // CHECK-BE: @llvm.cttz.v4i32(<4 x i32>
639 // CHECK-BE-NEXT: ret <4 x i32>
640 // CHECK: @llvm.cttz.v4i32(<4 x i32>
641 // CHECK-NEXT: ret <4 x i32>
642   return vec_cnttz (vuia);
643 }
test43(void)644 vector signed long long test43(void) {
645 // CHECK-BE: @llvm.cttz.v2i64(<2 x i64>
646 // CHECK-BE-NEXT: ret <2 x i64>
647 // CHECK: @llvm.cttz.v2i64(<2 x i64>
648 // CHECK-NEXT: ret <2 x i64>
649   return vec_cnttz (vsla);
650 }
test44(void)651 vector unsigned long long test44(void) {
652 // CHECK-BE: @llvm.cttz.v2i64(<2 x i64>
653 // CHECK-BE-NEXT: ret <2 x i64>
654 // CHECK: @llvm.cttz.v2i64(<2 x i64>
655 // CHECK-NEXT: ret <2 x i64>
656   return vec_cnttz (vula);
657 }
test45(void)658 vector signed short test45(void) {
659 // CHECK-BE: @llvm.cttz.v8i16(<8 x i16>
660 // CHECK-BE-NEXT: ret <8 x i16>
661 // CHECK: @llvm.cttz.v8i16(<8 x i16>
662 // CHECK-NEXT: ret <8 x i16>
663   return vec_cnttz (vssa);
664 }
test46(void)665 vector unsigned short test46(void) {
666 // CHECK-BE: @llvm.cttz.v8i16(<8 x i16>
667 // CHECK-BE-NEXT: ret <8 x i16>
668 // CHECK: @llvm.cttz.v8i16(<8 x i16>
669 // CHECK-NEXT: ret <8 x i16>
670   return vec_cnttz (vusa);
671 }
test47(void)672 vector unsigned char test47(void) {
673 // CHECK-BE: @llvm.ctpop.v16i8(<16 x i8>
674 // CHECK-BE-NEXT: ret <16 x i8>
675 // CHECK: @llvm.ctpop.v16i8(<16 x i8>
676 // CHECK-NEXT: ret <16 x i8>
677   return vec_popcnt (vsca);
678 }
test48(void)679 vector unsigned char test48(void) {
680 // CHECK-BE: @llvm.ctpop.v16i8(<16 x i8>
681 // CHECK-BE-NEXT: ret <16 x i8>
682 // CHECK: @llvm.ctpop.v16i8(<16 x i8>
683 // CHECK-NEXT: ret <16 x i8>
684   return vec_popcnt (vuca);
685 }
test49(void)686 vector unsigned int test49(void) {
687 // CHECK-BE: @llvm.ctpop.v4i32(<4 x i32>
688 // CHECK-BE-NEXT: ret <4 x i32>
689 // CHECK: @llvm.ctpop.v4i32(<4 x i32>
690 // CHECK-NEXT: ret <4 x i32>
691   return vec_popcnt (vsia);
692 }
test50(void)693 vector unsigned int test50(void) {
694 // CHECK-BE: @llvm.ctpop.v4i32(<4 x i32>
695 // CHECK-BE-NEXT: ret <4 x i32>
696 // CHECK: @llvm.ctpop.v4i32(<4 x i32>
697 // CHECK-NEXT: ret <4 x i32>
698   return vec_popcnt (vuia);
699 }
test51(void)700 vector unsigned long long test51(void) {
701 // CHECK-BE: @llvm.ctpop.v2i64(<2 x i64>
702 // CHECK-BE-NEXT: ret <2 x i64>
703 // CHECK: @llvm.ctpop.v2i64(<2 x i64>
704 // CHECK-NEXT: ret <2 x i64>
705   return vec_popcnt (vsla);
706 }
test52(void)707 vector unsigned long long test52(void) {
708 // CHECK-BE: @llvm.ctpop.v2i64(<2 x i64>
709 // CHECK-BE-NEXT: ret <2 x i64>
710 // CHECK: @llvm.ctpop.v2i64(<2 x i64>
711 // CHECK-NEXT: ret <2 x i64>
712   return vec_popcnt (vula);
713 }
test53(void)714 vector unsigned short test53(void) {
715 // CHECK-BE: @llvm.ctpop.v8i16(<8 x i16>
716 // CHECK-BE-NEXT: ret <8 x i16>
717 // CHECK: @llvm.ctpop.v8i16(<8 x i16>
718 // CHECK-NEXT: ret <8 x i16>
719   return vec_popcnt (vssa);
720 }
test54(void)721 vector unsigned short test54(void) {
722 // CHECK-BE: @llvm.ctpop.v8i16(<8 x i16>
723 // CHECK-BE-NEXT: ret <8 x i16>
724 // CHECK: @llvm.ctpop.v8i16(<8 x i16>
725 // CHECK-NEXT: ret <8 x i16>
726   return vec_popcnt (vusa);
727 }
test55(void)728 vector double test55(void) {
729 // CHECK-BE: @llvm.ppc.vsx.xviexpdp(<2 x i64> %{{.+}}, <2 x i64>
730 // CHECK-BE-NEXT: ret <2 x double>
731 // CHECK: @llvm.ppc.vsx.xviexpdp(<2 x i64> %{{.+}}, <2 x i64>
732 // CHECK-NEXT: ret <2 x double>
733   return vec_insert_exp (vda,vulb);
734 }
test56(void)735 vector double test56(void) {
736 // CHECK-BE: @llvm.ppc.vsx.xviexpdp(<2 x i64> %{{.+}}, <2 x i64>
737 // CHECK-BE-NEXT: ret <2 x double>
738 // CHECK: @llvm.ppc.vsx.xviexpdp(<2 x i64> %{{.+}}, <2 x i64>
739 // CHECK-NEXT: ret <2 x double>
740   return vec_insert_exp (vula, vulb);
741 }
test57(void)742 vector float test57(void) {
743 // CHECK-BE: @llvm.ppc.vsx.xviexpsp(<4 x i32> %{{.+}}, <4 x i32>
744 // CHECK-BE-NEXT: ret <4 x float>
745 // CHECK: @llvm.ppc.vsx.xviexpsp(<4 x i32> %{{.+}}, <4 x i32>
746 // CHECK-NEXT: ret <4 x float>
747   return vec_insert_exp (vfa,vuib);
748 }
test58(void)749 vector float test58(void) {
750 // CHECK-BE: @llvm.ppc.vsx.xviexpsp(<4 x i32> %{{.+}}, <4 x i32>
751 // CHECK-BE-NEXT: ret <4 x float>
752 // CHECK: @llvm.ppc.vsx.xviexpsp(<4 x i32> %{{.+}}, <4 x i32>
753 // CHECK-NEXT: ret <4 x float>
754   return vec_insert_exp (vuia,vuib);
755 }
test59(void)756 signed int test59(void) {
757 // CHECK-BE: @llvm.ppc.altivec.vclzlsbb(<16 x i8>
758 // CHECK-BE-NEXT: ret i32
759 // CHECK-LE: @llvm.ppc.altivec.vctzlsbb(<16 x i8>
760 // CHECK-LE-NEXT: ret i32
761   return vec_cntlz_lsbb (vuca);
762 }
test60(void)763 signed int test60(void) {
764 // CHECK-BE: @llvm.ppc.altivec.vclzlsbb(<16 x i8>
765 // CHECK-BE-NEXT: ret i32
766 // CHECK-LE: @llvm.ppc.altivec.vctzlsbb(<16 x i8>
767 // CHECK-LE-NEXT: ret i32
768   return vec_cntlz_lsbb (vsca);
769 }
test61(void)770 signed int test61(void) {
771 // CHECK-BE: @llvm.ppc.altivec.vctzlsbb(<16 x i8>
772 // CHECK-BE-NEXT: ret i32
773 // CHECK-LE: @llvm.ppc.altivec.vclzlsbb(<16 x i8>
774 // CHECK-LE-NEXT: ret i32
775   return vec_cnttz_lsbb (vsca);
776 }
test62(void)777 signed int test62(void) {
778 // CHECK-BE: @llvm.ppc.altivec.vctzlsbb(<16 x i8>
779 // CHECK-BE-NEXT: ret i32
780 // CHECK-LE: @llvm.ppc.altivec.vclzlsbb(<16 x i8>
781 // CHECK-LE-NEXT: ret i32
782   return vec_cnttz_lsbb (vuca);
783 }
test63(void)784 vector unsigned int test63(void) {
785 // CHECK-BE: @llvm.ppc.altivec.vprtybw(<4 x i32>
786 // CHECK-BE-NEXT: ret <4 x i32>
787 // CHECK: @llvm.ppc.altivec.vprtybw(<4 x i32>
788 // CHECK-NEXT: ret <4 x i32>
789   return vec_parity_lsbb (vuia);
790 }
test64(void)791 vector unsigned int test64(void) {
792 // CHECK-BE: @llvm.ppc.altivec.vprtybw(<4 x i32>
793 // CHECK-BE-NEXT: ret <4 x i32>
794 // CHECK: @llvm.ppc.altivec.vprtybw(<4 x i32>
795 // CHECK-NEXT: ret <4 x i32>
796   return vec_parity_lsbb (vsia);
797 }
test65(void)798 vector unsigned long long test65(void) {
799 // CHECK-BE: @llvm.ppc.altivec.vprtybd(<2 x i64>
800 // CHECK-BE-NEXT: ret <2 x i64>
801 // CHECK: @llvm.ppc.altivec.vprtybd(<2 x i64>
802 // CHECK-NEXT: ret <2 x i64>
803   return vec_parity_lsbb (vula);
804 }
test66(void)805 vector unsigned long long test66(void) {
806 // CHECK-BE: @llvm.ppc.altivec.vprtybd(<2 x i64>
807 // CHECK-BE-NEXT: ret <2 x i64>
808 // CHECK: @llvm.ppc.altivec.vprtybd(<2 x i64>
809 // CHECK-NEXT: ret <2 x i64>
810   return vec_parity_lsbb (vsla);
811 }
test67(void)812 vector unsigned __int128 test67(void) {
813 // CHECK-BE: @llvm.ppc.altivec.vprtybq(<1 x i128>
814 // CHECK-BE-NEXT: ret <1 x i128>
815 // CHECK: @llvm.ppc.altivec.vprtybq(<1 x i128>
816 // CHECK-NEXT: ret <1 x i128>
817   return vec_parity_lsbb (vui128a);
818 }
test68(void)819 vector unsigned __int128 test68(void) {
820 // CHECK-BE: @llvm.ppc.altivec.vprtybq(<1 x i128>
821 // CHECK-BE-NEXT: ret <1 x i128>
822 // CHECK: @llvm.ppc.altivec.vprtybq(<1 x i128>
823 // CHECK-NEXT: ret <1 x i128>
824   return vec_parity_lsbb (vsi128a);
825 }
test69(void)826 vector unsigned char test69(void) {
827 // CHECK-BE: call <16 x i8> @llvm.ppc.altivec.vabsdub(<16 x i8> {{.+}}, <16 x i8> {{.+}})
828 // CHECK: call <16 x i8> @llvm.ppc.altivec.vabsdub(<16 x i8> {{.+}}, <16 x i8> {{.+}})
829   return vec_absd(vuca, vucb);
830 }
test70(void)831 vector unsigned short test70(void) {
832 // CHECK-BE: call <8 x i16> @llvm.ppc.altivec.vabsduh(<8 x i16> {{.+}}, <8 x i16> {{.+}})
833 // CHECK: call <8 x i16> @llvm.ppc.altivec.vabsduh(<8 x i16> {{.+}}, <8 x i16> {{.+}})
834   return vec_absd(vusa, vusb);
835 }
test71(void)836 vector unsigned int test71(void) {
837 // CHECK-BE: call <4 x i32> @llvm.ppc.altivec.vabsduw(<4 x i32> {{.+}}, <4 x i32> {{.+}})
838 // CHECK: call <4 x i32> @llvm.ppc.altivec.vabsduw(<4 x i32> {{.+}}, <4 x i32> {{.+}})
839   return vec_absd(vuia, vuib);
840 }
test72(void)841 vector unsigned char test72(void) {
842 // CHECK-BE: @llvm.ppc.altivec.vslv(<16 x i8>
843 // CHECK-BE-NEXT: ret <16 x i8>
844 // CHECK: @llvm.ppc.altivec.vslv(<16 x i8>
845 // CHECK-NEXT: ret <16 x i8>
846   return vec_slv (vuca, vucb);
847 }
test73(void)848 vector unsigned char test73(void) {
849 // CHECK-BE: @llvm.ppc.altivec.vsrv(<16 x i8>
850 // CHECK-BE-NEXT: ret <16 x i8>
851 // CHECK: @llvm.ppc.altivec.vsrv(<16 x i8>
852 // CHECK-NEXT: ret <16 x i8>
853   return vec_srv (vuca, vucb);
854 }
test74(void)855 vector unsigned short test74(void) {
856 // CHECK-BE: @llvm.ppc.vsx.xvcvsphp(<4 x float>
857 // CHECK-BE: @llvm.ppc.vsx.xvcvsphp(<4 x float>
858 // CHECK-BE: @llvm.ppc.altivec.vperm
859 // CHECK: @llvm.ppc.vsx.xvcvsphp(<4 x float>
860 // CHECK: @llvm.ppc.vsx.xvcvsphp(<4 x float>
861 // CHECK: @llvm.ppc.altivec.vperm
862   return vec_pack_to_short_fp32(vfa, vfb);
863 }
test75(void)864 vector unsigned int test75(void) {
865 // CHECK-BE: @llvm.ppc.altivec.vrlwmi(<4 x i32
866 // CHECK-BE-NEXT: ret <4 x i32>
867 // CHECK: @llvm.ppc.altivec.vrlwmi(<4 x i32
868 // CHECK-NEXT: ret <4 x i32>
869   return vec_rlmi(vuia, vuia, vuia);
870 }
test76(void)871 vector unsigned long long test76(void) {
872 // CHECK-BE: @llvm.ppc.altivec.vrldmi(<2 x i64
873 // CHECK-BE-NEXT: ret <2 x i64>
874 // CHECK: @llvm.ppc.altivec.vrldmi(<2 x i64
875 // CHECK-NEXT: ret <2 x i64>
876   return vec_rlmi(vula, vula, vula);
877 }
test77(void)878 vector unsigned int test77(void) {
879 // CHECK-BE: %[[RES1:.+]] = shl <4 x i32
880 // CHECK-BE: %[[RES2:.+]] = or <4 x i32> %[[RES1]]
881 // CHECK-BE: @llvm.ppc.altivec.vrlwnm(<4 x i32
882 // CHECK-BE: ret <4 x i32>
883 // CHECK: %[[RES1:.+]] = shl <4 x i32
884 // CHECK: %[[RES2:.+]] = or <4 x i32> %[[RES1]]
885 // CHECK: @llvm.ppc.altivec.vrlwnm(<4 x i32
886 // CHECK: ret <4 x i32>
887   return vec_rlnm(vuia, vuia, vuia);
888 }
test78(void)889 vector unsigned long long test78(void) {
890 // CHECK-BE: %[[RES1:.+]] = shl <2 x i64
891 // CHECK-BE: %[[RES2:.+]] = or <2 x i64> %[[RES1]]
892 // CHECK-BE: @llvm.ppc.altivec.vrldnm(<2 x i64
893 // CHECK-BE-NEXT: ret <2 x i64>
894 // CHECK: %[[RES1:.+]] = shl <2 x i64
895 // CHECK: %[[RES2:.+]] = or <2 x i64> %[[RES1]]
896 // CHECK: @llvm.ppc.altivec.vrldnm(<2 x i64
897 // CHECK-NEXT: ret <2 x i64>
898   return vec_rlnm(vula, vula, vula);
899 }
test79(void)900 vector double test79(void) {
901 // CHECK-BE: extractelement <4 x float>
902 // CHECK-BE: fpext float
903 // CHECK-BE: insertelement <2 x double>
904 // CHECK-BE: extractelement <4 x float>
905 // CHECK-BE: fpext float
906 // CHECK-BE: insertelement <2 x double>
907 // CHECK: extractelement <4 x float>
908 // CHECK: fpext float
909 // CHECK: insertelement <2 x double>
910 // CHECK: extractelement <4 x float>
911 // CHECK: fpext float
912 // CHECK: insertelement <2 x double>
913   return vec_unpackh(vfa);
914 }
test80(void)915 vector double test80(void) {
916 // CHECK-BE: extractelement <4 x float>
917 // CHECK-BE: fpext float
918 // CHECK-BE: insertelement <2 x double>
919 // CHECK-BE: extractelement <4 x float>
920 // CHECK-BE: fpext float
921 // CHECK-BE: insertelement <2 x double>
922 // CHECK: extractelement <4 x float>
923 // CHECK: fpext float
924 // CHECK: insertelement <2 x double>
925 // CHECK: extractelement <4 x float>
926 // CHECK: fpext float
927 // CHECK: insertelement <2 x double>
928   return vec_unpackl(vfa);
929 }
test81(void)930 vector float test81(void) {
931   // CHECK: extractelement <2 x double>
932   // CHECK: fptrunc double
933   // CHECK: insertelement <4 x float>
934   // CHECK: extractelement <2 x double>
935   // CHECK: fptrunc double
936   // CHECK: insertelement <4 x float>
937   // CHECK: extractelement <2 x double>
938   // CHECK: fptrunc double
939   // CHECK: insertelement <4 x float>
940   // CHECK: extractelement <2 x double>
941   // CHECK: fptrunc double
942   // CHECK: insertelement <4 x float>
943   // CHECK-LE: extractelement <2 x double>
944   // CHECK-LE: fptrunc double
945   // CHECK-LE: insertelement <4 x float>
946   // CHECK-LE: extractelement <2 x double>
947   // CHECK-LE: fptrunc double
948   // CHECK-LE: insertelement <4 x float>
949   // CHECK-LE: extractelement <2 x double>
950   // CHECK-LE: fptrunc double
951   // CHECK-LE: insertelement <4 x float>
952   // CHECK-LE: extractelement <2 x double>
953   // CHECK-LE: fptrunc double
954   // CHECK-LE: insertelement <4 x float>
955   return vec_pack(vda, vdb);
956 }
test82(void)957 vector unsigned int test82(void) {
958 // CHECK-BE: @llvm.ppc.vsx.xvxexpsp(<4 x float> {{.+}})
959 // CHECK-BE-NEXT: ret <4 x i32>
960 // CHECK: @llvm.ppc.vsx.xvxexpsp(<4 x float> {{.+}})
961 // CHECK-NEXT: ret <4 x i32>
962   return vec_extract_exp(vfa);
963 }
test83(void)964 vector unsigned long long test83(void) {
965 // CHECK-BE: @llvm.ppc.vsx.xvxexpdp(<2 x double> {{.+}})
966 // CHECK-BE-NEXT: ret <2 x i64>
967 // CHECK: @llvm.ppc.vsx.xvxexpdp(<2 x double> {{.+}})
968 // CHECK-NEXT: ret <2 x i64>
969   return vec_extract_exp(vda);
970 }
test84(void)971 vector unsigned int test84(void) {
972 // CHECK-BE: @llvm.ppc.vsx.xvxsigsp(<4 x float> {{.+}})
973 // CHECK-BE-NEXT: ret <4 x i32>
974 // CHECK: @llvm.ppc.vsx.xvxsigsp(<4 x float> {{.+}})
975 // CHECK-NEXT: ret <4 x i32>
976   return vec_extract_sig(vfa);
977 }
test85(void)978 vector unsigned long long test85(void) {
979 // CHECK-BE: @llvm.ppc.vsx.xvxsigdp(<2 x double> {{.+}})
980 // CHECK-BE-NEXT: ret <2 x i64>
981 // CHECK: @llvm.ppc.vsx.xvxsigdp(<2 x double> {{.+}})
982 // CHECK-NEXT: ret <2 x i64>
983   return vec_extract_sig(vda);
984 }
test86(void)985 vector bool int test86(void) {
986 // CHECK-BE: @llvm.ppc.vsx.xvtstdcsp(<4 x float> {{.+}}, i32 127)
987 // CHECK-BE-NEXT: ret <4 x i32>
988 // CHECK: @llvm.ppc.vsx.xvtstdcsp(<4 x float> {{.+}}, i32 127)
989 // CHECK-NEXT: ret <4 x i32>
990    return vec_test_data_class(vfa, __VEC_CLASS_FP_NOT_NORMAL);
991 }
test87(void)992 vector bool long long test87(void) {
993 // CHECK-BE: @llvm.ppc.vsx.xvtstdcdp(<2 x double> {{.+}}, i32 127)
994 // CHECK-BE-NEXT: ret <2 x i64>
995 // CHECK: @llvm.ppc.vsx.xvtstdcdp(<2 x double> {{.+}}, i32 127)
996 // CHECK-NEXT: ret <2 x i64>
997   return vec_test_data_class(vda, __VEC_CLASS_FP_NOT_NORMAL);
998 }
test88(void)999 vector unsigned char test88(void) {
1000 // CHECK-BE: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1001 // CHECK-BE-NEXT-NEXT: ret <16 x i8>
1002 // CHECK: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1003 // CHECK-NEXT-NEXT: ret <16 x i8>
1004   return vec_xl_len(uc,0);
1005 }
test89(void)1006 vector signed char test89(void) {
1007 // CHECK-BE: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1008 // CHECK-BE-NEXT-NEXT: ret <16 x i8>
1009 // CHECK: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1010 // CHECK-NEXT-NEXT: ret <16 x i8>
1011   return vec_xl_len(sc,0);
1012 }
test90(void)1013 vector unsigned short test90(void) {
1014 // CHECK-BE: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1015 // CHECK-BE-NEXT-NEXT: ret <8 x i16>
1016 // CHECK: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1017 // CHECK-NEXT-NEXT: ret <8 x i16>
1018   return vec_xl_len(us,0);
1019 }
test91(void)1020 vector signed short test91(void) {
1021 // CHECK-BE: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1022 // CHECK-BE-NEXT-NEXT: ret <8 x i16>
1023 // CHECK: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1024 // CHECK-NEXT-NEXT: ret <8 x i16>
1025   return vec_xl_len(ss,0);
1026 }
test92(void)1027 vector unsigned int test92(void) {
1028 // CHECK-BE: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1029 // CHECK-BE-NEXT: ret <4 x i32>
1030 // CHECK: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1031 // CHECK-NEXT: ret <4 x i32>
1032   return vec_xl_len(ui,0);
1033 }
1034 
test93(void)1035 vector signed int test93(void) {
1036 // CHECK-BE: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1037 // CHECK-BE-NEXT: ret <4 x i32>
1038 // CHECK: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1039 // CHECK-NEXT: ret <4 x i32>
1040   return vec_xl_len(si,0);
1041 }
1042 
test94(void)1043 vector float test94(void) {
1044 // CHECK-BE: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1045 // CHECK-BE-NEXT-NEXT: ret <4 x i32>
1046 // CHECK: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1047 // CHECK-NEXT-NEXT: ret <4 x i32>
1048   return vec_xl_len(f,0);
1049 }
1050 
test95(void)1051 vector unsigned long long test95(void) {
1052 // CHECK-BE: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1053 // CHECK-BE-NEXT-NEXT: ret <2 x i64>
1054 // CHECK: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1055 // CHECK-NEXT-NEXT: ret <2 x i64>
1056   return vec_xl_len(ull,0);
1057 }
1058 
test96(void)1059 vector signed long long test96(void) {
1060 // CHECK-BE: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1061 // CHECK-BE-NEXT-NEXT: ret <2 x i64>
1062 // CHECK: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1063 // CHECK-NEXT-NEXT: ret <2 x i64>
1064   return vec_xl_len(sll,0);
1065 }
1066 
test97(void)1067 vector double test97(void) {
1068 // CHECK-BE: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1069 // CHECK-BE-NEXT-NEXT: ret <2 x i64>
1070 // CHECK: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1071 // CHECK-NEXT-NEXT: ret <2 x i64>
1072   return vec_xl_len(d,0);
1073 }
1074 
test98(void)1075 vector unsigned __int128 test98(void) {
1076 // CHECK-BE: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1077 // CHECK-BE-NEXT-NEXT: ret <1 x i128>
1078 // CHECK: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1079 // CHECK-NEXT-NEXT: ret <1 x i128>
1080   return vec_xl_len(uint128,0);
1081 }
1082 
test99(void)1083 vector signed __int128 test99(void) {
1084 // CHECK-BE: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1085 // CHECK-BE-NEXT-NEXT: ret <1 x i128>
1086 // CHECK: @llvm.ppc.vsx.lxvl(i8* %{{.+}}, i64
1087 // CHECK-NEXT-NEXT: ret <1 x i128>
1088   return vec_xl_len(sint128,0);
1089 }
1090 
test100(void)1091 void test100(void) {
1092 // CHECK-BE: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1093 // CHECK: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1094   return vec_xst_len(vuca,uc,0);
1095 }
1096 
test101(void)1097 void test101(void) {
1098 // CHECK-BE: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1099 // CHECK: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1100   return vec_xst_len(vsca,sc,0);
1101 }
1102 
test102(void)1103 void test102(void) {
1104 // CHECK-BE: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1105 // CHECK: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1106  return vec_xst_len(vusa,us,0);
1107 }
1108 
test103(void)1109 void test103(void) {
1110 // CHECK-BE: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1111 // CHECK: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1112  return vec_xst_len(vssa,ss,0);
1113 }
1114 
test104(void)1115 void test104(void) {
1116 // CHECK-BE: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1117 // CHECK: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1118  return vec_xst_len(vuia,ui,0);
1119 }
1120 
test105(void)1121 void test105(void) {
1122 // CHECK-BE: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1123 // CHECK: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1124  return vec_xst_len(vsia,si,0);
1125 }
1126 
test106(void)1127 void test106(void) {
1128 // CHECK-BE: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1129 // CHECK: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1130  return vec_xst_len(vfa,f,0);
1131 }
1132 
test107(void)1133 void test107(void) {
1134 // CHECK-BE: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1135 // CHECK: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1136  return vec_xst_len(vula,ull,0);
1137 }
1138 
test108(void)1139 void test108(void) {
1140 // CHECK-BE: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1141 // CHECK: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1142  return vec_xst_len(vsla,sll,0);
1143 }
1144 
test109(void)1145 void test109(void) {
1146 // CHECK-BE: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1147 // CHECK: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1148  return vec_xst_len(vda,d,0);
1149 }
1150 
test110(void)1151 void test110(void) {
1152 // CHECK-BE: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1153 // CHECK: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1154  return vec_xst_len(vui128a,uint128,0);
1155 }
1156 
test111(void)1157 void test111(void) {
1158 // CHECK-BE: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1159 // CHECK: @llvm.ppc.vsx.stxvl(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1160  return vec_xst_len(vsi128a,sint128,0);
1161 }
1162 
test112(void)1163 vector unsigned char test112(void) {
1164 // CHECK-BE: @llvm.ppc.vsx.lxvll(i8* %{{.+}}, i64
1165 // CHECK: @llvm.ppc.vsx.lxvll(i8* %{{.+}}, i64
1166 // CHECK: @llvm.ppc.altivec.lvsr(i8* %{{.+}}
1167 // CHECK: @llvm.ppc.altivec.vperm
1168   return vec_xl_len_r(uc,0);
1169 }
test113(void)1170 void test113(void) {
1171 // CHECK-BE: @llvm.ppc.vsx.stxvll(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1172 // CHECK: @llvm.ppc.altivec.lvsl(i8* %{{.+}}
1173 // CHECK: @llvm.ppc.altivec.vperm
1174 // CHECK: @llvm.ppc.vsx.stxvll(<4 x i32> %{{.+}}, i8* %{{.+}}, i64
1175   return vec_xst_len_r(vuca,uc,0);
1176 }
test114(void)1177 vector float test114(void) {
1178 // CHECK-BE: shufflevector <8 x i16> {{.+}}, <8 x i16> {{.+}}, <8 x i32> <i32 undef, i32 0, i32 undef, i32 1, i32 undef, i32 2, i32 undef, i32 3>
1179 // CHECK-BE: @llvm.ppc.vsx.xvcvhpsp(<8 x i16> {{.+}})
1180 // CHECK-BE-NEXT: ret <4 x float>
1181 // CHECK: shufflevector <8 x i16> {{.+}}, <8 x i16> {{.+}}, <8 x i32> <i32 0, i32 undef, i32 1, i32 undef, i32 2, i32 undef, i32 3, i32 undef>
1182 // CHECK: @llvm.ppc.vsx.xvcvhpsp(<8 x i16> {{.+}})
1183 // CHECK-NEXT: ret <4 x float>
1184   return vec_extract_fp32_from_shorth(vusa);
1185 }
test115(void)1186 vector float test115(void) {
1187 // CHECK-BE: shufflevector <8 x i16> {{.+}}, <8 x i16> {{.+}}, <8 x i32> <i32 undef, i32 4, i32 undef, i32 5, i32 undef, i32 6, i32 undef, i32 7>
1188 // CHECK-BE: @llvm.ppc.vsx.xvcvhpsp(<8 x i16> {{.+}})
1189 // CHECK-BE-NEXT: ret <4 x float>
1190 // CHECK: shufflevector <8 x i16> {{.+}}, <8 x i16> {{.+}}, <8 x i32> <i32 4, i32 undef, i32 5, i32 undef, i32 6, i32 undef, i32 7, i32 undef>
1191 // CHECK: @llvm.ppc.vsx.xvcvhpsp(<8 x i16> {{.+}})
1192 // CHECK-NEXT: ret <4 x float>
1193   return vec_extract_fp32_from_shortl(vusa);
1194 }
test116(void)1195 vector unsigned char test116(void) {
1196 // CHECK-BE: [[T1:%.+]] = call <4 x i32> @llvm.ppc.vsx.xxinsertw(<4 x i32> {{.+}}, <2 x i64> {{.+}}, i32 7)
1197 // CHECK-BE-NEXT: bitcast <4 x i32> [[T1]] to <16 x i8>
1198 // CHECK: [[T1:%.+]] = shufflevector <2 x i64> {{.+}}, <2 x i64> {{.+}}, <2 x i32> <i32 1, i32 0>
1199 // CHECK-NEXT: [[T2:%.+]] =  bitcast <2 x i64> [[T1]] to <4 x i32>
1200 // CHECK-NEXT: [[T3:%.+]] = call <4 x i32> @llvm.ppc.vsx.xxinsertw(<4 x i32> [[T2]], <2 x i64> {{.+}}, i32 5)
1201 // CHECK-NEXT: bitcast <4 x i32> [[T3]] to <16 x i8>
1202   return vec_insert4b(vuia, vuca, 7);
1203 }
test117(void)1204 vector unsigned char test117(void) {
1205 // CHECK-BE: [[T1:%.+]] = call <4 x i32> @llvm.ppc.vsx.xxinsertw(<4 x i32> {{.+}}, <2 x i64> {{.+}}, i32 12)
1206 // CHECK-BE-NEXT: bitcast <4 x i32> [[T1]] to <16 x i8>
1207 // CHECK: [[T1:%.+]] = shufflevector <2 x i64> {{.+}}, <2 x i64> {{.+}}, <2 x i32> <i32 1, i32 0>
1208 // CHECK-NEXT: [[T2:%.+]] =  bitcast <2 x i64> [[T1]] to <4 x i32>
1209 // CHECK-NEXT: [[T3:%.+]] = call <4 x i32> @llvm.ppc.vsx.xxinsertw(<4 x i32> [[T2]], <2 x i64> {{.+}}, i32 0)
1210 // CHECK-NEXT: bitcast <4 x i32> [[T3]] to <16 x i8>
1211   return vec_insert4b(vuia, vuca, 13);
1212 }
test118(void)1213 vector unsigned long long test118(void) {
1214 // CHECK-BE: call <2 x i64> @llvm.ppc.vsx.xxextractuw(<2 x i64> {{.+}}, i32 11)
1215 // CHECK-BE-NEXT: ret <2 x i64>
1216 // CHECK: [[T1:%.+]] = call <2 x i64> @llvm.ppc.vsx.xxextractuw(<2 x i64> {{.+}}, i32 1)
1217 // CHECK-NEXT: shufflevector <2 x i64> [[T1]], <2 x i64> [[T1]], <2 x i32> <i32 1, i32 0>
1218 // CHECK-NEXT: ret <2 x i64>
1219   return vec_extract4b(vuca, 11);
1220 }
test119(void)1221 vector unsigned long long test119(void) {
1222 // CHECK-BE: call <2 x i64> @llvm.ppc.vsx.xxextractuw(<2 x i64> {{.+}}, i32 0)
1223 // CHECK-BE-NEXT: ret <2 x i64>
1224 // CHECK: [[T1:%.+]] = call <2 x i64> @llvm.ppc.vsx.xxextractuw(<2 x i64> {{.+}}, i32 12)
1225 // CHECK-NEXT: shufflevector <2 x i64> [[T1]], <2 x i64> [[T1]], <2 x i32> <i32 1, i32 0>
1226 // CHECK-NEXT: ret <2 x i64>
1227   return vec_extract4b(vuca, -5);
1228 }
1229 
test_vec_signexti_si_sc(void)1230 vector signed int test_vec_signexti_si_sc(void) {
1231     // CHECK: @llvm.ppc.altivec.vextsb2w(<16 x i8>
1232     // CHECK-NEXT: ret <4 x i32>
1233     return vec_signexti(vsca);
1234 }
1235 
test_vec_signexti_si_ss(void)1236 vector signed int test_vec_signexti_si_ss(void) {
1237     // CHECK: @llvm.ppc.altivec.vextsh2w(<8 x i16>
1238     // CHECK-NEXT: ret <4 x i32>
1239     return vec_signexti(vssa);
1240 }
1241 
test_vec_signextll_sll_sc(void)1242 vector signed long long test_vec_signextll_sll_sc(void) {
1243     // CHECK: @llvm.ppc.altivec.vextsb2d(<16 x i8>
1244     // CHECK-NEXT: ret <2 x i64>
1245     return vec_signextll(vsca);
1246 }
1247 
test_vec_signextll_sll_ss(void)1248 vector signed long long test_vec_signextll_sll_ss(void) {
1249     // CHECK: @llvm.ppc.altivec.vextsh2d(<8 x i16>
1250     // CHECK-NEXT: ret <2 x i64>
1251     return vec_signextll(vssa);
1252 }
1253 
test_vec_signextll_sll_si(void)1254 vector signed long long test_vec_signextll_sll_si(void) {
1255     // CHECK: @llvm.ppc.altivec.vextsw2d(<4 x i32>
1256     // CHECK-NEXT: ret <2 x i64>
1257     return vec_signextll(vsia);
1258 }
1259