1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
3 ; RUN: -mcpu=pwr8 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
4 ; RUN: FileCheck %s --check-prefix=CHECK-P8
5 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
6 ; RUN: -mcpu=pwr9 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
7 ; RUN: FileCheck %s --check-prefix=CHECK-P9
8 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \
9 ; RUN: -mcpu=pwr9 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
10 ; RUN: FileCheck %s --check-prefix=CHECK-P9-BE
11 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
12 ; RUN: -mcpu=pwr8 -mattr=-vsx -ppc-asm-full-reg-names \
13 ; RUN: -ppc-vsr-nums-as-vr < %s | FileCheck %s --check-prefix=CHECK-NOVSX
14 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
15 ; RUN: -mcpu=pwr7 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
16 ; RUN: FileCheck %s --check-prefix=CHECK-P7
18 define dso_local <16 x i8> @testmrghb(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
19 ; CHECK-P8-LABEL: testmrghb:
20 ; CHECK-P8: # %bb.0: # %entry
21 ; CHECK-P8-NEXT: vmrghb v2, v3, v2
24 ; CHECK-P9-LABEL: testmrghb:
25 ; CHECK-P9: # %bb.0: # %entry
26 ; CHECK-P9-NEXT: vmrghb v2, v3, v2
29 ; CHECK-P9-BE-LABEL: testmrghb:
30 ; CHECK-P9-BE: # %bb.0: # %entry
31 ; CHECK-P9-BE-NEXT: vmrglb v2, v2, v3
32 ; CHECK-P9-BE-NEXT: blr
34 ; CHECK-NOVSX-LABEL: testmrghb:
35 ; CHECK-NOVSX: # %bb.0: # %entry
36 ; CHECK-NOVSX-NEXT: vmrghb v2, v3, v2
37 ; CHECK-NOVSX-NEXT: blr
39 ; CHECK-P7-LABEL: testmrghb:
40 ; CHECK-P7: # %bb.0: # %entry
41 ; CHECK-P7-NEXT: vmrghb v2, v3, v2
44 %shuffle = shufflevector <16 x i8> %a, <16 x i8> %b, <16 x i32> <i32 8, i32 24, i32 9, i32 25, i32 10, i32 26, i32 11, i32 27, i32 12, i32 28, i32 13, i32 29, i32 14, i32 30, i32 15, i32 31>
45 ret <16 x i8> %shuffle
47 define dso_local <16 x i8> @testmrghb2(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
48 ; CHECK-P8-LABEL: testmrghb2:
49 ; CHECK-P8: # %bb.0: # %entry
50 ; CHECK-P8-NEXT: vmrghb v2, v2, v3
53 ; CHECK-P9-LABEL: testmrghb2:
54 ; CHECK-P9: # %bb.0: # %entry
55 ; CHECK-P9-NEXT: vmrghb v2, v2, v3
58 ; CHECK-P9-BE-LABEL: testmrghb2:
59 ; CHECK-P9-BE: # %bb.0: # %entry
60 ; CHECK-P9-BE-NEXT: vmrglb v2, v3, v2
61 ; CHECK-P9-BE-NEXT: blr
63 ; CHECK-NOVSX-LABEL: testmrghb2:
64 ; CHECK-NOVSX: # %bb.0: # %entry
65 ; CHECK-NOVSX-NEXT: addis r3, r2, .LCPI1_0@toc@ha
66 ; CHECK-NOVSX-NEXT: addi r3, r3, .LCPI1_0@toc@l
67 ; CHECK-NOVSX-NEXT: lvx v4, 0, r3
68 ; CHECK-NOVSX-NEXT: vperm v2, v3, v2, v4
69 ; CHECK-NOVSX-NEXT: blr
71 ; CHECK-P7-LABEL: testmrghb2:
72 ; CHECK-P7: # %bb.0: # %entry
73 ; CHECK-P7-NEXT: addis r3, r2, .LCPI1_0@toc@ha
74 ; CHECK-P7-NEXT: addi r3, r3, .LCPI1_0@toc@l
75 ; CHECK-P7-NEXT: lvx v4, 0, r3
76 ; CHECK-P7-NEXT: vperm v2, v3, v2, v4
79 %shuffle = shufflevector <16 x i8> %a, <16 x i8> %b, <16 x i32> <i32 24, i32 8, i32 25, i32 9, i32 26, i32 10, i32 27, i32 11, i32 28, i32 12, i32 29, i32 13, i32 30, i32 14, i32 31, i32 15>
80 ret <16 x i8> %shuffle
82 define dso_local <16 x i8> @testmrghh(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
83 ; CHECK-P8-LABEL: testmrghh:
84 ; CHECK-P8: # %bb.0: # %entry
85 ; CHECK-P8-NEXT: vmrghh v2, v3, v2
88 ; CHECK-P9-LABEL: testmrghh:
89 ; CHECK-P9: # %bb.0: # %entry
90 ; CHECK-P9-NEXT: vmrghh v2, v3, v2
93 ; CHECK-P9-BE-LABEL: testmrghh:
94 ; CHECK-P9-BE: # %bb.0: # %entry
95 ; CHECK-P9-BE-NEXT: vmrglh v2, v2, v3
96 ; CHECK-P9-BE-NEXT: blr
98 ; CHECK-NOVSX-LABEL: testmrghh:
99 ; CHECK-NOVSX: # %bb.0: # %entry
100 ; CHECK-NOVSX-NEXT: vmrghh v2, v3, v2
101 ; CHECK-NOVSX-NEXT: blr
103 ; CHECK-P7-LABEL: testmrghh:
104 ; CHECK-P7: # %bb.0: # %entry
105 ; CHECK-P7-NEXT: vmrghh v2, v3, v2
108 %shuffle = shufflevector <16 x i8> %a, <16 x i8> %b, <16 x i32> <i32 8, i32 9, i32 24, i32 25, i32 10, i32 11, i32 26, i32 27, i32 12, i32 13, i32 28, i32 29, i32 14, i32 15, i32 30, i32 31>
109 ret <16 x i8> %shuffle
111 define dso_local <16 x i8> @testmrghh2(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
112 ; CHECK-P8-LABEL: testmrghh2:
113 ; CHECK-P8: # %bb.0: # %entry
114 ; CHECK-P8-NEXT: vmrghh v2, v2, v3
117 ; CHECK-P9-LABEL: testmrghh2:
118 ; CHECK-P9: # %bb.0: # %entry
119 ; CHECK-P9-NEXT: vmrghh v2, v2, v3
122 ; CHECK-P9-BE-LABEL: testmrghh2:
123 ; CHECK-P9-BE: # %bb.0: # %entry
124 ; CHECK-P9-BE-NEXT: vmrglh v2, v3, v2
125 ; CHECK-P9-BE-NEXT: blr
127 ; CHECK-NOVSX-LABEL: testmrghh2:
128 ; CHECK-NOVSX: # %bb.0: # %entry
129 ; CHECK-NOVSX-NEXT: addis r3, r2, .LCPI3_0@toc@ha
130 ; CHECK-NOVSX-NEXT: addi r3, r3, .LCPI3_0@toc@l
131 ; CHECK-NOVSX-NEXT: lvx v4, 0, r3
132 ; CHECK-NOVSX-NEXT: vperm v2, v3, v2, v4
133 ; CHECK-NOVSX-NEXT: blr
135 ; CHECK-P7-LABEL: testmrghh2:
136 ; CHECK-P7: # %bb.0: # %entry
137 ; CHECK-P7-NEXT: addis r3, r2, .LCPI3_0@toc@ha
138 ; CHECK-P7-NEXT: addi r3, r3, .LCPI3_0@toc@l
139 ; CHECK-P7-NEXT: lvx v4, 0, r3
140 ; CHECK-P7-NEXT: vperm v2, v3, v2, v4
143 %shuffle = shufflevector <16 x i8> %a, <16 x i8> %b, <16 x i32> <i32 24, i32 25, i32 8, i32 9, i32 26, i32 27, i32 10, i32 11, i32 28, i32 29, i32 12, i32 13, i32 30, i32 31, i32 14, i32 15>
144 ret <16 x i8> %shuffle
146 define dso_local <16 x i8> @testmrglb(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
147 ; CHECK-P8-LABEL: testmrglb:
148 ; CHECK-P8: # %bb.0: # %entry
149 ; CHECK-P8-NEXT: vmrglb v2, v3, v2
152 ; CHECK-P9-LABEL: testmrglb:
153 ; CHECK-P9: # %bb.0: # %entry
154 ; CHECK-P9-NEXT: vmrglb v2, v3, v2
157 ; CHECK-P9-BE-LABEL: testmrglb:
158 ; CHECK-P9-BE: # %bb.0: # %entry
159 ; CHECK-P9-BE-NEXT: vmrghb v2, v2, v3
160 ; CHECK-P9-BE-NEXT: blr
162 ; CHECK-NOVSX-LABEL: testmrglb:
163 ; CHECK-NOVSX: # %bb.0: # %entry
164 ; CHECK-NOVSX-NEXT: vmrglb v2, v3, v2
165 ; CHECK-NOVSX-NEXT: blr
167 ; CHECK-P7-LABEL: testmrglb:
168 ; CHECK-P7: # %bb.0: # %entry
169 ; CHECK-P7-NEXT: vmrglb v2, v3, v2
172 %shuffle = shufflevector <16 x i8> %a, <16 x i8> %b, <16 x i32> <i32 0, i32 16, i32 1, i32 17, i32 2, i32 18, i32 3, i32 19, i32 4, i32 20, i32 5, i32 21, i32 6, i32 22, i32 7, i32 23>
173 ret <16 x i8> %shuffle
175 define dso_local <16 x i8> @testmrglb2(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
176 ; CHECK-P8-LABEL: testmrglb2:
177 ; CHECK-P8: # %bb.0: # %entry
178 ; CHECK-P8-NEXT: vmrglb v2, v2, v3
181 ; CHECK-P9-LABEL: testmrglb2:
182 ; CHECK-P9: # %bb.0: # %entry
183 ; CHECK-P9-NEXT: vmrglb v2, v2, v3
186 ; CHECK-P9-BE-LABEL: testmrglb2:
187 ; CHECK-P9-BE: # %bb.0: # %entry
188 ; CHECK-P9-BE-NEXT: vmrghb v2, v3, v2
189 ; CHECK-P9-BE-NEXT: blr
191 ; CHECK-NOVSX-LABEL: testmrglb2:
192 ; CHECK-NOVSX: # %bb.0: # %entry
193 ; CHECK-NOVSX-NEXT: addis r3, r2, .LCPI5_0@toc@ha
194 ; CHECK-NOVSX-NEXT: addi r3, r3, .LCPI5_0@toc@l
195 ; CHECK-NOVSX-NEXT: lvx v4, 0, r3
196 ; CHECK-NOVSX-NEXT: vperm v2, v3, v2, v4
197 ; CHECK-NOVSX-NEXT: blr
199 ; CHECK-P7-LABEL: testmrglb2:
200 ; CHECK-P7: # %bb.0: # %entry
201 ; CHECK-P7-NEXT: addis r3, r2, .LCPI5_0@toc@ha
202 ; CHECK-P7-NEXT: addi r3, r3, .LCPI5_0@toc@l
203 ; CHECK-P7-NEXT: lvx v4, 0, r3
204 ; CHECK-P7-NEXT: vperm v2, v3, v2, v4
207 %shuffle = shufflevector <16 x i8> %a, <16 x i8> %b, <16 x i32> <i32 16, i32 0, i32 17, i32 1, i32 18, i32 2, i32 19, i32 3, i32 20, i32 4, i32 21, i32 5, i32 22, i32 6, i32 23, i32 7>
208 ret <16 x i8> %shuffle
210 define dso_local <16 x i8> @testmrglh(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
211 ; CHECK-P8-LABEL: testmrglh:
212 ; CHECK-P8: # %bb.0: # %entry
213 ; CHECK-P8-NEXT: vmrglh v2, v3, v2
216 ; CHECK-P9-LABEL: testmrglh:
217 ; CHECK-P9: # %bb.0: # %entry
218 ; CHECK-P9-NEXT: vmrglh v2, v3, v2
221 ; CHECK-P9-BE-LABEL: testmrglh:
222 ; CHECK-P9-BE: # %bb.0: # %entry
223 ; CHECK-P9-BE-NEXT: vmrghh v2, v2, v3
224 ; CHECK-P9-BE-NEXT: blr
226 ; CHECK-NOVSX-LABEL: testmrglh:
227 ; CHECK-NOVSX: # %bb.0: # %entry
228 ; CHECK-NOVSX-NEXT: vmrglh v2, v3, v2
229 ; CHECK-NOVSX-NEXT: blr
231 ; CHECK-P7-LABEL: testmrglh:
232 ; CHECK-P7: # %bb.0: # %entry
233 ; CHECK-P7-NEXT: vmrglh v2, v3, v2
236 %shuffle = shufflevector <16 x i8> %a, <16 x i8> %b, <16 x i32> <i32 0, i32 1, i32 16, i32 17, i32 2, i32 3, i32 18, i32 19, i32 4, i32 5, i32 20, i32 21, i32 6, i32 7, i32 22, i32 23>
237 ret <16 x i8> %shuffle
239 define dso_local <16 x i8> @testmrglh2(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
240 ; CHECK-P8-LABEL: testmrglh2:
241 ; CHECK-P8: # %bb.0: # %entry
242 ; CHECK-P8-NEXT: vmrglh v2, v2, v3
245 ; CHECK-P9-LABEL: testmrglh2:
246 ; CHECK-P9: # %bb.0: # %entry
247 ; CHECK-P9-NEXT: vmrglh v2, v2, v3
250 ; CHECK-P9-BE-LABEL: testmrglh2:
251 ; CHECK-P9-BE: # %bb.0: # %entry
252 ; CHECK-P9-BE-NEXT: vmrghh v2, v3, v2
253 ; CHECK-P9-BE-NEXT: blr
255 ; CHECK-NOVSX-LABEL: testmrglh2:
256 ; CHECK-NOVSX: # %bb.0: # %entry
257 ; CHECK-NOVSX-NEXT: addis r3, r2, .LCPI7_0@toc@ha
258 ; CHECK-NOVSX-NEXT: addi r3, r3, .LCPI7_0@toc@l
259 ; CHECK-NOVSX-NEXT: lvx v4, 0, r3
260 ; CHECK-NOVSX-NEXT: vperm v2, v3, v2, v4
261 ; CHECK-NOVSX-NEXT: blr
263 ; CHECK-P7-LABEL: testmrglh2:
264 ; CHECK-P7: # %bb.0: # %entry
265 ; CHECK-P7-NEXT: addis r3, r2, .LCPI7_0@toc@ha
266 ; CHECK-P7-NEXT: addi r3, r3, .LCPI7_0@toc@l
267 ; CHECK-P7-NEXT: lvx v4, 0, r3
268 ; CHECK-P7-NEXT: vperm v2, v3, v2, v4
271 %shuffle = shufflevector <16 x i8> %a, <16 x i8> %b, <16 x i32> <i32 16, i32 17, i32 0, i32 1, i32 18, i32 19, i32 2, i32 3, i32 20, i32 21, i32 4, i32 5, i32 22, i32 23, i32 6, i32 7>
272 ret <16 x i8> %shuffle
274 define dso_local <16 x i8> @testmrghw(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
275 ; CHECK-P8-LABEL: testmrghw:
276 ; CHECK-P8: # %bb.0: # %entry
277 ; CHECK-P8-NEXT: vmrghw v2, v3, v2
280 ; CHECK-P9-LABEL: testmrghw:
281 ; CHECK-P9: # %bb.0: # %entry
282 ; CHECK-P9-NEXT: vmrghw v2, v3, v2
285 ; CHECK-P9-BE-LABEL: testmrghw:
286 ; CHECK-P9-BE: # %bb.0: # %entry
287 ; CHECK-P9-BE-NEXT: vmrglw v2, v2, v3
288 ; CHECK-P9-BE-NEXT: blr
290 ; CHECK-NOVSX-LABEL: testmrghw:
291 ; CHECK-NOVSX: # %bb.0: # %entry
292 ; CHECK-NOVSX-NEXT: vmrghw v2, v3, v2
293 ; CHECK-NOVSX-NEXT: blr
295 ; CHECK-P7-LABEL: testmrghw:
296 ; CHECK-P7: # %bb.0: # %entry
297 ; CHECK-P7-NEXT: vmrghw v2, v3, v2
300 %shuffle = shufflevector <16 x i8> %a, <16 x i8> %b, <16 x i32> <i32 8, i32 9, i32 10, i32 11, i32 24, i32 25, i32 26, i32 27, i32 12, i32 13, i32 14, i32 15, i32 28, i32 29, i32 30, i32 31>
301 ret <16 x i8> %shuffle
303 define dso_local <16 x i8> @testmrghw2(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
304 ; CHECK-P8-LABEL: testmrghw2:
305 ; CHECK-P8: # %bb.0: # %entry
306 ; CHECK-P8-NEXT: vmrghw v2, v2, v3
309 ; CHECK-P9-LABEL: testmrghw2:
310 ; CHECK-P9: # %bb.0: # %entry
311 ; CHECK-P9-NEXT: vmrghw v2, v2, v3
314 ; CHECK-P9-BE-LABEL: testmrghw2:
315 ; CHECK-P9-BE: # %bb.0: # %entry
316 ; CHECK-P9-BE-NEXT: vmrglw v2, v3, v2
317 ; CHECK-P9-BE-NEXT: blr
319 ; CHECK-NOVSX-LABEL: testmrghw2:
320 ; CHECK-NOVSX: # %bb.0: # %entry
321 ; CHECK-NOVSX-NEXT: addis r3, r2, .LCPI9_0@toc@ha
322 ; CHECK-NOVSX-NEXT: addi r3, r3, .LCPI9_0@toc@l
323 ; CHECK-NOVSX-NEXT: lvx v4, 0, r3
324 ; CHECK-NOVSX-NEXT: vperm v2, v3, v2, v4
325 ; CHECK-NOVSX-NEXT: blr
327 ; CHECK-P7-LABEL: testmrghw2:
328 ; CHECK-P7: # %bb.0: # %entry
329 ; CHECK-P7-NEXT: addis r3, r2, .LCPI9_0@toc@ha
330 ; CHECK-P7-NEXT: addi r3, r3, .LCPI9_0@toc@l
331 ; CHECK-P7-NEXT: lvx v4, 0, r3
332 ; CHECK-P7-NEXT: vperm v2, v3, v2, v4
335 %shuffle = shufflevector <16 x i8> %a, <16 x i8> %b, <16 x i32> <i32 24, i32 25, i32 26, i32 27, i32 8, i32 9, i32 10, i32 11, i32 28, i32 29, i32 30, i32 31, i32 12, i32 13, i32 14, i32 15>
336 ret <16 x i8> %shuffle
338 define dso_local <16 x i8> @testmrglw(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
339 ; CHECK-P8-LABEL: testmrglw:
340 ; CHECK-P8: # %bb.0: # %entry
341 ; CHECK-P8-NEXT: vmrglw v2, v3, v2
344 ; CHECK-P9-LABEL: testmrglw:
345 ; CHECK-P9: # %bb.0: # %entry
346 ; CHECK-P9-NEXT: vmrglw v2, v3, v2
349 ; CHECK-P9-BE-LABEL: testmrglw:
350 ; CHECK-P9-BE: # %bb.0: # %entry
351 ; CHECK-P9-BE-NEXT: vmrghw v2, v2, v3
352 ; CHECK-P9-BE-NEXT: blr
354 ; CHECK-NOVSX-LABEL: testmrglw:
355 ; CHECK-NOVSX: # %bb.0: # %entry
356 ; CHECK-NOVSX-NEXT: vmrglw v2, v3, v2
357 ; CHECK-NOVSX-NEXT: blr
359 ; CHECK-P7-LABEL: testmrglw:
360 ; CHECK-P7: # %bb.0: # %entry
361 ; CHECK-P7-NEXT: vmrglw v2, v3, v2
364 %shuffle = shufflevector <16 x i8> %a, <16 x i8> %b, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 16, i32 17, i32 18, i32 19, i32 4, i32 5, i32 6, i32 7, i32 20, i32 21, i32 22, i32 23>
365 ret <16 x i8> %shuffle
367 define dso_local <16 x i8> @testmrglw2(<16 x i8> %a, <16 x i8> %b) local_unnamed_addr #0 {
368 ; CHECK-P8-LABEL: testmrglw2:
369 ; CHECK-P8: # %bb.0: # %entry
370 ; CHECK-P8-NEXT: vmrglw v2, v2, v3
373 ; CHECK-P9-LABEL: testmrglw2:
374 ; CHECK-P9: # %bb.0: # %entry
375 ; CHECK-P9-NEXT: vmrglw v2, v2, v3
378 ; CHECK-P9-BE-LABEL: testmrglw2:
379 ; CHECK-P9-BE: # %bb.0: # %entry
380 ; CHECK-P9-BE-NEXT: vmrghw v2, v3, v2
381 ; CHECK-P9-BE-NEXT: blr
383 ; CHECK-NOVSX-LABEL: testmrglw2:
384 ; CHECK-NOVSX: # %bb.0: # %entry
385 ; CHECK-NOVSX-NEXT: addis r3, r2, .LCPI11_0@toc@ha
386 ; CHECK-NOVSX-NEXT: addi r3, r3, .LCPI11_0@toc@l
387 ; CHECK-NOVSX-NEXT: lvx v4, 0, r3
388 ; CHECK-NOVSX-NEXT: vperm v2, v3, v2, v4
389 ; CHECK-NOVSX-NEXT: blr
391 ; CHECK-P7-LABEL: testmrglw2:
392 ; CHECK-P7: # %bb.0: # %entry
393 ; CHECK-P7-NEXT: addis r3, r2, .LCPI11_0@toc@ha
394 ; CHECK-P7-NEXT: addi r3, r3, .LCPI11_0@toc@l
395 ; CHECK-P7-NEXT: lvx v4, 0, r3
396 ; CHECK-P7-NEXT: vperm v2, v3, v2, v4
399 %shuffle = shufflevector <16 x i8> %a, <16 x i8> %b, <16 x i32> <i32 16, i32 17, i32 18, i32 19, i32 0, i32 1, i32 2, i32 3, i32 20, i32 21, i32 22, i32 23, i32 4, i32 5, i32 6, i32 7>
400 ret <16 x i8> %shuffle
403 define dso_local <8 x i16> @testmrglb3(<8 x i8>* nocapture readonly %a) local_unnamed_addr #0 {
404 ; CHECK-P8-LABEL: testmrglb3:
405 ; CHECK-P8: # %bb.0: # %entry
406 ; CHECK-P8-NEXT: lxsdx v2, 0, r3
407 ; CHECK-P8-NEXT: xxlxor v3, v3, v3
408 ; CHECK-P8-NEXT: vmrghb v2, v3, v2
411 ; CHECK-P9-LABEL: testmrglb3:
412 ; CHECK-P9: # %bb.0: # %entry
413 ; CHECK-P9-NEXT: lxsd v2, 0(r3)
414 ; CHECK-P9-NEXT: xxlxor v3, v3, v3
415 ; CHECK-P9-NEXT: vmrghb v2, v3, v2
418 ; CHECK-P9-BE-LABEL: testmrglb3:
419 ; CHECK-P9-BE: # %bb.0: # %entry
420 ; CHECK-P9-BE-NEXT: lxsd v2, 0(r3)
421 ; CHECK-P9-BE-NEXT: addis r3, r2, .LCPI12_0@toc@ha
422 ; CHECK-P9-BE-NEXT: xxlxor v4, v4, v4
423 ; CHECK-P9-BE-NEXT: addi r3, r3, .LCPI12_0@toc@l
424 ; CHECK-P9-BE-NEXT: lxv v3, 0(r3)
425 ; CHECK-P9-BE-NEXT: vperm v2, v4, v2, v3
426 ; CHECK-P9-BE-NEXT: blr
428 ; CHECK-NOVSX-LABEL: testmrglb3:
429 ; CHECK-NOVSX: # %bb.0: # %entry
430 ; CHECK-NOVSX-NEXT: vxor v2, v2, v2
431 ; CHECK-NOVSX-NEXT: ld r3, 0(r3)
432 ; CHECK-NOVSX-NEXT: addis r4, r2, .LCPI12_0@toc@ha
433 ; CHECK-NOVSX-NEXT: addi r4, r4, .LCPI12_0@toc@l
434 ; CHECK-NOVSX-NEXT: lvx v3, 0, r4
435 ; CHECK-NOVSX-NEXT: std r3, -16(r1)
436 ; CHECK-NOVSX-NEXT: addi r3, r1, -16
437 ; CHECK-NOVSX-NEXT: lvx v4, 0, r3
438 ; CHECK-NOVSX-NEXT: vperm v2, v4, v2, v3
439 ; CHECK-NOVSX-NEXT: blr
441 ; CHECK-P7-LABEL: testmrglb3:
442 ; CHECK-P7: # %bb.0: # %entry
443 ; CHECK-P7-NEXT: ld r3, 0(r3)
444 ; CHECK-P7-NEXT: addi r4, r1, -16
445 ; CHECK-P7-NEXT: xxlxor v4, v4, v4
446 ; CHECK-P7-NEXT: std r3, -16(r1)
447 ; CHECK-P7-NEXT: addis r3, r2, .LCPI12_0@toc@ha
448 ; CHECK-P7-NEXT: lxvd2x vs0, 0, r4
449 ; CHECK-P7-NEXT: addi r3, r3, .LCPI12_0@toc@l
450 ; CHECK-P7-NEXT: lvx v3, 0, r3
451 ; CHECK-P7-NEXT: xxswapd v2, vs0
452 ; CHECK-P7-NEXT: vperm v2, v2, v4, v3
455 %0 = load <8 x i8>, <8 x i8>* %a, align 8
456 %1 = zext <8 x i8> %0 to <8 x i16>
460 define dso_local void @no_crash_elt0_from_RHS(<2 x double>* noalias nocapture dereferenceable(16) %.vtx6) #0 {
461 ; CHECK-P8-LABEL: no_crash_elt0_from_RHS:
462 ; CHECK-P8: # %bb.0: # %test_entry
463 ; CHECK-P8-NEXT: mflr r0
464 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
465 ; CHECK-P8-NEXT: std r0, 16(r1)
466 ; CHECK-P8-NEXT: stdu r1, -48(r1)
467 ; CHECK-P8-NEXT: mr r30, r3
468 ; CHECK-P8-NEXT: bl dummy
470 ; CHECK-P8-NEXT: xxlxor f0, f0, f0
471 ; CHECK-P8-NEXT: # kill: def $f1 killed $f1 def $vsl1
472 ; CHECK-P8-NEXT: xxmrghd vs0, vs1, vs0
473 ; CHECK-P8-NEXT: xxswapd vs0, vs0
474 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
476 ; CHECK-P9-LABEL: no_crash_elt0_from_RHS:
477 ; CHECK-P9: # %bb.0: # %test_entry
478 ; CHECK-P9-NEXT: mflr r0
479 ; CHECK-P9-NEXT: std r30, -16(r1) # 8-byte Folded Spill
480 ; CHECK-P9-NEXT: std r0, 16(r1)
481 ; CHECK-P9-NEXT: stdu r1, -48(r1)
482 ; CHECK-P9-NEXT: mr r30, r3
483 ; CHECK-P9-NEXT: bl dummy
485 ; CHECK-P9-NEXT: xxlxor f0, f0, f0
486 ; CHECK-P9-NEXT: # kill: def $f1 killed $f1 def $vsl1
487 ; CHECK-P9-NEXT: xxmrghd vs0, vs1, vs0
488 ; CHECK-P9-NEXT: stxv vs0, 0(r30)
490 ; CHECK-P9-BE-LABEL: no_crash_elt0_from_RHS:
491 ; CHECK-P9-BE: # %bb.0: # %test_entry
492 ; CHECK-P9-BE-NEXT: mflr r0
493 ; CHECK-P9-BE-NEXT: std r0, 16(r1)
494 ; CHECK-P9-BE-NEXT: stdu r1, -128(r1)
495 ; CHECK-P9-BE-NEXT: std r30, 112(r1) # 8-byte Folded Spill
496 ; CHECK-P9-BE-NEXT: mr r30, r3
497 ; CHECK-P9-BE-NEXT: bl dummy
498 ; CHECK-P9-BE-NEXT: nop
499 ; CHECK-P9-BE-NEXT: xxlxor f0, f0, f0
500 ; CHECK-P9-BE-NEXT: # kill: def $f1 killed $f1 def $vsl1
501 ; CHECK-P9-BE-NEXT: xxmrghd vs0, vs0, vs1
502 ; CHECK-P9-BE-NEXT: stxv vs0, 0(r30)
504 ; CHECK-NOVSX-LABEL: no_crash_elt0_from_RHS:
505 ; CHECK-NOVSX: # %bb.0: # %test_entry
506 ; CHECK-NOVSX-NEXT: mflr r0
507 ; CHECK-NOVSX-NEXT: std r30, -16(r1) # 8-byte Folded Spill
508 ; CHECK-NOVSX-NEXT: std r0, 16(r1)
509 ; CHECK-NOVSX-NEXT: stdu r1, -48(r1)
510 ; CHECK-NOVSX-NEXT: mr r30, r3
511 ; CHECK-NOVSX-NEXT: bl dummy
512 ; CHECK-NOVSX-NEXT: nop
513 ; CHECK-NOVSX-NEXT: li r3, 0
514 ; CHECK-NOVSX-NEXT: stfd f1, 8(r30)
515 ; CHECK-NOVSX-NEXT: std r3, 0(r30)
517 ; CHECK-P7-LABEL: no_crash_elt0_from_RHS:
518 ; CHECK-P7: # %bb.0: # %test_entry
519 ; CHECK-P7-NEXT: mflr r0
520 ; CHECK-P7-NEXT: std r30, -16(r1) # 8-byte Folded Spill
521 ; CHECK-P7-NEXT: std r0, 16(r1)
522 ; CHECK-P7-NEXT: stdu r1, -48(r1)
523 ; CHECK-P7-NEXT: mr r30, r3
524 ; CHECK-P7-NEXT: bl dummy
526 ; CHECK-P7-NEXT: xxlxor f0, f0, f0
527 ; CHECK-P7-NEXT: # kill: def $f1 killed $f1 def $vsl1
528 ; CHECK-P7-NEXT: xxmrghd vs0, vs1, vs0
529 ; CHECK-P7-NEXT: xxswapd vs0, vs0
530 ; CHECK-P7-NEXT: stxvd2x vs0, 0, r30
532 %_div_result = tail call double @dummy()
533 %oldret = insertvalue { double, double } undef, double %_div_result, 0
534 %0 = extractvalue { double, double } %oldret, 0
535 %.splatinsert = insertelement <2 x double> undef, double %0, i32 0
536 %.splat = shufflevector <2 x double> %.splatinsert, <2 x double> undef, <2 x i32> zeroinitializer
537 %1 = shufflevector <2 x double> zeroinitializer, <2 x double> %.splat, <2 x i32> <i32 0, i32 3>
538 store <2 x double> %1, <2 x double>* %.vtx6, align 16
542 define dso_local <16 x i8> @no_crash_bitcast(i32 %a) {
543 ; CHECK-P8-LABEL: no_crash_bitcast:
544 ; CHECK-P8: # %bb.0: # %entry
545 ; CHECK-P8-NEXT: mtvsrwz v2, r3
548 ; CHECK-P9-LABEL: no_crash_bitcast:
549 ; CHECK-P9: # %bb.0: # %entry
550 ; CHECK-P9-NEXT: mtvsrwz v2, r3
553 ; CHECK-P9-BE-LABEL: no_crash_bitcast:
554 ; CHECK-P9-BE: # %bb.0: # %entry
555 ; CHECK-P9-BE-NEXT: mtvsrwz v2, r3
556 ; CHECK-P9-BE-NEXT: vmrghw v2, v2, v2
557 ; CHECK-P9-BE-NEXT: blr
559 ; CHECK-NOVSX-LABEL: no_crash_bitcast:
560 ; CHECK-NOVSX: # %bb.0: # %entry
561 ; CHECK-NOVSX-NEXT: addis r4, r2, .LCPI14_0@toc@ha
562 ; CHECK-NOVSX-NEXT: stw r3, -16(r1)
563 ; CHECK-NOVSX-NEXT: addi r3, r1, -16
564 ; CHECK-NOVSX-NEXT: addi r4, r4, .LCPI14_0@toc@l
565 ; CHECK-NOVSX-NEXT: lvx v3, 0, r3
566 ; CHECK-NOVSX-NEXT: lvx v2, 0, r4
567 ; CHECK-NOVSX-NEXT: vperm v2, v3, v3, v2
568 ; CHECK-NOVSX-NEXT: blr
570 ; CHECK-P7-LABEL: no_crash_bitcast:
571 ; CHECK-P7: # %bb.0: # %entry
572 ; CHECK-P7-NEXT: addis r4, r2, .LCPI14_0@toc@ha
573 ; CHECK-P7-NEXT: stw r3, -16(r1)
574 ; CHECK-P7-NEXT: addi r3, r1, -16
575 ; CHECK-P7-NEXT: addi r4, r4, .LCPI14_0@toc@l
576 ; CHECK-P7-NEXT: lvx v3, 0, r3
577 ; CHECK-P7-NEXT: lvx v2, 0, r4
578 ; CHECK-P7-NEXT: vperm v2, v3, v3, v2
581 %cast = bitcast i32 %a to <4 x i8>
582 %ret = shufflevector <4 x i8> %cast, <4 x i8> undef, <16 x i32> <i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef>
586 define dso_local <4 x i32> @replace_undefs_in_splat(<4 x i32> %a) local_unnamed_addr #0 {
587 ; CHECK-P8-LABEL: replace_undefs_in_splat:
588 ; CHECK-P8: # %bb.0: # %entry
589 ; CHECK-P8-NEXT: addis r3, r2, .LCPI15_0@toc@ha
590 ; CHECK-P8-NEXT: addi r3, r3, .LCPI15_0@toc@l
591 ; CHECK-P8-NEXT: lvx v3, 0, r3
592 ; CHECK-P8-NEXT: vmrgow v2, v3, v2
595 ; CHECK-P9-LABEL: replace_undefs_in_splat:
596 ; CHECK-P9: # %bb.0: # %entry
597 ; CHECK-P9-NEXT: addis r3, r2, .LCPI15_0@toc@ha
598 ; CHECK-P9-NEXT: addi r3, r3, .LCPI15_0@toc@l
599 ; CHECK-P9-NEXT: lxv v3, 0(r3)
600 ; CHECK-P9-NEXT: vmrgow v2, v3, v2
603 ; CHECK-P9-BE-LABEL: replace_undefs_in_splat:
604 ; CHECK-P9-BE: # %bb.0: # %entry
605 ; CHECK-P9-BE-NEXT: addis r3, r2, .LCPI15_0@toc@ha
606 ; CHECK-P9-BE-NEXT: addi r3, r3, .LCPI15_0@toc@l
607 ; CHECK-P9-BE-NEXT: lxv v3, 0(r3)
608 ; CHECK-P9-BE-NEXT: addis r3, r2, .LCPI15_1@toc@ha
609 ; CHECK-P9-BE-NEXT: addi r3, r3, .LCPI15_1@toc@l
610 ; CHECK-P9-BE-NEXT: lxv v4, 0(r3)
611 ; CHECK-P9-BE-NEXT: vperm v2, v2, v4, v3
612 ; CHECK-P9-BE-NEXT: blr
614 ; CHECK-NOVSX-LABEL: replace_undefs_in_splat:
615 ; CHECK-NOVSX: # %bb.0: # %entry
616 ; CHECK-NOVSX-NEXT: addis r3, r2, .LCPI15_0@toc@ha
617 ; CHECK-NOVSX-NEXT: addis r4, r2, .LCPI15_1@toc@ha
618 ; CHECK-NOVSX-NEXT: addi r3, r3, .LCPI15_0@toc@l
619 ; CHECK-NOVSX-NEXT: lvx v3, 0, r3
620 ; CHECK-NOVSX-NEXT: addi r3, r4, .LCPI15_1@toc@l
621 ; CHECK-NOVSX-NEXT: lvx v4, 0, r3
622 ; CHECK-NOVSX-NEXT: vperm v2, v4, v2, v3
623 ; CHECK-NOVSX-NEXT: blr
625 ; CHECK-P7-LABEL: replace_undefs_in_splat:
626 ; CHECK-P7: # %bb.0: # %entry
627 ; CHECK-P7-NEXT: addis r3, r2, .LCPI15_0@toc@ha
628 ; CHECK-P7-NEXT: addis r4, r2, .LCPI15_1@toc@ha
629 ; CHECK-P7-NEXT: addi r3, r3, .LCPI15_0@toc@l
630 ; CHECK-P7-NEXT: lvx v3, 0, r3
631 ; CHECK-P7-NEXT: addi r3, r4, .LCPI15_1@toc@l
632 ; CHECK-P7-NEXT: lvx v4, 0, r3
633 ; CHECK-P7-NEXT: vperm v2, v4, v2, v3
636 %vecins1 = shufflevector <4 x i32> %a, <4 x i32> <i32 undef, i32 566, i32 undef, i32 566>, <4 x i32> <i32 0, i32 5, i32 2, i32 7>
637 ret <4 x i32> %vecins1
640 define dso_local <16 x i8> @no_RAUW_in_combine_during_legalize(i32* nocapture readonly %ptr, i32 signext %offset) local_unnamed_addr #0 {
641 ; CHECK-P8-LABEL: no_RAUW_in_combine_during_legalize:
642 ; CHECK-P8: # %bb.0: # %entry
643 ; CHECK-P8-NEXT: addis r5, r2, .LCPI16_0@toc@ha
644 ; CHECK-P8-NEXT: sldi r4, r4, 2
645 ; CHECK-P8-NEXT: xxlxor v4, v4, v4
646 ; CHECK-P8-NEXT: addi r5, r5, .LCPI16_0@toc@l
647 ; CHECK-P8-NEXT: lxsiwzx v2, r3, r4
648 ; CHECK-P8-NEXT: lvx v3, 0, r5
649 ; CHECK-P8-NEXT: vperm v2, v4, v2, v3
652 ; CHECK-P9-LABEL: no_RAUW_in_combine_during_legalize:
653 ; CHECK-P9: # %bb.0: # %entry
654 ; CHECK-P9-NEXT: sldi r4, r4, 2
655 ; CHECK-P9-NEXT: xxlxor v4, v4, v4
656 ; CHECK-P9-NEXT: lxsiwzx v2, r3, r4
657 ; CHECK-P9-NEXT: addis r3, r2, .LCPI16_0@toc@ha
658 ; CHECK-P9-NEXT: addi r3, r3, .LCPI16_0@toc@l
659 ; CHECK-P9-NEXT: lxv v3, 0(r3)
660 ; CHECK-P9-NEXT: vperm v2, v4, v2, v3
663 ; CHECK-P9-BE-LABEL: no_RAUW_in_combine_during_legalize:
664 ; CHECK-P9-BE: # %bb.0: # %entry
665 ; CHECK-P9-BE-NEXT: sldi r4, r4, 2
666 ; CHECK-P9-BE-NEXT: xxlxor v3, v3, v3
667 ; CHECK-P9-BE-NEXT: lxsiwzx v2, r3, r4
668 ; CHECK-P9-BE-NEXT: vmrghb v2, v2, v3
669 ; CHECK-P9-BE-NEXT: blr
671 ; CHECK-NOVSX-LABEL: no_RAUW_in_combine_during_legalize:
672 ; CHECK-NOVSX: # %bb.0: # %entry
673 ; CHECK-NOVSX-NEXT: sldi r4, r4, 2
674 ; CHECK-NOVSX-NEXT: vxor v2, v2, v2
675 ; CHECK-NOVSX-NEXT: lwzx r3, r3, r4
676 ; CHECK-NOVSX-NEXT: std r3, -16(r1)
677 ; CHECK-NOVSX-NEXT: addi r3, r1, -16
678 ; CHECK-NOVSX-NEXT: lvx v3, 0, r3
679 ; CHECK-NOVSX-NEXT: vmrglb v2, v2, v3
680 ; CHECK-NOVSX-NEXT: blr
682 ; CHECK-P7-LABEL: no_RAUW_in_combine_during_legalize:
683 ; CHECK-P7: # %bb.0: # %entry
684 ; CHECK-P7-NEXT: sldi r4, r4, 2
685 ; CHECK-P7-NEXT: addi r5, r1, -16
686 ; CHECK-P7-NEXT: xxlxor v3, v3, v3
687 ; CHECK-P7-NEXT: lwzx r3, r3, r4
688 ; CHECK-P7-NEXT: std r3, -16(r1)
689 ; CHECK-P7-NEXT: lxvd2x vs0, 0, r5
690 ; CHECK-P7-NEXT: xxswapd v2, vs0
691 ; CHECK-P7-NEXT: vmrglb v2, v3, v2
694 %idx.ext = sext i32 %offset to i64
695 %add.ptr = getelementptr inbounds i32, i32* %ptr, i64 %idx.ext
696 %0 = load i32, i32* %add.ptr, align 4
697 %conv = zext i32 %0 to i64
698 %splat.splatinsert = insertelement <2 x i64> undef, i64 %conv, i32 0
699 %1 = bitcast <2 x i64> %splat.splatinsert to <16 x i8>
700 %shuffle = shufflevector <16 x i8> %1, <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef>, <16 x i32> <i32 0, i32 16, i32 1, i32 17, i32 2, i32 18, i32 3, i32 19, i32 4, i32 20, i32 5, i32 21, i32 6, i32 22, i32 7, i32 23>
701 ret <16 x i8> %shuffle
704 define dso_local <4 x i32> @testSplat4Low(<8 x i8>* nocapture readonly %ptr) local_unnamed_addr #0 {
705 ; CHECK-P8-LABEL: testSplat4Low:
706 ; CHECK-P8: # %bb.0: # %entry
707 ; CHECK-P8-NEXT: lfdx f0, 0, r3
708 ; CHECK-P8-NEXT: xxspltw v2, vs0, 0
711 ; CHECK-P9-LABEL: testSplat4Low:
712 ; CHECK-P9: # %bb.0: # %entry
713 ; CHECK-P9-NEXT: addi r3, r3, 4
714 ; CHECK-P9-NEXT: lxvwsx v2, 0, r3
717 ; CHECK-P9-BE-LABEL: testSplat4Low:
718 ; CHECK-P9-BE: # %bb.0: # %entry
719 ; CHECK-P9-BE-NEXT: addi r3, r3, 4
720 ; CHECK-P9-BE-NEXT: lxvwsx v2, 0, r3
721 ; CHECK-P9-BE-NEXT: blr
723 ; CHECK-NOVSX-LABEL: testSplat4Low:
724 ; CHECK-NOVSX: # %bb.0: # %entry
725 ; CHECK-NOVSX-NEXT: ld r3, 0(r3)
726 ; CHECK-NOVSX-NEXT: addi r4, r1, -16
727 ; CHECK-NOVSX-NEXT: std r3, -16(r1)
728 ; CHECK-NOVSX-NEXT: lvx v2, 0, r4
729 ; CHECK-NOVSX-NEXT: vspltw v2, v2, 2
730 ; CHECK-NOVSX-NEXT: blr
732 ; CHECK-P7-LABEL: testSplat4Low:
733 ; CHECK-P7: # %bb.0: # %entry
734 ; CHECK-P7-NEXT: ld r3, 0(r3)
735 ; CHECK-P7-NEXT: addi r4, r1, -16
736 ; CHECK-P7-NEXT: std r3, -16(r1)
737 ; CHECK-P7-NEXT: lxvd2x vs0, 0, r4
738 ; CHECK-P7-NEXT: xxswapd v2, vs0
739 ; CHECK-P7-NEXT: xxspltw v2, v2, 2
742 %0 = load <8 x i8>, <8 x i8>* %ptr, align 8
743 %vecinit18 = shufflevector <8 x i8> %0, <8 x i8> undef, <16 x i32> <i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
744 %1 = bitcast <16 x i8> %vecinit18 to <4 x i32>
748 ; Function Attrs: norecurse nounwind readonly
749 define dso_local <4 x i32> @testSplat4hi(<8 x i8>* nocapture readonly %ptr) local_unnamed_addr #0 {
750 ; CHECK-P8-LABEL: testSplat4hi:
751 ; CHECK-P8: # %bb.0: # %entry
752 ; CHECK-P8-NEXT: lfdx f0, 0, r3
753 ; CHECK-P8-NEXT: xxspltw v2, vs0, 1
756 ; CHECK-P9-LABEL: testSplat4hi:
757 ; CHECK-P9: # %bb.0: # %entry
758 ; CHECK-P9-NEXT: lxvwsx v2, 0, r3
761 ; CHECK-P9-BE-LABEL: testSplat4hi:
762 ; CHECK-P9-BE: # %bb.0: # %entry
763 ; CHECK-P9-BE-NEXT: lxvwsx v2, 0, r3
764 ; CHECK-P9-BE-NEXT: blr
766 ; CHECK-NOVSX-LABEL: testSplat4hi:
767 ; CHECK-NOVSX: # %bb.0: # %entry
768 ; CHECK-NOVSX-NEXT: ld r3, 0(r3)
769 ; CHECK-NOVSX-NEXT: addi r4, r1, -16
770 ; CHECK-NOVSX-NEXT: std r3, -16(r1)
771 ; CHECK-NOVSX-NEXT: lvx v2, 0, r4
772 ; CHECK-NOVSX-NEXT: vspltw v2, v2, 3
773 ; CHECK-NOVSX-NEXT: blr
775 ; CHECK-P7-LABEL: testSplat4hi:
776 ; CHECK-P7: # %bb.0: # %entry
777 ; CHECK-P7-NEXT: ld r3, 0(r3)
778 ; CHECK-P7-NEXT: addi r4, r1, -16
779 ; CHECK-P7-NEXT: std r3, -16(r1)
780 ; CHECK-P7-NEXT: lxvd2x vs0, 0, r4
781 ; CHECK-P7-NEXT: xxswapd v2, vs0
782 ; CHECK-P7-NEXT: xxspltw v2, v2, 3
785 %0 = load <8 x i8>, <8 x i8>* %ptr, align 8
786 %vecinit22 = shufflevector <8 x i8> %0, <8 x i8> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
787 %1 = bitcast <16 x i8> %vecinit22 to <4 x i32>
791 ; Function Attrs: norecurse nounwind readonly
792 define dso_local <2 x i64> @testSplat8(<8 x i8>* nocapture readonly %ptr) local_unnamed_addr #0 {
793 ; CHECK-P8-LABEL: testSplat8:
794 ; CHECK-P8: # %bb.0: # %entry
795 ; CHECK-P8-NEXT: lxvdsx v2, 0, r3
798 ; CHECK-P9-LABEL: testSplat8:
799 ; CHECK-P9: # %bb.0: # %entry
800 ; CHECK-P9-NEXT: lxvdsx v2, 0, r3
803 ; CHECK-P9-BE-LABEL: testSplat8:
804 ; CHECK-P9-BE: # %bb.0: # %entry
805 ; CHECK-P9-BE-NEXT: lxvdsx v2, 0, r3
806 ; CHECK-P9-BE-NEXT: blr
808 ; CHECK-NOVSX-LABEL: testSplat8:
809 ; CHECK-NOVSX: # %bb.0: # %entry
810 ; CHECK-NOVSX-NEXT: ld r3, 0(r3)
811 ; CHECK-NOVSX-NEXT: addis r4, r2, .LCPI19_0@toc@ha
812 ; CHECK-NOVSX-NEXT: addi r4, r4, .LCPI19_0@toc@l
813 ; CHECK-NOVSX-NEXT: lvx v2, 0, r4
814 ; CHECK-NOVSX-NEXT: std r3, -16(r1)
815 ; CHECK-NOVSX-NEXT: addi r3, r1, -16
816 ; CHECK-NOVSX-NEXT: lvx v3, 0, r3
817 ; CHECK-NOVSX-NEXT: vperm v2, v3, v3, v2
818 ; CHECK-NOVSX-NEXT: blr
820 ; CHECK-P7-LABEL: testSplat8:
821 ; CHECK-P7: # %bb.0: # %entry
822 ; CHECK-P7-NEXT: lxvdsx v2, 0, r3
825 %0 = load <8 x i8>, <8 x i8>* %ptr, align 8
826 %vecinit30 = shufflevector <8 x i8> %0, <8 x i8> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
827 %1 = bitcast <16 x i8> %vecinit30 to <2 x i64>
831 define dso_local void @testByteSplat() #0 {
832 ; CHECK-P8-LABEL: testByteSplat:
833 ; CHECK-P8: # %bb.0: # %entry
834 ; CHECK-P8-NEXT: lbz r3, 0(r3)
835 ; CHECK-P8-NEXT: mtvsrd v2, r3
836 ; CHECK-P8-NEXT: vspltb v2, v2, 7
837 ; CHECK-P8-NEXT: stvx v2, 0, r3
840 ; CHECK-P9-LABEL: testByteSplat:
841 ; CHECK-P9: # %bb.0: # %entry
842 ; CHECK-P9-NEXT: lxsibzx v2, 0, r3
843 ; CHECK-P9-NEXT: vspltb v2, v2, 7
844 ; CHECK-P9-NEXT: stxv v2, 0(r3)
847 ; CHECK-P9-BE-LABEL: testByteSplat:
848 ; CHECK-P9-BE: # %bb.0: # %entry
849 ; CHECK-P9-BE-NEXT: lxsibzx v2, 0, r3
850 ; CHECK-P9-BE-NEXT: vspltb v2, v2, 7
851 ; CHECK-P9-BE-NEXT: stxv v2, 0(r3)
852 ; CHECK-P9-BE-NEXT: blr
854 ; CHECK-NOVSX-LABEL: testByteSplat:
855 ; CHECK-NOVSX: # %bb.0: # %entry
856 ; CHECK-NOVSX-NEXT: lbz r3, 0(r3)
857 ; CHECK-NOVSX-NEXT: stb r3, -16(r1)
858 ; CHECK-NOVSX-NEXT: addi r3, r1, -16
859 ; CHECK-NOVSX-NEXT: lvx v2, 0, r3
860 ; CHECK-NOVSX-NEXT: vspltb v2, v2, 15
861 ; CHECK-NOVSX-NEXT: stvx v2, 0, r3
862 ; CHECK-NOVSX-NEXT: blr
864 ; CHECK-P7-LABEL: testByteSplat:
865 ; CHECK-P7: # %bb.0: # %entry
866 ; CHECK-P7-NEXT: lbz r3, 0(r3)
867 ; CHECK-P7-NEXT: stb r3, -16(r1)
868 ; CHECK-P7-NEXT: addi r3, r1, -16
869 ; CHECK-P7-NEXT: lvx v2, 0, r3
870 ; CHECK-P7-NEXT: vspltb v2, v2, 15
871 ; CHECK-P7-NEXT: stvx v2, 0, r3
874 %0 = load i8, i8* undef, align 1
875 %splat.splatinsert.i = insertelement <16 x i8> poison, i8 %0, i32 0
876 %splat.splat.i = shufflevector <16 x i8> %splat.splatinsert.i, <16 x i8> poison, <16 x i32> zeroinitializer
877 store <16 x i8> %splat.splat.i, <16 x i8>* undef, align 16
881 declare double @dummy() local_unnamed_addr
882 attributes #0 = { nounwind }