1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple powerpc64-unknown-linux-gnu -verify-machineinstrs < %s | FileCheck %s
3 ; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -verify-machineinstrs -vec-extabi < %s | FileCheck %s
5 define <16 x i8> @test_l_v16i8(ptr %p) #0 {
6 ; CHECK-LABEL: test_l_v16i8:
7 ; CHECK: # %bb.0: # %entry
9 ; CHECK-NEXT: lvsl 3, 0, 3
10 ; CHECK-NEXT: lvx 2, 3, 4
11 ; CHECK-NEXT: lvx 4, 0, 3
12 ; CHECK-NEXT: vperm 2, 4, 2, 3
15 %r = load <16 x i8>, ptr %p, align 1
20 define <32 x i8> @test_l_v32i8(ptr %p) #0 {
21 ; CHECK-LABEL: test_l_v32i8:
22 ; CHECK: # %bb.0: # %entry
23 ; CHECK-NEXT: li 4, 31
24 ; CHECK-NEXT: lvsl 5, 0, 3
25 ; CHECK-NEXT: lvx 2, 3, 4
26 ; CHECK-NEXT: li 4, 16
27 ; CHECK-NEXT: lvx 4, 3, 4
28 ; CHECK-NEXT: lvx 0, 0, 3
29 ; CHECK-NEXT: vperm 3, 4, 2, 5
30 ; CHECK-NEXT: vperm 2, 0, 4, 5
33 %r = load <32 x i8>, ptr %p, align 1
38 define <8 x i16> @test_l_v8i16(ptr %p) #0 {
39 ; CHECK-LABEL: test_l_v8i16:
40 ; CHECK: # %bb.0: # %entry
41 ; CHECK-NEXT: li 4, 15
42 ; CHECK-NEXT: lvsl 3, 0, 3
43 ; CHECK-NEXT: lvx 2, 3, 4
44 ; CHECK-NEXT: lvx 4, 0, 3
45 ; CHECK-NEXT: vperm 2, 4, 2, 3
48 %r = load <8 x i16>, ptr %p, align 2
53 define <16 x i16> @test_l_v16i16(ptr %p) #0 {
54 ; CHECK-LABEL: test_l_v16i16:
55 ; CHECK: # %bb.0: # %entry
56 ; CHECK-NEXT: li 4, 31
57 ; CHECK-NEXT: lvsl 5, 0, 3
58 ; CHECK-NEXT: lvx 2, 3, 4
59 ; CHECK-NEXT: li 4, 16
60 ; CHECK-NEXT: lvx 4, 3, 4
61 ; CHECK-NEXT: lvx 0, 0, 3
62 ; CHECK-NEXT: vperm 3, 4, 2, 5
63 ; CHECK-NEXT: vperm 2, 0, 4, 5
66 %r = load <16 x i16>, ptr %p, align 2
71 define <4 x i32> @test_l_v4i32(ptr %p) #0 {
72 ; CHECK-LABEL: test_l_v4i32:
73 ; CHECK: # %bb.0: # %entry
74 ; CHECK-NEXT: li 4, 15
75 ; CHECK-NEXT: lvsl 3, 0, 3
76 ; CHECK-NEXT: lvx 2, 3, 4
77 ; CHECK-NEXT: lvx 4, 0, 3
78 ; CHECK-NEXT: vperm 2, 4, 2, 3
81 %r = load <4 x i32>, ptr %p, align 4
86 define <8 x i32> @test_l_v8i32(ptr %p) #0 {
87 ; CHECK-LABEL: test_l_v8i32:
88 ; CHECK: # %bb.0: # %entry
89 ; CHECK-NEXT: li 4, 31
90 ; CHECK-NEXT: lvsl 5, 0, 3
91 ; CHECK-NEXT: lvx 2, 3, 4
92 ; CHECK-NEXT: li 4, 16
93 ; CHECK-NEXT: lvx 4, 3, 4
94 ; CHECK-NEXT: lvx 0, 0, 3
95 ; CHECK-NEXT: vperm 3, 4, 2, 5
96 ; CHECK-NEXT: vperm 2, 0, 4, 5
99 %r = load <8 x i32>, ptr %p, align 4
104 define <2 x i64> @test_l_v2i64(ptr %p) #0 {
105 ; CHECK-LABEL: test_l_v2i64:
106 ; CHECK: # %bb.0: # %entry
107 ; CHECK-NEXT: lxvd2x 34, 0, 3
110 %r = load <2 x i64>, ptr %p, align 8
115 define <4 x i64> @test_l_v4i64(ptr %p) #0 {
116 ; CHECK-LABEL: test_l_v4i64:
117 ; CHECK: # %bb.0: # %entry
118 ; CHECK-NEXT: li 4, 16
119 ; CHECK-NEXT: lxvd2x 34, 0, 3
120 ; CHECK-NEXT: lxvd2x 35, 3, 4
123 %r = load <4 x i64>, ptr %p, align 8
128 define <4 x float> @test_l_v4float(ptr %p) #0 {
129 ; CHECK-LABEL: test_l_v4float:
130 ; CHECK: # %bb.0: # %entry
131 ; CHECK-NEXT: li 4, 15
132 ; CHECK-NEXT: lvsl 3, 0, 3
133 ; CHECK-NEXT: lvx 2, 3, 4
134 ; CHECK-NEXT: lvx 4, 0, 3
135 ; CHECK-NEXT: vperm 2, 4, 2, 3
138 %r = load <4 x float>, ptr %p, align 4
143 define <8 x float> @test_l_v8float(ptr %p) #0 {
144 ; CHECK-LABEL: test_l_v8float:
145 ; CHECK: # %bb.0: # %entry
146 ; CHECK-NEXT: li 4, 31
147 ; CHECK-NEXT: lvsl 5, 0, 3
148 ; CHECK-NEXT: lvx 2, 3, 4
149 ; CHECK-NEXT: li 4, 16
150 ; CHECK-NEXT: lvx 4, 3, 4
151 ; CHECK-NEXT: lvx 0, 0, 3
152 ; CHECK-NEXT: vperm 3, 4, 2, 5
153 ; CHECK-NEXT: vperm 2, 0, 4, 5
156 %r = load <8 x float>, ptr %p, align 4
161 define <2 x double> @test_l_v2double(ptr %p) #0 {
162 ; CHECK-LABEL: test_l_v2double:
163 ; CHECK: # %bb.0: # %entry
164 ; CHECK-NEXT: lxvd2x 34, 0, 3
167 %r = load <2 x double>, ptr %p, align 8
172 define <4 x double> @test_l_v4double(ptr %p) #0 {
173 ; CHECK-LABEL: test_l_v4double:
174 ; CHECK: # %bb.0: # %entry
175 ; CHECK-NEXT: li 4, 16
176 ; CHECK-NEXT: lxvd2x 34, 0, 3
177 ; CHECK-NEXT: lxvd2x 35, 3, 4
180 %r = load <4 x double>, ptr %p, align 8
185 define <16 x i8> @test_l_p8v16i8(ptr %p) #2 {
186 ; CHECK-LABEL: test_l_p8v16i8:
187 ; CHECK: # %bb.0: # %entry
188 ; CHECK-NEXT: lxvw4x 34, 0, 3
191 %r = load <16 x i8>, ptr %p, align 1
196 define <32 x i8> @test_l_p8v32i8(ptr %p) #2 {
197 ; CHECK-LABEL: test_l_p8v32i8:
198 ; CHECK: # %bb.0: # %entry
199 ; CHECK-NEXT: li 4, 16
200 ; CHECK-NEXT: lxvw4x 34, 0, 3
201 ; CHECK-NEXT: lxvw4x 35, 3, 4
204 %r = load <32 x i8>, ptr %p, align 1
209 define <8 x i16> @test_l_p8v8i16(ptr %p) #2 {
210 ; CHECK-LABEL: test_l_p8v8i16:
211 ; CHECK: # %bb.0: # %entry
212 ; CHECK-NEXT: lxvw4x 34, 0, 3
215 %r = load <8 x i16>, ptr %p, align 2
220 define <16 x i16> @test_l_p8v16i16(ptr %p) #2 {
221 ; CHECK-LABEL: test_l_p8v16i16:
222 ; CHECK: # %bb.0: # %entry
223 ; CHECK-NEXT: li 4, 16
224 ; CHECK-NEXT: lxvw4x 34, 0, 3
225 ; CHECK-NEXT: lxvw4x 35, 3, 4
228 %r = load <16 x i16>, ptr %p, align 2
233 define <4 x i32> @test_l_p8v4i32(ptr %p) #2 {
234 ; CHECK-LABEL: test_l_p8v4i32:
235 ; CHECK: # %bb.0: # %entry
236 ; CHECK-NEXT: lxvw4x 34, 0, 3
239 %r = load <4 x i32>, ptr %p, align 4
244 define <8 x i32> @test_l_p8v8i32(ptr %p) #2 {
245 ; CHECK-LABEL: test_l_p8v8i32:
246 ; CHECK: # %bb.0: # %entry
247 ; CHECK-NEXT: li 4, 16
248 ; CHECK-NEXT: lxvw4x 34, 0, 3
249 ; CHECK-NEXT: lxvw4x 35, 3, 4
252 %r = load <8 x i32>, ptr %p, align 4
257 define <2 x i64> @test_l_p8v2i64(ptr %p) #2 {
258 ; CHECK-LABEL: test_l_p8v2i64:
259 ; CHECK: # %bb.0: # %entry
260 ; CHECK-NEXT: lxvd2x 34, 0, 3
263 %r = load <2 x i64>, ptr %p, align 8
268 define <4 x i64> @test_l_p8v4i64(ptr %p) #2 {
269 ; CHECK-LABEL: test_l_p8v4i64:
270 ; CHECK: # %bb.0: # %entry
271 ; CHECK-NEXT: li 4, 16
272 ; CHECK-NEXT: lxvd2x 34, 0, 3
273 ; CHECK-NEXT: lxvd2x 35, 3, 4
276 %r = load <4 x i64>, ptr %p, align 8
281 define <4 x float> @test_l_p8v4float(ptr %p) #2 {
282 ; CHECK-LABEL: test_l_p8v4float:
283 ; CHECK: # %bb.0: # %entry
284 ; CHECK-NEXT: lxvw4x 34, 0, 3
287 %r = load <4 x float>, ptr %p, align 4
292 define <8 x float> @test_l_p8v8float(ptr %p) #2 {
293 ; CHECK-LABEL: test_l_p8v8float:
294 ; CHECK: # %bb.0: # %entry
295 ; CHECK-NEXT: li 4, 16
296 ; CHECK-NEXT: lxvw4x 34, 0, 3
297 ; CHECK-NEXT: lxvw4x 35, 3, 4
300 %r = load <8 x float>, ptr %p, align 4
305 define <2 x double> @test_l_p8v2double(ptr %p) #2 {
306 ; CHECK-LABEL: test_l_p8v2double:
307 ; CHECK: # %bb.0: # %entry
308 ; CHECK-NEXT: lxvd2x 34, 0, 3
311 %r = load <2 x double>, ptr %p, align 8
316 define <4 x double> @test_l_p8v4double(ptr %p) #2 {
317 ; CHECK-LABEL: test_l_p8v4double:
318 ; CHECK: # %bb.0: # %entry
319 ; CHECK-NEXT: li 4, 16
320 ; CHECK-NEXT: lxvd2x 34, 0, 3
321 ; CHECK-NEXT: lxvd2x 35, 3, 4
324 %r = load <4 x double>, ptr %p, align 8
329 define void @test_s_v16i8(ptr %p, <16 x i8> %v) #0 {
330 ; CHECK-LABEL: test_s_v16i8:
331 ; CHECK: # %bb.0: # %entry
332 ; CHECK-NEXT: stxvw4x 34, 0, 3
335 store <16 x i8> %v, ptr %p, align 1
340 define void @test_s_v32i8(ptr %p, <32 x i8> %v) #0 {
341 ; CHECK-LABEL: test_s_v32i8:
342 ; CHECK: # %bb.0: # %entry
343 ; CHECK-NEXT: li 4, 16
344 ; CHECK-NEXT: stxvw4x 34, 0, 3
345 ; CHECK-NEXT: stxvw4x 35, 3, 4
348 store <32 x i8> %v, ptr %p, align 1
353 define void @test_s_v8i16(ptr %p, <8 x i16> %v) #0 {
354 ; CHECK-LABEL: test_s_v8i16:
355 ; CHECK: # %bb.0: # %entry
356 ; CHECK-NEXT: stxvw4x 34, 0, 3
359 store <8 x i16> %v, ptr %p, align 2
364 define void @test_s_v16i16(ptr %p, <16 x i16> %v) #0 {
365 ; CHECK-LABEL: test_s_v16i16:
366 ; CHECK: # %bb.0: # %entry
367 ; CHECK-NEXT: li 4, 16
368 ; CHECK-NEXT: stxvw4x 34, 0, 3
369 ; CHECK-NEXT: stxvw4x 35, 3, 4
372 store <16 x i16> %v, ptr %p, align 2
377 define void @test_s_v4i32(ptr %p, <4 x i32> %v) #0 {
378 ; CHECK-LABEL: test_s_v4i32:
379 ; CHECK: # %bb.0: # %entry
380 ; CHECK-NEXT: stxvw4x 34, 0, 3
383 store <4 x i32> %v, ptr %p, align 4
388 define void @test_s_v8i32(ptr %p, <8 x i32> %v) #0 {
389 ; CHECK-LABEL: test_s_v8i32:
390 ; CHECK: # %bb.0: # %entry
391 ; CHECK-NEXT: li 4, 16
392 ; CHECK-NEXT: stxvw4x 34, 0, 3
393 ; CHECK-NEXT: stxvw4x 35, 3, 4
396 store <8 x i32> %v, ptr %p, align 4
401 define void @test_s_v2i64(ptr %p, <2 x i64> %v) #0 {
402 ; CHECK-LABEL: test_s_v2i64:
403 ; CHECK: # %bb.0: # %entry
404 ; CHECK-NEXT: stxvd2x 34, 0, 3
407 store <2 x i64> %v, ptr %p, align 8
412 define void @test_s_v4i64(ptr %p, <4 x i64> %v) #0 {
413 ; CHECK-LABEL: test_s_v4i64:
414 ; CHECK: # %bb.0: # %entry
415 ; CHECK-NEXT: li 4, 16
416 ; CHECK-NEXT: stxvd2x 34, 0, 3
417 ; CHECK-NEXT: stxvd2x 35, 3, 4
420 store <4 x i64> %v, ptr %p, align 8
425 define void @test_s_v4float(ptr %p, <4 x float> %v) #0 {
426 ; CHECK-LABEL: test_s_v4float:
427 ; CHECK: # %bb.0: # %entry
428 ; CHECK-NEXT: stxvw4x 34, 0, 3
431 store <4 x float> %v, ptr %p, align 4
436 define void @test_s_v8float(ptr %p, <8 x float> %v) #0 {
437 ; CHECK-LABEL: test_s_v8float:
438 ; CHECK: # %bb.0: # %entry
439 ; CHECK-NEXT: li 4, 16
440 ; CHECK-NEXT: stxvw4x 34, 0, 3
441 ; CHECK-NEXT: stxvw4x 35, 3, 4
444 store <8 x float> %v, ptr %p, align 4
449 define void @test_s_v2double(ptr %p, <2 x double> %v) #0 {
450 ; CHECK-LABEL: test_s_v2double:
451 ; CHECK: # %bb.0: # %entry
452 ; CHECK-NEXT: stxvd2x 34, 0, 3
455 store <2 x double> %v, ptr %p, align 8
460 define void @test_s_v4double(ptr %p, <4 x double> %v) #0 {
461 ; CHECK-LABEL: test_s_v4double:
462 ; CHECK: # %bb.0: # %entry
463 ; CHECK-NEXT: li 4, 16
464 ; CHECK-NEXT: stxvd2x 34, 0, 3
465 ; CHECK-NEXT: stxvd2x 35, 3, 4
468 store <4 x double> %v, ptr %p, align 8
473 attributes #0 = { nounwind "target-cpu"="pwr7" }
474 attributes #2 = { nounwind "target-cpu"="pwr8" }