1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -relocation-model=pic -mcpu=pwr9 -mtriple=powerpc64le-unknown-unknown \
3 ; RUN: -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s \
5 ; RUN: llc -relocation-model=pic -mcpu=pwr8 -mtriple=powerpc64le-unknown-unknown \
6 ; RUN: -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s \
7 ; RUN: | FileCheck %s -check-prefix=CHECK-P8
9 @f128Array = global [4 x fp128] [fp128 0xL00000000000000004004C00000000000,
10 fp128 0xLF000000000000000400808AB851EB851,
11 fp128 0xL5000000000000000400E0C26324C8366,
12 fp128 0xL8000000000000000400A24E2E147AE14],
15 ; Function Attrs: norecurse nounwind readonly
16 define i64 @qpConv2sdw(ptr nocapture readonly %a) {
17 ; CHECK-LABEL: qpConv2sdw:
18 ; CHECK: # %bb.0: # %entry
19 ; CHECK-NEXT: lxv v2, 0(r3)
20 ; CHECK-NEXT: xscvqpsdz v2, v2
21 ; CHECK-NEXT: mfvsrd r3, v2
24 ; CHECK-P8-LABEL: qpConv2sdw:
25 ; CHECK-P8: # %bb.0: # %entry
26 ; CHECK-P8-NEXT: mflr r0
27 ; CHECK-P8-NEXT: stdu r1, -32(r1)
28 ; CHECK-P8-NEXT: std r0, 48(r1)
29 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
30 ; CHECK-P8-NEXT: .cfi_offset lr, 16
31 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
32 ; CHECK-P8-NEXT: xxswapd v2, vs0
33 ; CHECK-P8-NEXT: bl __fixkfdi
35 ; CHECK-P8-NEXT: addi r1, r1, 32
36 ; CHECK-P8-NEXT: ld r0, 16(r1)
37 ; CHECK-P8-NEXT: mtlr r0
40 %0 = load fp128, ptr %a, align 16
41 %conv = fptosi fp128 %0 to i64
46 ; Function Attrs: norecurse nounwind
47 define void @qpConv2sdw_02(ptr nocapture %res) local_unnamed_addr #1 {
48 ; CHECK-LABEL: qpConv2sdw_02:
49 ; CHECK: # %bb.0: # %entry
50 ; CHECK-NEXT: addis r4, r2, .LC0@toc@ha
51 ; CHECK-NEXT: ld r4, .LC0@toc@l(r4)
52 ; CHECK-NEXT: lxv v2, 32(r4)
53 ; CHECK-NEXT: xscvqpsdz v2, v2
54 ; CHECK-NEXT: stxsd v2, 0(r3)
57 ; CHECK-P8-LABEL: qpConv2sdw_02:
58 ; CHECK-P8: # %bb.0: # %entry
59 ; CHECK-P8-NEXT: mflr r0
60 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
61 ; CHECK-P8-NEXT: .cfi_offset lr, 16
62 ; CHECK-P8-NEXT: .cfi_offset r30, -16
63 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
64 ; CHECK-P8-NEXT: stdu r1, -48(r1)
65 ; CHECK-P8-NEXT: mr r30, r3
66 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
67 ; CHECK-P8-NEXT: std r0, 64(r1)
68 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
69 ; CHECK-P8-NEXT: addi r3, r3, 32
70 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
71 ; CHECK-P8-NEXT: xxswapd v2, vs0
72 ; CHECK-P8-NEXT: bl __fixkfdi
74 ; CHECK-P8-NEXT: std r3, 0(r30)
75 ; CHECK-P8-NEXT: addi r1, r1, 48
76 ; CHECK-P8-NEXT: ld r0, 16(r1)
77 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
78 ; CHECK-P8-NEXT: mtlr r0
81 %0 = load fp128, ptr getelementptr inbounds
82 ([4 x fp128], ptr @f128Array, i64 0,
84 %conv = fptosi fp128 %0 to i64
85 store i64 %conv, ptr %res, align 8
90 ; Function Attrs: norecurse nounwind readonly
91 define i64 @qpConv2sdw_03(ptr nocapture readonly %a) {
92 ; CHECK-LABEL: qpConv2sdw_03:
93 ; CHECK: # %bb.0: # %entry
94 ; CHECK-NEXT: lxv v2, 0(r3)
95 ; CHECK-NEXT: addis r3, r2, .LC0@toc@ha
96 ; CHECK-NEXT: ld r3, .LC0@toc@l(r3)
97 ; CHECK-NEXT: lxv v3, 16(r3)
98 ; CHECK-NEXT: xsaddqp v2, v2, v3
99 ; CHECK-NEXT: xscvqpsdz v2, v2
100 ; CHECK-NEXT: mfvsrd r3, v2
103 ; CHECK-P8-LABEL: qpConv2sdw_03:
104 ; CHECK-P8: # %bb.0: # %entry
105 ; CHECK-P8-NEXT: mflr r0
106 ; CHECK-P8-NEXT: stdu r1, -32(r1)
107 ; CHECK-P8-NEXT: std r0, 48(r1)
108 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
109 ; CHECK-P8-NEXT: .cfi_offset lr, 16
110 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
111 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
112 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
113 ; CHECK-P8-NEXT: addi r3, r3, 16
114 ; CHECK-P8-NEXT: xxswapd v2, vs0
115 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
116 ; CHECK-P8-NEXT: xxswapd v3, vs0
117 ; CHECK-P8-NEXT: bl __addkf3
119 ; CHECK-P8-NEXT: bl __fixkfdi
121 ; CHECK-P8-NEXT: addi r1, r1, 32
122 ; CHECK-P8-NEXT: ld r0, 16(r1)
123 ; CHECK-P8-NEXT: mtlr r0
126 %0 = load fp128, ptr %a, align 16
127 %1 = load fp128, ptr getelementptr inbounds
128 ([4 x fp128], ptr @f128Array, i64 0,
130 %add = fadd fp128 %0, %1
131 %conv = fptosi fp128 %add to i64
136 ; Function Attrs: norecurse nounwind
137 define void @qpConv2sdw_04(ptr nocapture readonly %a,
138 ; CHECK-LABEL: qpConv2sdw_04:
139 ; CHECK: # %bb.0: # %entry
140 ; CHECK-NEXT: lxv v2, 0(r3)
141 ; CHECK-NEXT: lxv v3, 0(r4)
142 ; CHECK-NEXT: xsaddqp v2, v2, v3
143 ; CHECK-NEXT: xscvqpsdz v2, v2
144 ; CHECK-NEXT: stxsd v2, 0(r5)
147 ; CHECK-P8-LABEL: qpConv2sdw_04:
148 ; CHECK-P8: # %bb.0: # %entry
149 ; CHECK-P8-NEXT: mflr r0
150 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
151 ; CHECK-P8-NEXT: .cfi_offset lr, 16
152 ; CHECK-P8-NEXT: .cfi_offset r30, -16
153 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
154 ; CHECK-P8-NEXT: stdu r1, -48(r1)
155 ; CHECK-P8-NEXT: std r0, 64(r1)
156 ; CHECK-P8-NEXT: mr r30, r5
157 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
158 ; CHECK-P8-NEXT: xxswapd v2, vs0
159 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r4
160 ; CHECK-P8-NEXT: xxswapd v3, vs0
161 ; CHECK-P8-NEXT: bl __addkf3
163 ; CHECK-P8-NEXT: bl __fixkfdi
165 ; CHECK-P8-NEXT: std r3, 0(r30)
166 ; CHECK-P8-NEXT: addi r1, r1, 48
167 ; CHECK-P8-NEXT: ld r0, 16(r1)
168 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
169 ; CHECK-P8-NEXT: mtlr r0
171 ptr nocapture readonly %b, ptr nocapture %res) {
173 %0 = load fp128, ptr %a, align 16
174 %1 = load fp128, ptr %b, align 16
175 %add = fadd fp128 %0, %1
176 %conv = fptosi fp128 %add to i64
177 store i64 %conv, ptr %res, align 8
182 ; Function Attrs: norecurse nounwind
183 define void @qpConv2sdw_testXForm(ptr nocapture %res, i32 signext %idx) {
184 ; CHECK-LABEL: qpConv2sdw_testXForm:
185 ; CHECK: # %bb.0: # %entry
186 ; CHECK-NEXT: addis r5, r2, .LC0@toc@ha
187 ; CHECK-NEXT: sldi r4, r4, 3
188 ; CHECK-NEXT: ld r5, .LC0@toc@l(r5)
189 ; CHECK-NEXT: lxv v2, 32(r5)
190 ; CHECK-NEXT: xscvqpsdz v2, v2
191 ; CHECK-NEXT: stxsdx v2, r3, r4
194 ; CHECK-P8-LABEL: qpConv2sdw_testXForm:
195 ; CHECK-P8: # %bb.0: # %entry
196 ; CHECK-P8-NEXT: mflr r0
197 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 64
198 ; CHECK-P8-NEXT: .cfi_offset lr, 16
199 ; CHECK-P8-NEXT: .cfi_offset r29, -24
200 ; CHECK-P8-NEXT: .cfi_offset r30, -16
201 ; CHECK-P8-NEXT: std r29, -24(r1) # 8-byte Folded Spill
202 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
203 ; CHECK-P8-NEXT: stdu r1, -64(r1)
204 ; CHECK-P8-NEXT: mr r29, r3
205 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
206 ; CHECK-P8-NEXT: std r0, 80(r1)
207 ; CHECK-P8-NEXT: mr r30, r4
208 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
209 ; CHECK-P8-NEXT: addi r3, r3, 32
210 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
211 ; CHECK-P8-NEXT: xxswapd v2, vs0
212 ; CHECK-P8-NEXT: bl __fixkfdi
214 ; CHECK-P8-NEXT: sldi r4, r30, 3
215 ; CHECK-P8-NEXT: stdx r3, r29, r4
216 ; CHECK-P8-NEXT: addi r1, r1, 64
217 ; CHECK-P8-NEXT: ld r0, 16(r1)
218 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
219 ; CHECK-P8-NEXT: ld r29, -24(r1) # 8-byte Folded Reload
220 ; CHECK-P8-NEXT: mtlr r0
223 %0 = load fp128, ptr getelementptr inbounds
224 ([4 x fp128], ptr @f128Array,
225 i64 0, i64 2), align 16
226 %conv = fptosi fp128 %0 to i64
227 %idxprom = sext i32 %idx to i64
228 %arrayidx = getelementptr inbounds i64, ptr %res, i64 %idxprom
229 store i64 %conv, ptr %arrayidx, align 8
234 ; Function Attrs: norecurse nounwind readonly
235 define i64 @qpConv2udw(ptr nocapture readonly %a) {
236 ; CHECK-LABEL: qpConv2udw:
237 ; CHECK: # %bb.0: # %entry
238 ; CHECK-NEXT: lxv v2, 0(r3)
239 ; CHECK-NEXT: xscvqpudz v2, v2
240 ; CHECK-NEXT: mfvsrd r3, v2
243 ; CHECK-P8-LABEL: qpConv2udw:
244 ; CHECK-P8: # %bb.0: # %entry
245 ; CHECK-P8-NEXT: mflr r0
246 ; CHECK-P8-NEXT: stdu r1, -32(r1)
247 ; CHECK-P8-NEXT: std r0, 48(r1)
248 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
249 ; CHECK-P8-NEXT: .cfi_offset lr, 16
250 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
251 ; CHECK-P8-NEXT: xxswapd v2, vs0
252 ; CHECK-P8-NEXT: bl __fixunskfdi
254 ; CHECK-P8-NEXT: addi r1, r1, 32
255 ; CHECK-P8-NEXT: ld r0, 16(r1)
256 ; CHECK-P8-NEXT: mtlr r0
259 %0 = load fp128, ptr %a, align 16
260 %conv = fptoui fp128 %0 to i64
265 ; Function Attrs: norecurse nounwind
266 define void @qpConv2udw_02(ptr nocapture %res) {
267 ; CHECK-LABEL: qpConv2udw_02:
268 ; CHECK: # %bb.0: # %entry
269 ; CHECK-NEXT: addis r4, r2, .LC0@toc@ha
270 ; CHECK-NEXT: ld r4, .LC0@toc@l(r4)
271 ; CHECK-NEXT: lxv v2, 32(r4)
272 ; CHECK-NEXT: xscvqpudz v2, v2
273 ; CHECK-NEXT: stxsd v2, 0(r3)
276 ; CHECK-P8-LABEL: qpConv2udw_02:
277 ; CHECK-P8: # %bb.0: # %entry
278 ; CHECK-P8-NEXT: mflr r0
279 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
280 ; CHECK-P8-NEXT: .cfi_offset lr, 16
281 ; CHECK-P8-NEXT: .cfi_offset r30, -16
282 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
283 ; CHECK-P8-NEXT: stdu r1, -48(r1)
284 ; CHECK-P8-NEXT: mr r30, r3
285 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
286 ; CHECK-P8-NEXT: std r0, 64(r1)
287 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
288 ; CHECK-P8-NEXT: addi r3, r3, 32
289 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
290 ; CHECK-P8-NEXT: xxswapd v2, vs0
291 ; CHECK-P8-NEXT: bl __fixunskfdi
293 ; CHECK-P8-NEXT: std r3, 0(r30)
294 ; CHECK-P8-NEXT: addi r1, r1, 48
295 ; CHECK-P8-NEXT: ld r0, 16(r1)
296 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
297 ; CHECK-P8-NEXT: mtlr r0
300 %0 = load fp128, ptr getelementptr inbounds
301 ([4 x fp128], ptr @f128Array, i64 0,
303 %conv = fptoui fp128 %0 to i64
304 store i64 %conv, ptr %res, align 8
309 ; Function Attrs: norecurse nounwind readonly
310 define i64 @qpConv2udw_03(ptr nocapture readonly %a) {
311 ; CHECK-LABEL: qpConv2udw_03:
312 ; CHECK: # %bb.0: # %entry
313 ; CHECK-NEXT: lxv v2, 0(r3)
314 ; CHECK-NEXT: addis r3, r2, .LC0@toc@ha
315 ; CHECK-NEXT: ld r3, .LC0@toc@l(r3)
316 ; CHECK-NEXT: lxv v3, 16(r3)
317 ; CHECK-NEXT: xsaddqp v2, v2, v3
318 ; CHECK-NEXT: xscvqpudz v2, v2
319 ; CHECK-NEXT: mfvsrd r3, v2
322 ; CHECK-P8-LABEL: qpConv2udw_03:
323 ; CHECK-P8: # %bb.0: # %entry
324 ; CHECK-P8-NEXT: mflr r0
325 ; CHECK-P8-NEXT: stdu r1, -32(r1)
326 ; CHECK-P8-NEXT: std r0, 48(r1)
327 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
328 ; CHECK-P8-NEXT: .cfi_offset lr, 16
329 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
330 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
331 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
332 ; CHECK-P8-NEXT: addi r3, r3, 16
333 ; CHECK-P8-NEXT: xxswapd v2, vs0
334 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
335 ; CHECK-P8-NEXT: xxswapd v3, vs0
336 ; CHECK-P8-NEXT: bl __addkf3
338 ; CHECK-P8-NEXT: bl __fixunskfdi
340 ; CHECK-P8-NEXT: addi r1, r1, 32
341 ; CHECK-P8-NEXT: ld r0, 16(r1)
342 ; CHECK-P8-NEXT: mtlr r0
345 %0 = load fp128, ptr %a, align 16
346 %1 = load fp128, ptr getelementptr inbounds
347 ([4 x fp128], ptr @f128Array, i64 0,
349 %add = fadd fp128 %0, %1
350 %conv = fptoui fp128 %add to i64
355 ; Function Attrs: norecurse nounwind
356 define void @qpConv2udw_04(ptr nocapture readonly %a,
357 ; CHECK-LABEL: qpConv2udw_04:
358 ; CHECK: # %bb.0: # %entry
359 ; CHECK-NEXT: lxv v2, 0(r3)
360 ; CHECK-NEXT: lxv v3, 0(r4)
361 ; CHECK-NEXT: xsaddqp v2, v2, v3
362 ; CHECK-NEXT: xscvqpudz v2, v2
363 ; CHECK-NEXT: stxsd v2, 0(r5)
366 ; CHECK-P8-LABEL: qpConv2udw_04:
367 ; CHECK-P8: # %bb.0: # %entry
368 ; CHECK-P8-NEXT: mflr r0
369 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
370 ; CHECK-P8-NEXT: .cfi_offset lr, 16
371 ; CHECK-P8-NEXT: .cfi_offset r30, -16
372 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
373 ; CHECK-P8-NEXT: stdu r1, -48(r1)
374 ; CHECK-P8-NEXT: std r0, 64(r1)
375 ; CHECK-P8-NEXT: mr r30, r5
376 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
377 ; CHECK-P8-NEXT: xxswapd v2, vs0
378 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r4
379 ; CHECK-P8-NEXT: xxswapd v3, vs0
380 ; CHECK-P8-NEXT: bl __addkf3
382 ; CHECK-P8-NEXT: bl __fixunskfdi
384 ; CHECK-P8-NEXT: std r3, 0(r30)
385 ; CHECK-P8-NEXT: addi r1, r1, 48
386 ; CHECK-P8-NEXT: ld r0, 16(r1)
387 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
388 ; CHECK-P8-NEXT: mtlr r0
390 ptr nocapture readonly %b, ptr nocapture %res) {
392 %0 = load fp128, ptr %a, align 16
393 %1 = load fp128, ptr %b, align 16
394 %add = fadd fp128 %0, %1
395 %conv = fptoui fp128 %add to i64
396 store i64 %conv, ptr %res, align 8
401 ; Function Attrs: norecurse nounwind
402 define void @qpConv2udw_testXForm(ptr nocapture %res, i32 signext %idx) {
403 ; CHECK-LABEL: qpConv2udw_testXForm:
404 ; CHECK: # %bb.0: # %entry
405 ; CHECK-NEXT: addis r5, r2, .LC0@toc@ha
406 ; CHECK-NEXT: sldi r4, r4, 3
407 ; CHECK-NEXT: ld r5, .LC0@toc@l(r5)
408 ; CHECK-NEXT: lxv v2, 0(r5)
409 ; CHECK-NEXT: xscvqpudz v2, v2
410 ; CHECK-NEXT: stxsdx v2, r3, r4
413 ; CHECK-P8-LABEL: qpConv2udw_testXForm:
414 ; CHECK-P8: # %bb.0: # %entry
415 ; CHECK-P8-NEXT: mflr r0
416 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 64
417 ; CHECK-P8-NEXT: .cfi_offset lr, 16
418 ; CHECK-P8-NEXT: .cfi_offset r29, -24
419 ; CHECK-P8-NEXT: .cfi_offset r30, -16
420 ; CHECK-P8-NEXT: std r29, -24(r1) # 8-byte Folded Spill
421 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
422 ; CHECK-P8-NEXT: stdu r1, -64(r1)
423 ; CHECK-P8-NEXT: mr r29, r3
424 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
425 ; CHECK-P8-NEXT: std r0, 80(r1)
426 ; CHECK-P8-NEXT: mr r30, r4
427 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
428 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
429 ; CHECK-P8-NEXT: xxswapd v2, vs0
430 ; CHECK-P8-NEXT: bl __fixunskfdi
432 ; CHECK-P8-NEXT: sldi r4, r30, 3
433 ; CHECK-P8-NEXT: stdx r3, r29, r4
434 ; CHECK-P8-NEXT: addi r1, r1, 64
435 ; CHECK-P8-NEXT: ld r0, 16(r1)
436 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
437 ; CHECK-P8-NEXT: ld r29, -24(r1) # 8-byte Folded Reload
438 ; CHECK-P8-NEXT: mtlr r0
441 %0 = load fp128, ptr @f128Array, align 16
442 %conv = fptoui fp128 %0 to i64
443 %idxprom = sext i32 %idx to i64
444 %arrayidx = getelementptr inbounds i64, ptr %res, i64 %idxprom
445 store i64 %conv, ptr %arrayidx, align 8
450 ; Function Attrs: norecurse nounwind readonly
451 define signext i32 @qpConv2sw(ptr nocapture readonly %a) {
452 ; CHECK-LABEL: qpConv2sw:
453 ; CHECK: # %bb.0: # %entry
454 ; CHECK-NEXT: lxv v2, 0(r3)
455 ; CHECK-NEXT: xscvqpswz v2, v2
456 ; CHECK-NEXT: mfvsrwz r3, v2
457 ; CHECK-NEXT: extsw r3, r3
460 ; CHECK-P8-LABEL: qpConv2sw:
461 ; CHECK-P8: # %bb.0: # %entry
462 ; CHECK-P8-NEXT: mflr r0
463 ; CHECK-P8-NEXT: stdu r1, -32(r1)
464 ; CHECK-P8-NEXT: std r0, 48(r1)
465 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
466 ; CHECK-P8-NEXT: .cfi_offset lr, 16
467 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
468 ; CHECK-P8-NEXT: xxswapd v2, vs0
469 ; CHECK-P8-NEXT: bl __fixkfsi
471 ; CHECK-P8-NEXT: extsw r3, r3
472 ; CHECK-P8-NEXT: addi r1, r1, 32
473 ; CHECK-P8-NEXT: ld r0, 16(r1)
474 ; CHECK-P8-NEXT: mtlr r0
477 %0 = load fp128, ptr %a, align 16
478 %conv = fptosi fp128 %0 to i32
483 ; Function Attrs: norecurse nounwind
484 define void @qpConv2sw_02(ptr nocapture %res) {
485 ; CHECK-LABEL: qpConv2sw_02:
486 ; CHECK: # %bb.0: # %entry
487 ; CHECK-NEXT: addis r4, r2, .LC0@toc@ha
488 ; CHECK-NEXT: ld r4, .LC0@toc@l(r4)
489 ; CHECK-NEXT: lxv v2, 32(r4)
490 ; CHECK-NEXT: xscvqpswz v2, v2
491 ; CHECK-NEXT: stxsiwx v2, 0, r3
494 ; CHECK-P8-LABEL: qpConv2sw_02:
495 ; CHECK-P8: # %bb.0: # %entry
496 ; CHECK-P8-NEXT: mflr r0
497 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
498 ; CHECK-P8-NEXT: .cfi_offset lr, 16
499 ; CHECK-P8-NEXT: .cfi_offset r30, -16
500 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
501 ; CHECK-P8-NEXT: stdu r1, -48(r1)
502 ; CHECK-P8-NEXT: mr r30, r3
503 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
504 ; CHECK-P8-NEXT: std r0, 64(r1)
505 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
506 ; CHECK-P8-NEXT: addi r3, r3, 32
507 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
508 ; CHECK-P8-NEXT: xxswapd v2, vs0
509 ; CHECK-P8-NEXT: bl __fixkfsi
511 ; CHECK-P8-NEXT: stw r3, 0(r30)
512 ; CHECK-P8-NEXT: addi r1, r1, 48
513 ; CHECK-P8-NEXT: ld r0, 16(r1)
514 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
515 ; CHECK-P8-NEXT: mtlr r0
518 %0 = load fp128, ptr getelementptr inbounds
519 ([4 x fp128], ptr @f128Array, i64 0,
521 %conv = fptosi fp128 %0 to i32
522 store i32 %conv, ptr %res, align 4
527 ; Function Attrs: norecurse nounwind readonly
528 define signext i32 @qpConv2sw_03(ptr nocapture readonly %a) {
529 ; CHECK-LABEL: qpConv2sw_03:
530 ; CHECK: # %bb.0: # %entry
531 ; CHECK-NEXT: lxv v2, 0(r3)
532 ; CHECK-NEXT: addis r3, r2, .LC0@toc@ha
533 ; CHECK-NEXT: ld r3, .LC0@toc@l(r3)
534 ; CHECK-NEXT: lxv v3, 16(r3)
535 ; CHECK-NEXT: xsaddqp v2, v2, v3
536 ; CHECK-NEXT: xscvqpswz v2, v2
537 ; CHECK-NEXT: mfvsrwz r3, v2
538 ; CHECK-NEXT: extsw r3, r3
541 ; CHECK-P8-LABEL: qpConv2sw_03:
542 ; CHECK-P8: # %bb.0: # %entry
543 ; CHECK-P8-NEXT: mflr r0
544 ; CHECK-P8-NEXT: stdu r1, -32(r1)
545 ; CHECK-P8-NEXT: std r0, 48(r1)
546 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
547 ; CHECK-P8-NEXT: .cfi_offset lr, 16
548 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
549 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
550 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
551 ; CHECK-P8-NEXT: addi r3, r3, 16
552 ; CHECK-P8-NEXT: xxswapd v2, vs0
553 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
554 ; CHECK-P8-NEXT: xxswapd v3, vs0
555 ; CHECK-P8-NEXT: bl __addkf3
557 ; CHECK-P8-NEXT: bl __fixkfsi
559 ; CHECK-P8-NEXT: extsw r3, r3
560 ; CHECK-P8-NEXT: addi r1, r1, 32
561 ; CHECK-P8-NEXT: ld r0, 16(r1)
562 ; CHECK-P8-NEXT: mtlr r0
565 %0 = load fp128, ptr %a, align 16
566 %1 = load fp128, ptr getelementptr inbounds
567 ([4 x fp128], ptr @f128Array, i64 0,
569 %add = fadd fp128 %0, %1
570 %conv = fptosi fp128 %add to i32
575 ; Function Attrs: norecurse nounwind
576 define void @qpConv2sw_04(ptr nocapture readonly %a,
577 ; CHECK-LABEL: qpConv2sw_04:
578 ; CHECK: # %bb.0: # %entry
579 ; CHECK-NEXT: lxv v2, 0(r3)
580 ; CHECK-NEXT: lxv v3, 0(r4)
581 ; CHECK-NEXT: xsaddqp v2, v2, v3
582 ; CHECK-NEXT: xscvqpswz v2, v2
583 ; CHECK-NEXT: stxsiwx v2, 0, r5
586 ; CHECK-P8-LABEL: qpConv2sw_04:
587 ; CHECK-P8: # %bb.0: # %entry
588 ; CHECK-P8-NEXT: mflr r0
589 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
590 ; CHECK-P8-NEXT: .cfi_offset lr, 16
591 ; CHECK-P8-NEXT: .cfi_offset r30, -16
592 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
593 ; CHECK-P8-NEXT: stdu r1, -48(r1)
594 ; CHECK-P8-NEXT: std r0, 64(r1)
595 ; CHECK-P8-NEXT: mr r30, r5
596 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
597 ; CHECK-P8-NEXT: xxswapd v2, vs0
598 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r4
599 ; CHECK-P8-NEXT: xxswapd v3, vs0
600 ; CHECK-P8-NEXT: bl __addkf3
602 ; CHECK-P8-NEXT: bl __fixkfsi
604 ; CHECK-P8-NEXT: stw r3, 0(r30)
605 ; CHECK-P8-NEXT: addi r1, r1, 48
606 ; CHECK-P8-NEXT: ld r0, 16(r1)
607 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
608 ; CHECK-P8-NEXT: mtlr r0
610 ptr nocapture readonly %b, ptr nocapture %res) {
612 %0 = load fp128, ptr %a, align 16
613 %1 = load fp128, ptr %b, align 16
614 %add = fadd fp128 %0, %1
615 %conv = fptosi fp128 %add to i32
616 store i32 %conv, ptr %res, align 4
621 ; Function Attrs: norecurse nounwind readonly
622 define zeroext i32 @qpConv2uw(ptr nocapture readonly %a) {
623 ; CHECK-LABEL: qpConv2uw:
624 ; CHECK: # %bb.0: # %entry
625 ; CHECK-NEXT: lxv v2, 0(r3)
626 ; CHECK-NEXT: xscvqpuwz v2, v2
627 ; CHECK-NEXT: mfvsrwz r3, v2
630 ; CHECK-P8-LABEL: qpConv2uw:
631 ; CHECK-P8: # %bb.0: # %entry
632 ; CHECK-P8-NEXT: mflr r0
633 ; CHECK-P8-NEXT: stdu r1, -32(r1)
634 ; CHECK-P8-NEXT: std r0, 48(r1)
635 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
636 ; CHECK-P8-NEXT: .cfi_offset lr, 16
637 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
638 ; CHECK-P8-NEXT: xxswapd v2, vs0
639 ; CHECK-P8-NEXT: bl __fixunskfsi
641 ; CHECK-P8-NEXT: addi r1, r1, 32
642 ; CHECK-P8-NEXT: ld r0, 16(r1)
643 ; CHECK-P8-NEXT: mtlr r0
646 %0 = load fp128, ptr %a, align 16
647 %conv = fptoui fp128 %0 to i32
652 ; Function Attrs: norecurse nounwind
653 define void @qpConv2uw_02(ptr nocapture %res) {
654 ; CHECK-LABEL: qpConv2uw_02:
655 ; CHECK: # %bb.0: # %entry
656 ; CHECK-NEXT: addis r4, r2, .LC0@toc@ha
657 ; CHECK-NEXT: ld r4, .LC0@toc@l(r4)
658 ; CHECK-NEXT: lxv v2, 32(r4)
659 ; CHECK-NEXT: xscvqpuwz v2, v2
660 ; CHECK-NEXT: stxsiwx v2, 0, r3
663 ; CHECK-P8-LABEL: qpConv2uw_02:
664 ; CHECK-P8: # %bb.0: # %entry
665 ; CHECK-P8-NEXT: mflr r0
666 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
667 ; CHECK-P8-NEXT: .cfi_offset lr, 16
668 ; CHECK-P8-NEXT: .cfi_offset r30, -16
669 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
670 ; CHECK-P8-NEXT: stdu r1, -48(r1)
671 ; CHECK-P8-NEXT: mr r30, r3
672 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
673 ; CHECK-P8-NEXT: std r0, 64(r1)
674 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
675 ; CHECK-P8-NEXT: addi r3, r3, 32
676 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
677 ; CHECK-P8-NEXT: xxswapd v2, vs0
678 ; CHECK-P8-NEXT: bl __fixunskfsi
680 ; CHECK-P8-NEXT: stw r3, 0(r30)
681 ; CHECK-P8-NEXT: addi r1, r1, 48
682 ; CHECK-P8-NEXT: ld r0, 16(r1)
683 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
684 ; CHECK-P8-NEXT: mtlr r0
687 %0 = load fp128, ptr getelementptr inbounds
688 ([4 x fp128], ptr @f128Array, i64 0,
690 %conv = fptoui fp128 %0 to i32
691 store i32 %conv, ptr %res, align 4
696 ; Function Attrs: norecurse nounwind readonly
697 define zeroext i32 @qpConv2uw_03(ptr nocapture readonly %a) {
698 ; CHECK-LABEL: qpConv2uw_03:
699 ; CHECK: # %bb.0: # %entry
700 ; CHECK-NEXT: lxv v2, 0(r3)
701 ; CHECK-NEXT: addis r3, r2, .LC0@toc@ha
702 ; CHECK-NEXT: ld r3, .LC0@toc@l(r3)
703 ; CHECK-NEXT: lxv v3, 16(r3)
704 ; CHECK-NEXT: xsaddqp v2, v2, v3
705 ; CHECK-NEXT: xscvqpuwz v2, v2
706 ; CHECK-NEXT: mfvsrwz r3, v2
709 ; CHECK-P8-LABEL: qpConv2uw_03:
710 ; CHECK-P8: # %bb.0: # %entry
711 ; CHECK-P8-NEXT: mflr r0
712 ; CHECK-P8-NEXT: stdu r1, -32(r1)
713 ; CHECK-P8-NEXT: std r0, 48(r1)
714 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
715 ; CHECK-P8-NEXT: .cfi_offset lr, 16
716 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
717 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
718 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
719 ; CHECK-P8-NEXT: addi r3, r3, 16
720 ; CHECK-P8-NEXT: xxswapd v2, vs0
721 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
722 ; CHECK-P8-NEXT: xxswapd v3, vs0
723 ; CHECK-P8-NEXT: bl __addkf3
725 ; CHECK-P8-NEXT: bl __fixunskfsi
727 ; CHECK-P8-NEXT: addi r1, r1, 32
728 ; CHECK-P8-NEXT: ld r0, 16(r1)
729 ; CHECK-P8-NEXT: mtlr r0
732 %0 = load fp128, ptr %a, align 16
733 %1 = load fp128, ptr getelementptr inbounds
734 ([4 x fp128], ptr @f128Array, i64 0,
736 %add = fadd fp128 %0, %1
737 %conv = fptoui fp128 %add to i32
742 ; Function Attrs: norecurse nounwind
743 define void @qpConv2uw_04(ptr nocapture readonly %a,
744 ; CHECK-LABEL: qpConv2uw_04:
745 ; CHECK: # %bb.0: # %entry
746 ; CHECK-NEXT: lxv v2, 0(r3)
747 ; CHECK-NEXT: lxv v3, 0(r4)
748 ; CHECK-NEXT: xsaddqp v2, v2, v3
749 ; CHECK-NEXT: xscvqpuwz v2, v2
750 ; CHECK-NEXT: stxsiwx v2, 0, r5
753 ; CHECK-P8-LABEL: qpConv2uw_04:
754 ; CHECK-P8: # %bb.0: # %entry
755 ; CHECK-P8-NEXT: mflr r0
756 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
757 ; CHECK-P8-NEXT: .cfi_offset lr, 16
758 ; CHECK-P8-NEXT: .cfi_offset r30, -16
759 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
760 ; CHECK-P8-NEXT: stdu r1, -48(r1)
761 ; CHECK-P8-NEXT: std r0, 64(r1)
762 ; CHECK-P8-NEXT: mr r30, r5
763 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
764 ; CHECK-P8-NEXT: xxswapd v2, vs0
765 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r4
766 ; CHECK-P8-NEXT: xxswapd v3, vs0
767 ; CHECK-P8-NEXT: bl __addkf3
769 ; CHECK-P8-NEXT: bl __fixunskfsi
771 ; CHECK-P8-NEXT: stw r3, 0(r30)
772 ; CHECK-P8-NEXT: addi r1, r1, 48
773 ; CHECK-P8-NEXT: ld r0, 16(r1)
774 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
775 ; CHECK-P8-NEXT: mtlr r0
777 ptr nocapture readonly %b, ptr nocapture %res) {
779 %0 = load fp128, ptr %a, align 16
780 %1 = load fp128, ptr %b, align 16
781 %add = fadd fp128 %0, %1
782 %conv = fptoui fp128 %add to i32
783 store i32 %conv, ptr %res, align 4
789 ; Function Attrs: norecurse nounwind readonly
790 define signext i16 @qpConv2shw(ptr nocapture readonly %a) {
791 ; CHECK-LABEL: qpConv2shw:
792 ; CHECK: # %bb.0: # %entry
793 ; CHECK-NEXT: lxv v2, 0(r3)
794 ; CHECK-NEXT: xscvqpswz v2, v2
795 ; CHECK-NEXT: mfvsrwz r3, v2
796 ; CHECK-NEXT: extsw r3, r3
799 ; CHECK-P8-LABEL: qpConv2shw:
800 ; CHECK-P8: # %bb.0: # %entry
801 ; CHECK-P8-NEXT: mflr r0
802 ; CHECK-P8-NEXT: stdu r1, -32(r1)
803 ; CHECK-P8-NEXT: std r0, 48(r1)
804 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
805 ; CHECK-P8-NEXT: .cfi_offset lr, 16
806 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
807 ; CHECK-P8-NEXT: xxswapd v2, vs0
808 ; CHECK-P8-NEXT: bl __fixkfsi
810 ; CHECK-P8-NEXT: extsw r3, r3
811 ; CHECK-P8-NEXT: addi r1, r1, 32
812 ; CHECK-P8-NEXT: ld r0, 16(r1)
813 ; CHECK-P8-NEXT: mtlr r0
816 %0 = load fp128, ptr %a, align 16
817 %conv = fptosi fp128 %0 to i16
821 ; Function Attrs: norecurse nounwind
822 define void @qpConv2shw_02(ptr nocapture %res) {
823 ; CHECK-LABEL: qpConv2shw_02:
824 ; CHECK: # %bb.0: # %entry
825 ; CHECK-NEXT: addis r4, r2, .LC0@toc@ha
826 ; CHECK-NEXT: ld r4, .LC0@toc@l(r4)
827 ; CHECK-NEXT: lxv v2, 32(r4)
828 ; CHECK-NEXT: xscvqpsdz v2, v2
829 ; CHECK-NEXT: stxsihx v2, 0, r3
832 ; CHECK-P8-LABEL: qpConv2shw_02:
833 ; CHECK-P8: # %bb.0: # %entry
834 ; CHECK-P8-NEXT: mflr r0
835 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
836 ; CHECK-P8-NEXT: .cfi_offset lr, 16
837 ; CHECK-P8-NEXT: .cfi_offset r30, -16
838 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
839 ; CHECK-P8-NEXT: stdu r1, -48(r1)
840 ; CHECK-P8-NEXT: mr r30, r3
841 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
842 ; CHECK-P8-NEXT: std r0, 64(r1)
843 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
844 ; CHECK-P8-NEXT: addi r3, r3, 32
845 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
846 ; CHECK-P8-NEXT: xxswapd v2, vs0
847 ; CHECK-P8-NEXT: bl __fixkfsi
849 ; CHECK-P8-NEXT: sth r3, 0(r30)
850 ; CHECK-P8-NEXT: addi r1, r1, 48
851 ; CHECK-P8-NEXT: ld r0, 16(r1)
852 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
853 ; CHECK-P8-NEXT: mtlr r0
856 %0 = load fp128, ptr getelementptr inbounds
857 ([4 x fp128], ptr @f128Array,
858 i64 0, i64 2), align 16
859 %conv = fptosi fp128 %0 to i16
860 store i16 %conv, ptr %res, align 2
864 ; Function Attrs: norecurse nounwind readonly
865 define signext i16 @qpConv2shw_03(ptr nocapture readonly %a) {
866 ; CHECK-LABEL: qpConv2shw_03:
867 ; CHECK: # %bb.0: # %entry
868 ; CHECK-NEXT: lxv v2, 0(r3)
869 ; CHECK-NEXT: addis r3, r2, .LC0@toc@ha
870 ; CHECK-NEXT: ld r3, .LC0@toc@l(r3)
871 ; CHECK-NEXT: lxv v3, 16(r3)
872 ; CHECK-NEXT: xsaddqp v2, v2, v3
873 ; CHECK-NEXT: xscvqpswz v2, v2
874 ; CHECK-NEXT: mfvsrwz r3, v2
875 ; CHECK-NEXT: extsw r3, r3
878 ; CHECK-P8-LABEL: qpConv2shw_03:
879 ; CHECK-P8: # %bb.0: # %entry
880 ; CHECK-P8-NEXT: mflr r0
881 ; CHECK-P8-NEXT: stdu r1, -32(r1)
882 ; CHECK-P8-NEXT: std r0, 48(r1)
883 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
884 ; CHECK-P8-NEXT: .cfi_offset lr, 16
885 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
886 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
887 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
888 ; CHECK-P8-NEXT: addi r3, r3, 16
889 ; CHECK-P8-NEXT: xxswapd v2, vs0
890 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
891 ; CHECK-P8-NEXT: xxswapd v3, vs0
892 ; CHECK-P8-NEXT: bl __addkf3
894 ; CHECK-P8-NEXT: bl __fixkfsi
896 ; CHECK-P8-NEXT: extsw r3, r3
897 ; CHECK-P8-NEXT: addi r1, r1, 32
898 ; CHECK-P8-NEXT: ld r0, 16(r1)
899 ; CHECK-P8-NEXT: mtlr r0
902 %0 = load fp128, ptr %a, align 16
903 %1 = load fp128, ptr getelementptr inbounds
904 ([4 x fp128], ptr @f128Array,
905 i64 0, i64 1), align 16
906 %add = fadd fp128 %0, %1
907 %conv = fptosi fp128 %add to i16
911 ; Function Attrs: norecurse nounwind
912 define void @qpConv2shw_04(ptr nocapture readonly %a,
913 ; CHECK-LABEL: qpConv2shw_04:
914 ; CHECK: # %bb.0: # %entry
915 ; CHECK-NEXT: lxv v2, 0(r3)
916 ; CHECK-NEXT: lxv v3, 0(r4)
917 ; CHECK-NEXT: xsaddqp v2, v2, v3
918 ; CHECK-NEXT: xscvqpsdz v2, v2
919 ; CHECK-NEXT: stxsihx v2, 0, r5
922 ; CHECK-P8-LABEL: qpConv2shw_04:
923 ; CHECK-P8: # %bb.0: # %entry
924 ; CHECK-P8-NEXT: mflr r0
925 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
926 ; CHECK-P8-NEXT: .cfi_offset lr, 16
927 ; CHECK-P8-NEXT: .cfi_offset r30, -16
928 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
929 ; CHECK-P8-NEXT: stdu r1, -48(r1)
930 ; CHECK-P8-NEXT: std r0, 64(r1)
931 ; CHECK-P8-NEXT: mr r30, r5
932 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
933 ; CHECK-P8-NEXT: xxswapd v2, vs0
934 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r4
935 ; CHECK-P8-NEXT: xxswapd v3, vs0
936 ; CHECK-P8-NEXT: bl __addkf3
938 ; CHECK-P8-NEXT: bl __fixkfsi
940 ; CHECK-P8-NEXT: sth r3, 0(r30)
941 ; CHECK-P8-NEXT: addi r1, r1, 48
942 ; CHECK-P8-NEXT: ld r0, 16(r1)
943 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
944 ; CHECK-P8-NEXT: mtlr r0
946 ptr nocapture readonly %b, ptr nocapture %res) {
948 %0 = load fp128, ptr %a, align 16
949 %1 = load fp128, ptr %b, align 16
950 %add = fadd fp128 %0, %1
951 %conv = fptosi fp128 %add to i16
952 store i16 %conv, ptr %res, align 2
956 ; Function Attrs: norecurse nounwind readonly
957 define zeroext i16 @qpConv2uhw(ptr nocapture readonly %a) {
958 ; CHECK-LABEL: qpConv2uhw:
959 ; CHECK: # %bb.0: # %entry
960 ; CHECK-NEXT: lxv v2, 0(r3)
961 ; CHECK-NEXT: xscvqpswz v2, v2
962 ; CHECK-NEXT: mfvsrwz r3, v2
965 ; CHECK-P8-LABEL: qpConv2uhw:
966 ; CHECK-P8: # %bb.0: # %entry
967 ; CHECK-P8-NEXT: mflr r0
968 ; CHECK-P8-NEXT: stdu r1, -32(r1)
969 ; CHECK-P8-NEXT: std r0, 48(r1)
970 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
971 ; CHECK-P8-NEXT: .cfi_offset lr, 16
972 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
973 ; CHECK-P8-NEXT: xxswapd v2, vs0
974 ; CHECK-P8-NEXT: bl __fixkfsi
976 ; CHECK-P8-NEXT: addi r1, r1, 32
977 ; CHECK-P8-NEXT: ld r0, 16(r1)
978 ; CHECK-P8-NEXT: mtlr r0
981 %0 = load fp128, ptr %a, align 16
982 %conv = fptoui fp128 %0 to i16
986 ; Function Attrs: norecurse nounwind
987 define void @qpConv2uhw_02(ptr nocapture %res) {
988 ; CHECK-LABEL: qpConv2uhw_02:
989 ; CHECK: # %bb.0: # %entry
990 ; CHECK-NEXT: addis r4, r2, .LC0@toc@ha
991 ; CHECK-NEXT: ld r4, .LC0@toc@l(r4)
992 ; CHECK-NEXT: lxv v2, 32(r4)
993 ; CHECK-NEXT: xscvqpudz v2, v2
994 ; CHECK-NEXT: stxsihx v2, 0, r3
997 ; CHECK-P8-LABEL: qpConv2uhw_02:
998 ; CHECK-P8: # %bb.0: # %entry
999 ; CHECK-P8-NEXT: mflr r0
1000 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1001 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1002 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1003 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1004 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1005 ; CHECK-P8-NEXT: mr r30, r3
1006 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
1007 ; CHECK-P8-NEXT: std r0, 64(r1)
1008 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
1009 ; CHECK-P8-NEXT: addi r3, r3, 32
1010 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1011 ; CHECK-P8-NEXT: xxswapd v2, vs0
1012 ; CHECK-P8-NEXT: bl __fixkfsi
1013 ; CHECK-P8-NEXT: nop
1014 ; CHECK-P8-NEXT: sth r3, 0(r30)
1015 ; CHECK-P8-NEXT: addi r1, r1, 48
1016 ; CHECK-P8-NEXT: ld r0, 16(r1)
1017 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1018 ; CHECK-P8-NEXT: mtlr r0
1019 ; CHECK-P8-NEXT: blr
1021 %0 = load fp128, ptr getelementptr inbounds
1022 ([4 x fp128], ptr @f128Array,
1023 i64 0, i64 2), align 16
1024 %conv = fptoui fp128 %0 to i16
1025 store i16 %conv, ptr %res, align 2
1029 ; Function Attrs: norecurse nounwind readonly
1030 define zeroext i16 @qpConv2uhw_03(ptr nocapture readonly %a) {
1031 ; CHECK-LABEL: qpConv2uhw_03:
1032 ; CHECK: # %bb.0: # %entry
1033 ; CHECK-NEXT: lxv v2, 0(r3)
1034 ; CHECK-NEXT: addis r3, r2, .LC0@toc@ha
1035 ; CHECK-NEXT: ld r3, .LC0@toc@l(r3)
1036 ; CHECK-NEXT: lxv v3, 16(r3)
1037 ; CHECK-NEXT: xsaddqp v2, v2, v3
1038 ; CHECK-NEXT: xscvqpswz v2, v2
1039 ; CHECK-NEXT: mfvsrwz r3, v2
1042 ; CHECK-P8-LABEL: qpConv2uhw_03:
1043 ; CHECK-P8: # %bb.0: # %entry
1044 ; CHECK-P8-NEXT: mflr r0
1045 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1046 ; CHECK-P8-NEXT: std r0, 48(r1)
1047 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1048 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1049 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1050 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
1051 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
1052 ; CHECK-P8-NEXT: addi r3, r3, 16
1053 ; CHECK-P8-NEXT: xxswapd v2, vs0
1054 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1055 ; CHECK-P8-NEXT: xxswapd v3, vs0
1056 ; CHECK-P8-NEXT: bl __addkf3
1057 ; CHECK-P8-NEXT: nop
1058 ; CHECK-P8-NEXT: bl __fixkfsi
1059 ; CHECK-P8-NEXT: nop
1060 ; CHECK-P8-NEXT: addi r1, r1, 32
1061 ; CHECK-P8-NEXT: ld r0, 16(r1)
1062 ; CHECK-P8-NEXT: mtlr r0
1063 ; CHECK-P8-NEXT: blr
1065 %0 = load fp128, ptr %a, align 16
1066 %1 = load fp128, ptr getelementptr inbounds
1067 ([4 x fp128], ptr @f128Array,
1068 i64 0, i64 1), align 16
1069 %add = fadd fp128 %0, %1
1070 %conv = fptoui fp128 %add to i16
1074 ; Function Attrs: norecurse nounwind
1075 define void @qpConv2uhw_04(ptr nocapture readonly %a,
1076 ; CHECK-LABEL: qpConv2uhw_04:
1077 ; CHECK: # %bb.0: # %entry
1078 ; CHECK-NEXT: lxv v2, 0(r3)
1079 ; CHECK-NEXT: lxv v3, 0(r4)
1080 ; CHECK-NEXT: xsaddqp v2, v2, v3
1081 ; CHECK-NEXT: xscvqpudz v2, v2
1082 ; CHECK-NEXT: stxsihx v2, 0, r5
1085 ; CHECK-P8-LABEL: qpConv2uhw_04:
1086 ; CHECK-P8: # %bb.0: # %entry
1087 ; CHECK-P8-NEXT: mflr r0
1088 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1089 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1090 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1091 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1092 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1093 ; CHECK-P8-NEXT: std r0, 64(r1)
1094 ; CHECK-P8-NEXT: mr r30, r5
1095 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1096 ; CHECK-P8-NEXT: xxswapd v2, vs0
1097 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r4
1098 ; CHECK-P8-NEXT: xxswapd v3, vs0
1099 ; CHECK-P8-NEXT: bl __addkf3
1100 ; CHECK-P8-NEXT: nop
1101 ; CHECK-P8-NEXT: bl __fixkfsi
1102 ; CHECK-P8-NEXT: nop
1103 ; CHECK-P8-NEXT: sth r3, 0(r30)
1104 ; CHECK-P8-NEXT: addi r1, r1, 48
1105 ; CHECK-P8-NEXT: ld r0, 16(r1)
1106 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1107 ; CHECK-P8-NEXT: mtlr r0
1108 ; CHECK-P8-NEXT: blr
1109 ptr nocapture readonly %b, ptr nocapture %res) {
1111 %0 = load fp128, ptr %a, align 16
1112 %1 = load fp128, ptr %b, align 16
1113 %add = fadd fp128 %0, %1
1114 %conv = fptoui fp128 %add to i16
1115 store i16 %conv, ptr %res, align 2
1119 ; Function Attrs: norecurse nounwind readonly
1120 define signext i8 @qpConv2sb(ptr nocapture readonly %a) {
1121 ; CHECK-LABEL: qpConv2sb:
1122 ; CHECK: # %bb.0: # %entry
1123 ; CHECK-NEXT: lxv v2, 0(r3)
1124 ; CHECK-NEXT: xscvqpswz v2, v2
1125 ; CHECK-NEXT: mfvsrwz r3, v2
1126 ; CHECK-NEXT: extsw r3, r3
1129 ; CHECK-P8-LABEL: qpConv2sb:
1130 ; CHECK-P8: # %bb.0: # %entry
1131 ; CHECK-P8-NEXT: mflr r0
1132 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1133 ; CHECK-P8-NEXT: std r0, 48(r1)
1134 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1135 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1136 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1137 ; CHECK-P8-NEXT: xxswapd v2, vs0
1138 ; CHECK-P8-NEXT: bl __fixkfsi
1139 ; CHECK-P8-NEXT: nop
1140 ; CHECK-P8-NEXT: extsw r3, r3
1141 ; CHECK-P8-NEXT: addi r1, r1, 32
1142 ; CHECK-P8-NEXT: ld r0, 16(r1)
1143 ; CHECK-P8-NEXT: mtlr r0
1144 ; CHECK-P8-NEXT: blr
1146 %0 = load fp128, ptr %a, align 16
1147 %conv = fptosi fp128 %0 to i8
1151 ; Function Attrs: norecurse nounwind
1152 define void @qpConv2sb_02(ptr nocapture %res) {
1153 ; CHECK-LABEL: qpConv2sb_02:
1154 ; CHECK: # %bb.0: # %entry
1155 ; CHECK-NEXT: addis r4, r2, .LC0@toc@ha
1156 ; CHECK-NEXT: ld r4, .LC0@toc@l(r4)
1157 ; CHECK-NEXT: lxv v2, 32(r4)
1158 ; CHECK-NEXT: xscvqpsdz v2, v2
1159 ; CHECK-NEXT: stxsibx v2, 0, r3
1162 ; CHECK-P8-LABEL: qpConv2sb_02:
1163 ; CHECK-P8: # %bb.0: # %entry
1164 ; CHECK-P8-NEXT: mflr r0
1165 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1166 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1167 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1168 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1169 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1170 ; CHECK-P8-NEXT: mr r30, r3
1171 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
1172 ; CHECK-P8-NEXT: std r0, 64(r1)
1173 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
1174 ; CHECK-P8-NEXT: addi r3, r3, 32
1175 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1176 ; CHECK-P8-NEXT: xxswapd v2, vs0
1177 ; CHECK-P8-NEXT: bl __fixkfsi
1178 ; CHECK-P8-NEXT: nop
1179 ; CHECK-P8-NEXT: stb r3, 0(r30)
1180 ; CHECK-P8-NEXT: addi r1, r1, 48
1181 ; CHECK-P8-NEXT: ld r0, 16(r1)
1182 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1183 ; CHECK-P8-NEXT: mtlr r0
1184 ; CHECK-P8-NEXT: blr
1186 %0 = load fp128, ptr getelementptr inbounds
1187 ([4 x fp128], ptr @f128Array,
1188 i64 0, i64 2), align 16
1189 %conv = fptosi fp128 %0 to i8
1190 store i8 %conv, ptr %res, align 1
1194 ; Function Attrs: norecurse nounwind readonly
1195 define signext i8 @qpConv2sb_03(ptr nocapture readonly %a) {
1196 ; CHECK-LABEL: qpConv2sb_03:
1197 ; CHECK: # %bb.0: # %entry
1198 ; CHECK-NEXT: lxv v2, 0(r3)
1199 ; CHECK-NEXT: addis r3, r2, .LC0@toc@ha
1200 ; CHECK-NEXT: ld r3, .LC0@toc@l(r3)
1201 ; CHECK-NEXT: lxv v3, 16(r3)
1202 ; CHECK-NEXT: xsaddqp v2, v2, v3
1203 ; CHECK-NEXT: xscvqpswz v2, v2
1204 ; CHECK-NEXT: mfvsrwz r3, v2
1205 ; CHECK-NEXT: extsw r3, r3
1208 ; CHECK-P8-LABEL: qpConv2sb_03:
1209 ; CHECK-P8: # %bb.0: # %entry
1210 ; CHECK-P8-NEXT: mflr r0
1211 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1212 ; CHECK-P8-NEXT: std r0, 48(r1)
1213 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1214 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1215 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1216 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
1217 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
1218 ; CHECK-P8-NEXT: addi r3, r3, 16
1219 ; CHECK-P8-NEXT: xxswapd v2, vs0
1220 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1221 ; CHECK-P8-NEXT: xxswapd v3, vs0
1222 ; CHECK-P8-NEXT: bl __addkf3
1223 ; CHECK-P8-NEXT: nop
1224 ; CHECK-P8-NEXT: bl __fixkfsi
1225 ; CHECK-P8-NEXT: nop
1226 ; CHECK-P8-NEXT: extsw r3, r3
1227 ; CHECK-P8-NEXT: addi r1, r1, 32
1228 ; CHECK-P8-NEXT: ld r0, 16(r1)
1229 ; CHECK-P8-NEXT: mtlr r0
1230 ; CHECK-P8-NEXT: blr
1232 %0 = load fp128, ptr %a, align 16
1233 %1 = load fp128, ptr getelementptr inbounds
1234 ([4 x fp128], ptr @f128Array,
1235 i64 0, i64 1), align 16
1236 %add = fadd fp128 %0, %1
1237 %conv = fptosi fp128 %add to i8
1241 ; Function Attrs: norecurse nounwind
1242 define void @qpConv2sb_04(ptr nocapture readonly %a,
1243 ; CHECK-LABEL: qpConv2sb_04:
1244 ; CHECK: # %bb.0: # %entry
1245 ; CHECK-NEXT: lxv v2, 0(r3)
1246 ; CHECK-NEXT: lxv v3, 0(r4)
1247 ; CHECK-NEXT: xsaddqp v2, v2, v3
1248 ; CHECK-NEXT: xscvqpsdz v2, v2
1249 ; CHECK-NEXT: stxsibx v2, 0, r5
1252 ; CHECK-P8-LABEL: qpConv2sb_04:
1253 ; CHECK-P8: # %bb.0: # %entry
1254 ; CHECK-P8-NEXT: mflr r0
1255 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1256 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1257 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1258 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1259 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1260 ; CHECK-P8-NEXT: std r0, 64(r1)
1261 ; CHECK-P8-NEXT: mr r30, r5
1262 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1263 ; CHECK-P8-NEXT: xxswapd v2, vs0
1264 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r4
1265 ; CHECK-P8-NEXT: xxswapd v3, vs0
1266 ; CHECK-P8-NEXT: bl __addkf3
1267 ; CHECK-P8-NEXT: nop
1268 ; CHECK-P8-NEXT: bl __fixkfsi
1269 ; CHECK-P8-NEXT: nop
1270 ; CHECK-P8-NEXT: stb r3, 0(r30)
1271 ; CHECK-P8-NEXT: addi r1, r1, 48
1272 ; CHECK-P8-NEXT: ld r0, 16(r1)
1273 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1274 ; CHECK-P8-NEXT: mtlr r0
1275 ; CHECK-P8-NEXT: blr
1276 ptr nocapture readonly %b, ptr nocapture %res) {
1278 %0 = load fp128, ptr %a, align 16
1279 %1 = load fp128, ptr %b, align 16
1280 %add = fadd fp128 %0, %1
1281 %conv = fptosi fp128 %add to i8
1282 store i8 %conv, ptr %res, align 1
1286 ; Function Attrs: norecurse nounwind readonly
1287 define zeroext i8 @qpConv2ub(ptr nocapture readonly %a) {
1288 ; CHECK-LABEL: qpConv2ub:
1289 ; CHECK: # %bb.0: # %entry
1290 ; CHECK-NEXT: lxv v2, 0(r3)
1291 ; CHECK-NEXT: xscvqpswz v2, v2
1292 ; CHECK-NEXT: mfvsrwz r3, v2
1295 ; CHECK-P8-LABEL: qpConv2ub:
1296 ; CHECK-P8: # %bb.0: # %entry
1297 ; CHECK-P8-NEXT: mflr r0
1298 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1299 ; CHECK-P8-NEXT: std r0, 48(r1)
1300 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1301 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1302 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1303 ; CHECK-P8-NEXT: xxswapd v2, vs0
1304 ; CHECK-P8-NEXT: bl __fixkfsi
1305 ; CHECK-P8-NEXT: nop
1306 ; CHECK-P8-NEXT: addi r1, r1, 32
1307 ; CHECK-P8-NEXT: ld r0, 16(r1)
1308 ; CHECK-P8-NEXT: mtlr r0
1309 ; CHECK-P8-NEXT: blr
1311 %0 = load fp128, ptr %a, align 16
1312 %conv = fptoui fp128 %0 to i8
1316 ; Function Attrs: norecurse nounwind
1317 define void @qpConv2ub_02(ptr nocapture %res) {
1318 ; CHECK-LABEL: qpConv2ub_02:
1319 ; CHECK: # %bb.0: # %entry
1320 ; CHECK-NEXT: addis r4, r2, .LC0@toc@ha
1321 ; CHECK-NEXT: ld r4, .LC0@toc@l(r4)
1322 ; CHECK-NEXT: lxv v2, 32(r4)
1323 ; CHECK-NEXT: xscvqpudz v2, v2
1324 ; CHECK-NEXT: stxsibx v2, 0, r3
1327 ; CHECK-P8-LABEL: qpConv2ub_02:
1328 ; CHECK-P8: # %bb.0: # %entry
1329 ; CHECK-P8-NEXT: mflr r0
1330 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1331 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1332 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1333 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1334 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1335 ; CHECK-P8-NEXT: mr r30, r3
1336 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
1337 ; CHECK-P8-NEXT: std r0, 64(r1)
1338 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
1339 ; CHECK-P8-NEXT: addi r3, r3, 32
1340 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1341 ; CHECK-P8-NEXT: xxswapd v2, vs0
1342 ; CHECK-P8-NEXT: bl __fixkfsi
1343 ; CHECK-P8-NEXT: nop
1344 ; CHECK-P8-NEXT: stb r3, 0(r30)
1345 ; CHECK-P8-NEXT: addi r1, r1, 48
1346 ; CHECK-P8-NEXT: ld r0, 16(r1)
1347 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1348 ; CHECK-P8-NEXT: mtlr r0
1349 ; CHECK-P8-NEXT: blr
1351 %0 = load fp128, ptr getelementptr inbounds
1352 ([4 x fp128], ptr @f128Array,
1353 i64 0, i64 2), align 16
1354 %conv = fptoui fp128 %0 to i8
1355 store i8 %conv, ptr %res, align 1
1359 ; Function Attrs: norecurse nounwind readonly
1360 define zeroext i8 @qpConv2ub_03(ptr nocapture readonly %a) {
1361 ; CHECK-LABEL: qpConv2ub_03:
1362 ; CHECK: # %bb.0: # %entry
1363 ; CHECK-NEXT: lxv v2, 0(r3)
1364 ; CHECK-NEXT: addis r3, r2, .LC0@toc@ha
1365 ; CHECK-NEXT: ld r3, .LC0@toc@l(r3)
1366 ; CHECK-NEXT: lxv v3, 16(r3)
1367 ; CHECK-NEXT: xsaddqp v2, v2, v3
1368 ; CHECK-NEXT: xscvqpswz v2, v2
1369 ; CHECK-NEXT: mfvsrwz r3, v2
1372 ; CHECK-P8-LABEL: qpConv2ub_03:
1373 ; CHECK-P8: # %bb.0: # %entry
1374 ; CHECK-P8-NEXT: mflr r0
1375 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1376 ; CHECK-P8-NEXT: std r0, 48(r1)
1377 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1378 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1379 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1380 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
1381 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
1382 ; CHECK-P8-NEXT: addi r3, r3, 16
1383 ; CHECK-P8-NEXT: xxswapd v2, vs0
1384 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1385 ; CHECK-P8-NEXT: xxswapd v3, vs0
1386 ; CHECK-P8-NEXT: bl __addkf3
1387 ; CHECK-P8-NEXT: nop
1388 ; CHECK-P8-NEXT: bl __fixkfsi
1389 ; CHECK-P8-NEXT: nop
1390 ; CHECK-P8-NEXT: addi r1, r1, 32
1391 ; CHECK-P8-NEXT: ld r0, 16(r1)
1392 ; CHECK-P8-NEXT: mtlr r0
1393 ; CHECK-P8-NEXT: blr
1395 %0 = load fp128, ptr %a, align 16
1396 %1 = load fp128, ptr getelementptr inbounds
1397 ([4 x fp128], ptr @f128Array,
1398 i64 0, i64 1), align 16
1399 %add = fadd fp128 %0, %1
1400 %conv = fptoui fp128 %add to i8
1404 ; Function Attrs: norecurse nounwind
1405 define void @qpConv2ub_04(ptr nocapture readonly %a,
1406 ; CHECK-LABEL: qpConv2ub_04:
1407 ; CHECK: # %bb.0: # %entry
1408 ; CHECK-NEXT: lxv v2, 0(r3)
1409 ; CHECK-NEXT: lxv v3, 0(r4)
1410 ; CHECK-NEXT: xsaddqp v2, v2, v3
1411 ; CHECK-NEXT: xscvqpudz v2, v2
1412 ; CHECK-NEXT: stxsibx v2, 0, r5
1415 ; CHECK-P8-LABEL: qpConv2ub_04:
1416 ; CHECK-P8: # %bb.0: # %entry
1417 ; CHECK-P8-NEXT: mflr r0
1418 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1419 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1420 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1421 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1422 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1423 ; CHECK-P8-NEXT: std r0, 64(r1)
1424 ; CHECK-P8-NEXT: mr r30, r5
1425 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1426 ; CHECK-P8-NEXT: xxswapd v2, vs0
1427 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r4
1428 ; CHECK-P8-NEXT: xxswapd v3, vs0
1429 ; CHECK-P8-NEXT: bl __addkf3
1430 ; CHECK-P8-NEXT: nop
1431 ; CHECK-P8-NEXT: bl __fixkfsi
1432 ; CHECK-P8-NEXT: nop
1433 ; CHECK-P8-NEXT: stb r3, 0(r30)
1434 ; CHECK-P8-NEXT: addi r1, r1, 48
1435 ; CHECK-P8-NEXT: ld r0, 16(r1)
1436 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1437 ; CHECK-P8-NEXT: mtlr r0
1438 ; CHECK-P8-NEXT: blr
1439 ptr nocapture readonly %b, ptr nocapture %res) {
1441 %0 = load fp128, ptr %a, align 16
1442 %1 = load fp128, ptr %b, align 16
1443 %add = fadd fp128 %0, %1
1444 %conv = fptoui fp128 %add to i8
1445 store i8 %conv, ptr %res, align 1
1449 define void @qpConvppcf128(fp128 %src, ptr %dst) {
1450 ; CHECK-LABEL: qpConvppcf128:
1451 ; CHECK: # %bb.0: # %entry
1452 ; CHECK-NEXT: mflr r0
1453 ; CHECK-NEXT: .cfi_def_cfa_offset 48
1454 ; CHECK-NEXT: .cfi_offset lr, 16
1455 ; CHECK-NEXT: .cfi_offset r30, -16
1456 ; CHECK-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1457 ; CHECK-NEXT: stdu r1, -48(r1)
1458 ; CHECK-NEXT: std r0, 64(r1)
1459 ; CHECK-NEXT: mr r30, r5
1460 ; CHECK-NEXT: bl __extendkftf2
1462 ; CHECK-NEXT: stfd f2, 8(r30)
1463 ; CHECK-NEXT: stfd f1, 0(r30)
1464 ; CHECK-NEXT: addi r1, r1, 48
1465 ; CHECK-NEXT: ld r0, 16(r1)
1466 ; CHECK-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1467 ; CHECK-NEXT: mtlr r0
1470 ; CHECK-P8-LABEL: qpConvppcf128:
1471 ; CHECK-P8: # %bb.0: # %entry
1472 ; CHECK-P8-NEXT: mflr r0
1473 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1474 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1475 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1476 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1477 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1478 ; CHECK-P8-NEXT: std r0, 64(r1)
1479 ; CHECK-P8-NEXT: mr r30, r5
1480 ; CHECK-P8-NEXT: bl __extendkftf2
1481 ; CHECK-P8-NEXT: nop
1482 ; CHECK-P8-NEXT: stfd f2, 8(r30)
1483 ; CHECK-P8-NEXT: stfd f1, 0(r30)
1484 ; CHECK-P8-NEXT: addi r1, r1, 48
1485 ; CHECK-P8-NEXT: ld r0, 16(r1)
1486 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1487 ; CHECK-P8-NEXT: mtlr r0
1488 ; CHECK-P8-NEXT: blr
1490 %res = call ppc_fp128 @llvm.ppc.convert.f128.to.ppcf128(fp128 %src)
1491 store ppc_fp128 %res, ptr %dst, align 16
1495 define void @ppcf128Convqp(ppc_fp128 %src, ptr %dst) {
1496 ; CHECK-LABEL: ppcf128Convqp:
1497 ; CHECK: # %bb.0: # %entry
1498 ; CHECK-NEXT: mflr r0
1499 ; CHECK-NEXT: .cfi_def_cfa_offset 48
1500 ; CHECK-NEXT: .cfi_offset lr, 16
1501 ; CHECK-NEXT: .cfi_offset r30, -16
1502 ; CHECK-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1503 ; CHECK-NEXT: stdu r1, -48(r1)
1504 ; CHECK-NEXT: std r0, 64(r1)
1505 ; CHECK-NEXT: mr r30, r5
1506 ; CHECK-NEXT: bl __trunctfkf2
1508 ; CHECK-NEXT: stxv v2, 0(r30)
1509 ; CHECK-NEXT: addi r1, r1, 48
1510 ; CHECK-NEXT: ld r0, 16(r1)
1511 ; CHECK-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1512 ; CHECK-NEXT: mtlr r0
1515 ; CHECK-P8-LABEL: ppcf128Convqp:
1516 ; CHECK-P8: # %bb.0: # %entry
1517 ; CHECK-P8-NEXT: mflr r0
1518 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1519 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1520 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1521 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1522 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1523 ; CHECK-P8-NEXT: std r0, 64(r1)
1524 ; CHECK-P8-NEXT: mr r30, r5
1525 ; CHECK-P8-NEXT: bl __trunctfkf2
1526 ; CHECK-P8-NEXT: nop
1527 ; CHECK-P8-NEXT: xxswapd vs0, v2
1528 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
1529 ; CHECK-P8-NEXT: addi r1, r1, 48
1530 ; CHECK-P8-NEXT: ld r0, 16(r1)
1531 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1532 ; CHECK-P8-NEXT: mtlr r0
1533 ; CHECK-P8-NEXT: blr
1535 %res = call fp128 @llvm.ppc.convert.ppcf128.to.f128(ppc_fp128 %src)
1536 store fp128 %res, ptr %dst, align 16
1540 declare ppc_fp128 @llvm.ppc.convert.f128.to.ppcf128(fp128)
1541 declare fp128 @llvm.ppc.convert.ppcf128.to.f128(ppc_fp128)