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=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
4 ; RUN: FileCheck %s --check-prefixes=CHECK,CHECK-LE
5 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu \
6 ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
7 ; RUN: FileCheck %s --check-prefixes=CHECK,CHECK-LINUXBE
8 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O0 \
9 ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
10 ; RUN: FileCheck %s --check-prefixes=CHECK,CHECK-O0
11 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-ibm-aix-xcoff \
12 ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | \
13 ; RUN: FileCheck %s --check-prefixes=CHECK,CHECK-AIXBE
15 ; These test cases aims to test the builtins for the Power10 VSX vector
16 ; instructions introduced in ISA 3.1.
18 declare i32 @llvm.ppc.vsx.xvtlsbb(<16 x i8>, i32)
20 define signext i32 @test_vec_test_lsbb_all_ones(<16 x i8> %vuca) {
21 ; CHECK-LABEL: test_vec_test_lsbb_all_ones:
22 ; CHECK: # %bb.0: # %entry
23 ; CHECK-NEXT: xvtlsbb cr0, v2
24 ; CHECK-NEXT: mfocrf r3, 128
25 ; CHECK-NEXT: srwi r3, r3, 31
26 ; CHECK-NEXT: extsw r3, r3
29 %0 = tail call i32 @llvm.ppc.vsx.xvtlsbb(<16 x i8> %vuca, i32 1)
33 define signext i32 @test_vec_test_lsbb_all_zeros(<16 x i8> %vuca) {
34 ; CHECK-LABEL: test_vec_test_lsbb_all_zeros:
35 ; CHECK: # %bb.0: # %entry
36 ; CHECK-NEXT: xvtlsbb cr0, v2
37 ; CHECK-NEXT: mfocrf r3, 128
38 ; CHECK-NEXT: rlwinm r3, r3, 3, 31, 31
39 ; CHECK-NEXT: extsw r3, r3
42 %0 = tail call i32 @llvm.ppc.vsx.xvtlsbb(<16 x i8> %vuca, i32 0)
46 define void @vec_xst_trunc_sc(<1 x i128> %__vec, i64 %__offset, ptr nocapture %__ptr) {
47 ; CHECK-LE-LABEL: vec_xst_trunc_sc:
48 ; CHECK-LE: # %bb.0: # %entry
49 ; CHECK-LE-NEXT: stxvrbx v2, r6, r5
52 ; CHECK-LINUXBE-LABEL: vec_xst_trunc_sc:
53 ; CHECK-LINUXBE: # %bb.0: # %entry
54 ; CHECK-LINUXBE-NEXT: vsldoi v2, v2, v2, 9
55 ; CHECK-LINUXBE-NEXT: stxsibx v2, r6, r5
56 ; CHECK-LINUXBE-NEXT: blr
58 ; CHECK-O0-LABEL: vec_xst_trunc_sc:
59 ; CHECK-O0: # %bb.0: # %entry
60 ; CHECK-O0-NEXT: li r3, 0
61 ; CHECK-O0-NEXT: vextubrx r3, r3, v2
62 ; CHECK-O0-NEXT: # kill: def $r3 killed $r3 killed $x3
63 ; CHECK-O0-NEXT: add r4, r6, r5
64 ; CHECK-O0-NEXT: stb r3, 0(r4)
67 ; CHECK-AIXBE-LABEL: vec_xst_trunc_sc:
68 ; CHECK-AIXBE: # %bb.0: # %entry
69 ; CHECK-AIXBE-NEXT: vsldoi v2, v2, v2, 9
70 ; CHECK-AIXBE-NEXT: stxsibx v2, r4, r3
71 ; CHECK-AIXBE-NEXT: blr
73 %0 = bitcast <1 x i128> %__vec to <16 x i8>
74 %conv = extractelement <16 x i8> %0, i32 0
75 %add.ptr = getelementptr inbounds i8, ptr %__ptr, i64 %__offset
76 store i8 %conv, ptr %add.ptr, align 1
80 define void @vec_xst_trunc_uc(<1 x i128> %__vec, i64 %__offset, ptr nocapture %__ptr) {
81 ; CHECK-LE-LABEL: vec_xst_trunc_uc:
82 ; CHECK-LE: # %bb.0: # %entry
83 ; CHECK-LE-NEXT: stxvrbx v2, r6, r5
86 ; CHECK-LINUXBE-LABEL: vec_xst_trunc_uc:
87 ; CHECK-LINUXBE: # %bb.0: # %entry
88 ; CHECK-LINUXBE-NEXT: vsldoi v2, v2, v2, 9
89 ; CHECK-LINUXBE-NEXT: stxsibx v2, r6, r5
90 ; CHECK-LINUXBE-NEXT: blr
92 ; CHECK-O0-LABEL: vec_xst_trunc_uc:
93 ; CHECK-O0: # %bb.0: # %entry
94 ; CHECK-O0-NEXT: li r3, 0
95 ; CHECK-O0-NEXT: vextubrx r3, r3, v2
96 ; CHECK-O0-NEXT: # kill: def $r3 killed $r3 killed $x3
97 ; CHECK-O0-NEXT: add r4, r6, r5
98 ; CHECK-O0-NEXT: stb r3, 0(r4)
101 ; CHECK-AIXBE-LABEL: vec_xst_trunc_uc:
102 ; CHECK-AIXBE: # %bb.0: # %entry
103 ; CHECK-AIXBE-NEXT: vsldoi v2, v2, v2, 9
104 ; CHECK-AIXBE-NEXT: stxsibx v2, r4, r3
105 ; CHECK-AIXBE-NEXT: blr
107 %0 = bitcast <1 x i128> %__vec to <16 x i8>
108 %conv = extractelement <16 x i8> %0, i32 0
109 %add.ptr = getelementptr inbounds i8, ptr %__ptr, i64 %__offset
110 store i8 %conv, ptr %add.ptr, align 1
114 define void @vec_xst_trunc_ss(<1 x i128> %__vec, i64 %__offset, ptr nocapture %__ptr) {
115 ; CHECK-LE-LABEL: vec_xst_trunc_ss:
116 ; CHECK-LE: # %bb.0: # %entry
117 ; CHECK-LE-NEXT: sldi r3, r5, 1
118 ; CHECK-LE-NEXT: stxvrhx v2, r6, r3
121 ; CHECK-LINUXBE-LABEL: vec_xst_trunc_ss:
122 ; CHECK-LINUXBE: # %bb.0: # %entry
123 ; CHECK-LINUXBE-NEXT: sldi r3, r5, 1
124 ; CHECK-LINUXBE-NEXT: vsldoi v2, v2, v2, 10
125 ; CHECK-LINUXBE-NEXT: stxsihx v2, r6, r3
126 ; CHECK-LINUXBE-NEXT: blr
128 ; CHECK-O0-LABEL: vec_xst_trunc_ss:
129 ; CHECK-O0: # %bb.0: # %entry
130 ; CHECK-O0-NEXT: li r3, 0
131 ; CHECK-O0-NEXT: vextuhrx r3, r3, v2
132 ; CHECK-O0-NEXT: # kill: def $r3 killed $r3 killed $x3
133 ; CHECK-O0-NEXT: sldi r4, r5, 1
134 ; CHECK-O0-NEXT: add r4, r6, r4
135 ; CHECK-O0-NEXT: sth r3, 0(r4)
138 ; CHECK-AIXBE-LABEL: vec_xst_trunc_ss:
139 ; CHECK-AIXBE: # %bb.0: # %entry
140 ; CHECK-AIXBE-NEXT: sldi r3, r3, 1
141 ; CHECK-AIXBE-NEXT: vsldoi v2, v2, v2, 10
142 ; CHECK-AIXBE-NEXT: stxsihx v2, r4, r3
143 ; CHECK-AIXBE-NEXT: blr
145 %0 = bitcast <1 x i128> %__vec to <8 x i16>
146 %conv = extractelement <8 x i16> %0, i32 0
147 %add.ptr = getelementptr inbounds i16, ptr %__ptr, i64 %__offset
148 store i16 %conv, ptr %add.ptr, align 2
152 define void @vec_xst_trunc_us(<1 x i128> %__vec, i64 %__offset, ptr nocapture %__ptr) {
153 ; CHECK-LE-LABEL: vec_xst_trunc_us:
154 ; CHECK-LE: # %bb.0: # %entry
155 ; CHECK-LE-NEXT: sldi r3, r5, 1
156 ; CHECK-LE-NEXT: stxvrhx v2, r6, r3
159 ; CHECK-LINUXBE-LABEL: vec_xst_trunc_us:
160 ; CHECK-LINUXBE: # %bb.0: # %entry
161 ; CHECK-LINUXBE-NEXT: sldi r3, r5, 1
162 ; CHECK-LINUXBE-NEXT: vsldoi v2, v2, v2, 10
163 ; CHECK-LINUXBE-NEXT: stxsihx v2, r6, r3
164 ; CHECK-LINUXBE-NEXT: blr
166 ; CHECK-O0-LABEL: vec_xst_trunc_us:
167 ; CHECK-O0: # %bb.0: # %entry
168 ; CHECK-O0-NEXT: li r3, 0
169 ; CHECK-O0-NEXT: vextuhrx r3, r3, v2
170 ; CHECK-O0-NEXT: # kill: def $r3 killed $r3 killed $x3
171 ; CHECK-O0-NEXT: sldi r4, r5, 1
172 ; CHECK-O0-NEXT: add r4, r6, r4
173 ; CHECK-O0-NEXT: sth r3, 0(r4)
176 ; CHECK-AIXBE-LABEL: vec_xst_trunc_us:
177 ; CHECK-AIXBE: # %bb.0: # %entry
178 ; CHECK-AIXBE-NEXT: sldi r3, r3, 1
179 ; CHECK-AIXBE-NEXT: vsldoi v2, v2, v2, 10
180 ; CHECK-AIXBE-NEXT: stxsihx v2, r4, r3
181 ; CHECK-AIXBE-NEXT: blr
183 %0 = bitcast <1 x i128> %__vec to <8 x i16>
184 %conv = extractelement <8 x i16> %0, i32 0
185 %add.ptr = getelementptr inbounds i16, ptr %__ptr, i64 %__offset
186 store i16 %conv, ptr %add.ptr, align 2
190 define void @vec_xst_trunc_si(<1 x i128> %__vec, i64 %__offset, ptr nocapture %__ptr) {
191 ; CHECK-LE-LABEL: vec_xst_trunc_si:
192 ; CHECK-LE: # %bb.0: # %entry
193 ; CHECK-LE-NEXT: sldi r3, r5, 2
194 ; CHECK-LE-NEXT: stxvrwx v2, r6, r3
197 ; CHECK-LINUXBE-LABEL: vec_xst_trunc_si:
198 ; CHECK-LINUXBE: # %bb.0: # %entry
199 ; CHECK-LINUXBE-NEXT: sldi r3, r5, 2
200 ; CHECK-LINUXBE-NEXT: xxsldwi vs0, v2, v2, 3
201 ; CHECK-LINUXBE-NEXT: stfiwx f0, r6, r3
202 ; CHECK-LINUXBE-NEXT: blr
204 ; CHECK-O0-LABEL: vec_xst_trunc_si:
205 ; CHECK-O0: # %bb.0: # %entry
206 ; CHECK-O0-NEXT: li r3, 0
207 ; CHECK-O0-NEXT: vextuwrx r3, r3, v2
208 ; CHECK-O0-NEXT: # kill: def $r3 killed $r3 killed $x3
209 ; CHECK-O0-NEXT: sldi r4, r5, 2
210 ; CHECK-O0-NEXT: add r4, r6, r4
211 ; CHECK-O0-NEXT: stw r3, 0(r4)
214 ; CHECK-AIXBE-LABEL: vec_xst_trunc_si:
215 ; CHECK-AIXBE: # %bb.0: # %entry
216 ; CHECK-AIXBE-NEXT: sldi r3, r3, 2
217 ; CHECK-AIXBE-NEXT: xxsldwi vs0, v2, v2, 3
218 ; CHECK-AIXBE-NEXT: stfiwx f0, r4, r3
219 ; CHECK-AIXBE-NEXT: blr
221 %0 = bitcast <1 x i128> %__vec to <4 x i32>
222 %conv = extractelement <4 x i32> %0, i32 0
223 %add.ptr = getelementptr inbounds i32, ptr %__ptr, i64 %__offset
224 store i32 %conv, ptr %add.ptr, align 4
228 define void @vec_xst_trunc_ui(<1 x i128> %__vec, i64 %__offset, ptr nocapture %__ptr) {
229 ; CHECK-LE-LABEL: vec_xst_trunc_ui:
230 ; CHECK-LE: # %bb.0: # %entry
231 ; CHECK-LE-NEXT: sldi r3, r5, 2
232 ; CHECK-LE-NEXT: stxvrwx v2, r6, r3
235 ; CHECK-LINUXBE-LABEL: vec_xst_trunc_ui:
236 ; CHECK-LINUXBE: # %bb.0: # %entry
237 ; CHECK-LINUXBE-NEXT: sldi r3, r5, 2
238 ; CHECK-LINUXBE-NEXT: xxsldwi vs0, v2, v2, 3
239 ; CHECK-LINUXBE-NEXT: stfiwx f0, r6, r3
240 ; CHECK-LINUXBE-NEXT: blr
242 ; CHECK-O0-LABEL: vec_xst_trunc_ui:
243 ; CHECK-O0: # %bb.0: # %entry
244 ; CHECK-O0-NEXT: li r3, 0
245 ; CHECK-O0-NEXT: vextuwrx r3, r3, v2
246 ; CHECK-O0-NEXT: # kill: def $r3 killed $r3 killed $x3
247 ; CHECK-O0-NEXT: sldi r4, r5, 2
248 ; CHECK-O0-NEXT: add r4, r6, r4
249 ; CHECK-O0-NEXT: stw r3, 0(r4)
252 ; CHECK-AIXBE-LABEL: vec_xst_trunc_ui:
253 ; CHECK-AIXBE: # %bb.0: # %entry
254 ; CHECK-AIXBE-NEXT: sldi r3, r3, 2
255 ; CHECK-AIXBE-NEXT: xxsldwi vs0, v2, v2, 3
256 ; CHECK-AIXBE-NEXT: stfiwx f0, r4, r3
257 ; CHECK-AIXBE-NEXT: blr
259 %0 = bitcast <1 x i128> %__vec to <4 x i32>
260 %conv = extractelement <4 x i32> %0, i32 0
261 %add.ptr = getelementptr inbounds i32, ptr %__ptr, i64 %__offset
262 store i32 %conv, ptr %add.ptr, align 4
266 define void @vec_xst_trunc_sll(<1 x i128> %__vec, i64 %__offset, ptr nocapture %__ptr) {
267 ; CHECK-LE-LABEL: vec_xst_trunc_sll:
268 ; CHECK-LE: # %bb.0: # %entry
269 ; CHECK-LE-NEXT: sldi r3, r5, 3
270 ; CHECK-LE-NEXT: stxvrdx v2, r6, r3
273 ; CHECK-LINUXBE-LABEL: vec_xst_trunc_sll:
274 ; CHECK-LINUXBE: # %bb.0: # %entry
275 ; CHECK-LINUXBE-NEXT: sldi r3, r5, 3
276 ; CHECK-LINUXBE-NEXT: stxsdx v2, r6, r3
277 ; CHECK-LINUXBE-NEXT: blr
279 ; CHECK-O0-LABEL: vec_xst_trunc_sll:
280 ; CHECK-O0: # %bb.0: # %entry
281 ; CHECK-O0-NEXT: mfvsrld r3, v2
282 ; CHECK-O0-NEXT: sldi r4, r5, 3
283 ; CHECK-O0-NEXT: add r4, r6, r4
284 ; CHECK-O0-NEXT: std r3, 0(r4)
287 ; CHECK-AIXBE-LABEL: vec_xst_trunc_sll:
288 ; CHECK-AIXBE: # %bb.0: # %entry
289 ; CHECK-AIXBE-NEXT: sldi r3, r3, 3
290 ; CHECK-AIXBE-NEXT: stxsdx v2, r4, r3
291 ; CHECK-AIXBE-NEXT: blr
293 %0 = bitcast <1 x i128> %__vec to <2 x i64>
294 %conv = extractelement <2 x i64> %0, i32 0
295 %add.ptr = getelementptr inbounds i64, ptr %__ptr, i64 %__offset
296 store i64 %conv, ptr %add.ptr, align 8
300 define void @vec_xst_trunc_ull(<1 x i128> %__vec, i64 %__offset, ptr nocapture %__ptr) {
301 ; CHECK-LE-LABEL: vec_xst_trunc_ull:
302 ; CHECK-LE: # %bb.0: # %entry
303 ; CHECK-LE-NEXT: sldi r3, r5, 3
304 ; CHECK-LE-NEXT: stxvrdx v2, r6, r3
307 ; CHECK-LINUXBE-LABEL: vec_xst_trunc_ull:
308 ; CHECK-LINUXBE: # %bb.0: # %entry
309 ; CHECK-LINUXBE-NEXT: sldi r3, r5, 3
310 ; CHECK-LINUXBE-NEXT: stxsdx v2, r6, r3
311 ; CHECK-LINUXBE-NEXT: blr
313 ; CHECK-O0-LABEL: vec_xst_trunc_ull:
314 ; CHECK-O0: # %bb.0: # %entry
315 ; CHECK-O0-NEXT: mfvsrld r3, v2
316 ; CHECK-O0-NEXT: sldi r4, r5, 3
317 ; CHECK-O0-NEXT: add r4, r6, r4
318 ; CHECK-O0-NEXT: std r3, 0(r4)
321 ; CHECK-AIXBE-LABEL: vec_xst_trunc_ull:
322 ; CHECK-AIXBE: # %bb.0: # %entry
323 ; CHECK-AIXBE-NEXT: sldi r3, r3, 3
324 ; CHECK-AIXBE-NEXT: stxsdx v2, r4, r3
325 ; CHECK-AIXBE-NEXT: blr
327 %0 = bitcast <1 x i128> %__vec to <2 x i64>
328 %conv = extractelement <2 x i64> %0, i32 0
329 %add.ptr = getelementptr inbounds i64, ptr %__ptr, i64 %__offset
330 store i64 %conv, ptr %add.ptr, align 8
334 define dso_local <1 x i128> @vec_xl_zext(i64 %__offset, ptr nocapture readonly %__pointer) {
335 ; CHECK-LABEL: vec_xl_zext:
336 ; CHECK: # %bb.0: # %entry
337 ; CHECK-NEXT: lxvrbx v2, r4, r3
340 %add.ptr = getelementptr inbounds i8, ptr %__pointer, i64 %__offset
341 %0 = load i8, ptr %add.ptr, align 1
342 %conv = zext i8 %0 to i128
343 %splat.splatinsert = insertelement <1 x i128> undef, i128 %conv, i32 0
344 ret <1 x i128> %splat.splatinsert
347 define dso_local <1 x i128> @vec_xl_zext_short(i64 %__offset, ptr nocapture readonly %__pointer) {
348 ; CHECK-LABEL: vec_xl_zext_short:
349 ; CHECK: # %bb.0: # %entry
350 ; CHECK-NEXT: sldi r3, r3, 1
351 ; CHECK-NEXT: lxvrhx v2, r4, r3
354 %add.ptr = getelementptr inbounds i16, ptr %__pointer, i64 %__offset
355 %0 = load i16, ptr %add.ptr, align 2
356 %conv = zext i16 %0 to i128
357 %splat.splatinsert = insertelement <1 x i128> undef, i128 %conv, i32 0
358 ret <1 x i128> %splat.splatinsert
361 define dso_local <1 x i128> @vec_xl_zext_word(i64 %__offset, ptr nocapture readonly %__pointer) {
362 ; CHECK-LABEL: vec_xl_zext_word:
363 ; CHECK: # %bb.0: # %entry
364 ; CHECK-NEXT: sldi r3, r3, 2
365 ; CHECK-NEXT: lxvrwx v2, r4, r3
368 %add.ptr = getelementptr inbounds i32, ptr %__pointer, i64 %__offset
369 %0 = load i32, ptr %add.ptr, align 4
370 %conv = zext i32 %0 to i128
371 %splat.splatinsert = insertelement <1 x i128> undef, i128 %conv, i32 0
372 ret <1 x i128> %splat.splatinsert
375 define dso_local <1 x i128> @vec_xl_zext_dw(i64 %__offset, ptr nocapture readonly %__pointer) {
376 ; CHECK-LABEL: vec_xl_zext_dw:
377 ; CHECK: # %bb.0: # %entry
378 ; CHECK-NEXT: sldi r3, r3, 3
379 ; CHECK-NEXT: lxvrdx v2, r4, r3
382 %add.ptr = getelementptr inbounds i64, ptr %__pointer, i64 %__offset
383 %0 = load i64, ptr %add.ptr, align 8
384 %conv = zext i64 %0 to i128
385 %splat.splatinsert = insertelement <1 x i128> undef, i128 %conv, i32 0
386 ret <1 x i128> %splat.splatinsert
389 define dso_local <1 x i128> @vec_xl_sext_b(i64 %offset, ptr %p) {
390 ; CHECK-LE-LABEL: vec_xl_sext_b:
391 ; CHECK-LE: # %bb.0: # %entry
392 ; CHECK-LE-NEXT: lbzx r3, r4, r3
393 ; CHECK-LE-NEXT: extsb r3, r3
394 ; CHECK-LE-NEXT: sradi r4, r3, 63
395 ; CHECK-LE-NEXT: mtvsrdd v2, r4, r3
398 ; CHECK-LINUXBE-LABEL: vec_xl_sext_b:
399 ; CHECK-LINUXBE: # %bb.0: # %entry
400 ; CHECK-LINUXBE-NEXT: lbzx r3, r4, r3
401 ; CHECK-LINUXBE-NEXT: extsb r3, r3
402 ; CHECK-LINUXBE-NEXT: sradi r4, r3, 63
403 ; CHECK-LINUXBE-NEXT: mtvsrdd v2, r4, r3
404 ; CHECK-LINUXBE-NEXT: blr
406 ; CHECK-O0-LABEL: vec_xl_sext_b:
407 ; CHECK-O0: # %bb.0: # %entry
408 ; CHECK-O0-NEXT: lbzx r3, r4, r3
409 ; CHECK-O0-NEXT: extsb r4, r3
410 ; CHECK-O0-NEXT: sradi r3, r4, 63
411 ; CHECK-O0-NEXT: mtvsrdd v2, r3, r4
414 ; CHECK-AIXBE-LABEL: vec_xl_sext_b:
415 ; CHECK-AIXBE: # %bb.0: # %entry
416 ; CHECK-AIXBE-NEXT: lbzx r3, r4, r3
417 ; CHECK-AIXBE-NEXT: extsb r3, r3
418 ; CHECK-AIXBE-NEXT: sradi r4, r3, 63
419 ; CHECK-AIXBE-NEXT: mtvsrdd v2, r4, r3
420 ; CHECK-AIXBE-NEXT: blr
422 %add.ptr = getelementptr inbounds i8, ptr %p, i64 %offset
423 %0 = load i8, ptr %add.ptr, align 1
424 %conv = sext i8 %0 to i128
425 %splat.splatinsert = insertelement <1 x i128> undef, i128 %conv, i32 0
426 ret <1 x i128> %splat.splatinsert
429 define dso_local <1 x i128> @vec_xl_sext_h(i64 %offset, ptr %p) {
430 ; CHECK-LE-LABEL: vec_xl_sext_h:
431 ; CHECK-LE: # %bb.0: # %entry
432 ; CHECK-LE-NEXT: sldi r3, r3, 1
433 ; CHECK-LE-NEXT: lhax r3, r4, r3
434 ; CHECK-LE-NEXT: sradi r4, r3, 63
435 ; CHECK-LE-NEXT: mtvsrdd v2, r4, r3
438 ; CHECK-LINUXBE-LABEL: vec_xl_sext_h:
439 ; CHECK-LINUXBE: # %bb.0: # %entry
440 ; CHECK-LINUXBE-NEXT: sldi r3, r3, 1
441 ; CHECK-LINUXBE-NEXT: lhax r3, r4, r3
442 ; CHECK-LINUXBE-NEXT: sradi r4, r3, 63
443 ; CHECK-LINUXBE-NEXT: mtvsrdd v2, r4, r3
444 ; CHECK-LINUXBE-NEXT: blr
446 ; CHECK-O0-LABEL: vec_xl_sext_h:
447 ; CHECK-O0: # %bb.0: # %entry
448 ; CHECK-O0-NEXT: sldi r3, r3, 1
449 ; CHECK-O0-NEXT: lhax r4, r4, r3
450 ; CHECK-O0-NEXT: sradi r3, r4, 63
451 ; CHECK-O0-NEXT: mtvsrdd v2, r3, r4
454 ; CHECK-AIXBE-LABEL: vec_xl_sext_h:
455 ; CHECK-AIXBE: # %bb.0: # %entry
456 ; CHECK-AIXBE-NEXT: sldi r3, r3, 1
457 ; CHECK-AIXBE-NEXT: lhax r3, r4, r3
458 ; CHECK-AIXBE-NEXT: sradi r4, r3, 63
459 ; CHECK-AIXBE-NEXT: mtvsrdd v2, r4, r3
460 ; CHECK-AIXBE-NEXT: blr
462 %add.ptr = getelementptr inbounds i16, ptr %p, i64 %offset
463 %0 = load i16, ptr %add.ptr, align 2
464 %conv = sext i16 %0 to i128
465 %splat.splatinsert = insertelement <1 x i128> undef, i128 %conv, i32 0
466 ret <1 x i128> %splat.splatinsert
469 define dso_local <1 x i128> @vec_xl_sext_w(i64 %offset, ptr %p) {
470 ; CHECK-LE-LABEL: vec_xl_sext_w:
471 ; CHECK-LE: # %bb.0: # %entry
472 ; CHECK-LE-NEXT: sldi r3, r3, 2
473 ; CHECK-LE-NEXT: lwax r3, r4, r3
474 ; CHECK-LE-NEXT: sradi r4, r3, 63
475 ; CHECK-LE-NEXT: mtvsrdd v2, r4, r3
478 ; CHECK-LINUXBE-LABEL: vec_xl_sext_w:
479 ; CHECK-LINUXBE: # %bb.0: # %entry
480 ; CHECK-LINUXBE-NEXT: sldi r3, r3, 2
481 ; CHECK-LINUXBE-NEXT: lwax r3, r4, r3
482 ; CHECK-LINUXBE-NEXT: sradi r4, r3, 63
483 ; CHECK-LINUXBE-NEXT: mtvsrdd v2, r4, r3
484 ; CHECK-LINUXBE-NEXT: blr
486 ; CHECK-O0-LABEL: vec_xl_sext_w:
487 ; CHECK-O0: # %bb.0: # %entry
488 ; CHECK-O0-NEXT: sldi r3, r3, 2
489 ; CHECK-O0-NEXT: lwax r4, r4, r3
490 ; CHECK-O0-NEXT: sradi r3, r4, 63
491 ; CHECK-O0-NEXT: mtvsrdd v2, r3, r4
494 ; CHECK-AIXBE-LABEL: vec_xl_sext_w:
495 ; CHECK-AIXBE: # %bb.0: # %entry
496 ; CHECK-AIXBE-NEXT: sldi r3, r3, 2
497 ; CHECK-AIXBE-NEXT: lwax r3, r4, r3
498 ; CHECK-AIXBE-NEXT: sradi r4, r3, 63
499 ; CHECK-AIXBE-NEXT: mtvsrdd v2, r4, r3
500 ; CHECK-AIXBE-NEXT: blr
502 %add.ptr = getelementptr inbounds i32, ptr %p, i64 %offset
503 %0 = load i32, ptr %add.ptr, align 4
504 %conv = sext i32 %0 to i128
505 %splat.splatinsert = insertelement <1 x i128> undef, i128 %conv, i32 0
506 ret <1 x i128> %splat.splatinsert
509 define dso_local <1 x i128> @vec_xl_sext_d(i64 %offset, ptr %p) {
510 ; CHECK-LE-LABEL: vec_xl_sext_d:
511 ; CHECK-LE: # %bb.0: # %entry
512 ; CHECK-LE-NEXT: sldi r3, r3, 3
513 ; CHECK-LE-NEXT: ldx r3, r4, r3
514 ; CHECK-LE-NEXT: sradi r4, r3, 63
515 ; CHECK-LE-NEXT: mtvsrdd v2, r4, r3
518 ; CHECK-LINUXBE-LABEL: vec_xl_sext_d:
519 ; CHECK-LINUXBE: # %bb.0: # %entry
520 ; CHECK-LINUXBE-NEXT: sldi r3, r3, 3
521 ; CHECK-LINUXBE-NEXT: ldx r3, r4, r3
522 ; CHECK-LINUXBE-NEXT: sradi r4, r3, 63
523 ; CHECK-LINUXBE-NEXT: mtvsrdd v2, r4, r3
524 ; CHECK-LINUXBE-NEXT: blr
526 ; CHECK-O0-LABEL: vec_xl_sext_d:
527 ; CHECK-O0: # %bb.0: # %entry
528 ; CHECK-O0-NEXT: sldi r3, r3, 3
529 ; CHECK-O0-NEXT: ldx r4, r4, r3
530 ; CHECK-O0-NEXT: sradi r3, r4, 63
531 ; CHECK-O0-NEXT: mtvsrdd v2, r3, r4
534 ; CHECK-AIXBE-LABEL: vec_xl_sext_d:
535 ; CHECK-AIXBE: # %bb.0: # %entry
536 ; CHECK-AIXBE-NEXT: sldi r3, r3, 3
537 ; CHECK-AIXBE-NEXT: ldx r3, r4, r3
538 ; CHECK-AIXBE-NEXT: sradi r4, r3, 63
539 ; CHECK-AIXBE-NEXT: mtvsrdd v2, r4, r3
540 ; CHECK-AIXBE-NEXT: blr
542 %add.ptr = getelementptr inbounds i64, ptr %p, i64 %offset
543 %0 = load i64, ptr %add.ptr, align 8
544 %conv = sext i64 %0 to i128
545 %splat.splatinsert = insertelement <1 x i128> undef, i128 %conv, i32 0
546 ret <1 x i128> %splat.splatinsert