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: -ppc-vsr-nums-as-vr -verify-machineinstrs -ppc-asm-full-reg-names < %s \
5 ; RUN: llc -relocation-model=pic -mcpu=pwr8 -mtriple=powerpc64le-unknown-unknown \
6 ; RUN: -ppc-vsr-nums-as-vr -verify-machineinstrs -ppc-asm-full-reg-names < %s \
7 ; RUN: | FileCheck %s -check-prefix=CHECK-P8
9 @mem = global [5 x i64] [i64 56, i64 63, i64 3, i64 5, i64 6], align 8
10 @umem = global [5 x i64] [i64 560, i64 100, i64 34, i64 2, i64 5], align 8
11 @swMem = global [5 x i32] [i32 5, i32 2, i32 3, i32 4, i32 0], align 4
12 @uwMem = global [5 x i32] [i32 5, i32 2, i32 3, i32 4, i32 0], align 4
13 @uhwMem = local_unnamed_addr global [5 x i16] [i16 5, i16 2, i16 3, i16 4, i16 0], align 2
14 @ubMem = local_unnamed_addr global [5 x i8] c"\05\02\03\04\00", align 1
16 ; Function Attrs: norecurse nounwind
17 define void @sdwConv2qp(ptr nocapture %a, i64 %b) {
18 ; CHECK-LABEL: sdwConv2qp:
19 ; CHECK: # %bb.0: # %entry
20 ; CHECK-NEXT: mtvsrd v2, r4
21 ; CHECK-NEXT: xscvsdqp v2, v2
22 ; CHECK-NEXT: stxv v2, 0(r3)
25 ; CHECK-P8-LABEL: sdwConv2qp:
26 ; CHECK-P8: # %bb.0: # %entry
27 ; CHECK-P8-NEXT: mflr r0
28 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
29 ; CHECK-P8-NEXT: .cfi_offset lr, 16
30 ; CHECK-P8-NEXT: .cfi_offset r30, -16
31 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
32 ; CHECK-P8-NEXT: stdu r1, -48(r1)
33 ; CHECK-P8-NEXT: mr r30, r3
34 ; CHECK-P8-NEXT: mr r3, r4
35 ; CHECK-P8-NEXT: std r0, 64(r1)
36 ; CHECK-P8-NEXT: bl __floatdikf
38 ; CHECK-P8-NEXT: xxswapd vs0, v2
39 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
40 ; CHECK-P8-NEXT: addi r1, r1, 48
41 ; CHECK-P8-NEXT: ld r0, 16(r1)
42 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
43 ; CHECK-P8-NEXT: mtlr r0
46 %conv = sitofp i64 %b to fp128
47 store fp128 %conv, ptr %a, align 16
52 ; Function Attrs: norecurse nounwind
53 define void @sdwConv2qp_01(ptr nocapture %a, i128 %b) {
54 ; CHECK-LABEL: sdwConv2qp_01:
55 ; CHECK: # %bb.0: # %entry
57 ; CHECK-NEXT: .cfi_def_cfa_offset 48
58 ; CHECK-NEXT: .cfi_offset lr, 16
59 ; CHECK-NEXT: .cfi_offset r30, -16
60 ; CHECK-NEXT: std r30, -16(r1) # 8-byte Folded Spill
61 ; CHECK-NEXT: stdu r1, -48(r1)
62 ; CHECK-NEXT: mr r30, r3
63 ; CHECK-NEXT: mr r3, r4
64 ; CHECK-NEXT: mr r4, r5
65 ; CHECK-NEXT: std r0, 64(r1)
66 ; CHECK-NEXT: bl __floattikf
68 ; CHECK-NEXT: stxv v2, 0(r30)
69 ; CHECK-NEXT: addi r1, r1, 48
70 ; CHECK-NEXT: ld r0, 16(r1)
71 ; CHECK-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
75 ; CHECK-P8-LABEL: sdwConv2qp_01:
76 ; CHECK-P8: # %bb.0: # %entry
77 ; CHECK-P8-NEXT: mflr r0
78 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
79 ; CHECK-P8-NEXT: .cfi_offset lr, 16
80 ; CHECK-P8-NEXT: .cfi_offset r30, -16
81 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
82 ; CHECK-P8-NEXT: stdu r1, -48(r1)
83 ; CHECK-P8-NEXT: mr r30, r3
84 ; CHECK-P8-NEXT: mr r3, r4
85 ; CHECK-P8-NEXT: std r0, 64(r1)
86 ; CHECK-P8-NEXT: mr r4, r5
87 ; CHECK-P8-NEXT: bl __floattikf
89 ; CHECK-P8-NEXT: xxswapd vs0, v2
90 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
91 ; CHECK-P8-NEXT: addi r1, r1, 48
92 ; CHECK-P8-NEXT: ld r0, 16(r1)
93 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
94 ; CHECK-P8-NEXT: mtlr r0
97 %conv = sitofp i128 %b to fp128
98 store fp128 %conv, ptr %a, align 16
103 ; Function Attrs: norecurse nounwind
104 define void @sdwConv2qp_02(ptr nocapture %a) {
105 ; CHECK-LABEL: sdwConv2qp_02:
106 ; CHECK: # %bb.0: # %entry
107 ; CHECK-NEXT: addis r4, r2, .LC0@toc@ha
108 ; CHECK-NEXT: ld r4, .LC0@toc@l(r4)
109 ; CHECK-NEXT: lxsd v2, 16(r4)
110 ; CHECK-NEXT: xscvsdqp v2, v2
111 ; CHECK-NEXT: stxv v2, 0(r3)
114 ; CHECK-P8-LABEL: sdwConv2qp_02:
115 ; CHECK-P8: # %bb.0: # %entry
116 ; CHECK-P8-NEXT: mflr r0
117 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
118 ; CHECK-P8-NEXT: .cfi_offset lr, 16
119 ; CHECK-P8-NEXT: .cfi_offset r30, -16
120 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
121 ; CHECK-P8-NEXT: stdu r1, -48(r1)
122 ; CHECK-P8-NEXT: mr r30, r3
123 ; CHECK-P8-NEXT: addis r3, r2, .LC0@toc@ha
124 ; CHECK-P8-NEXT: std r0, 64(r1)
125 ; CHECK-P8-NEXT: ld r3, .LC0@toc@l(r3)
126 ; CHECK-P8-NEXT: ld r3, 16(r3)
127 ; CHECK-P8-NEXT: bl __floatdikf
129 ; CHECK-P8-NEXT: xxswapd vs0, v2
130 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
131 ; CHECK-P8-NEXT: addi r1, r1, 48
132 ; CHECK-P8-NEXT: ld r0, 16(r1)
133 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
134 ; CHECK-P8-NEXT: mtlr r0
137 %0 = load i64, ptr getelementptr inbounds
138 ([5 x i64], ptr @mem, i64 0, i64 2), align 8
139 %conv = sitofp i64 %0 to fp128
140 store fp128 %conv, ptr %a, align 16
145 ; Function Attrs: norecurse nounwind
146 define void @sdwConv2qp_03(ptr nocapture %a, ptr nocapture readonly %b) {
147 ; CHECK-LABEL: sdwConv2qp_03:
148 ; CHECK: # %bb.0: # %entry
149 ; CHECK-NEXT: lxsd v2, 0(r4)
150 ; CHECK-NEXT: xscvsdqp v2, v2
151 ; CHECK-NEXT: stxv v2, 0(r3)
154 ; CHECK-P8-LABEL: sdwConv2qp_03:
155 ; CHECK-P8: # %bb.0: # %entry
156 ; CHECK-P8-NEXT: mflr r0
157 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
158 ; CHECK-P8-NEXT: .cfi_offset lr, 16
159 ; CHECK-P8-NEXT: .cfi_offset r30, -16
160 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
161 ; CHECK-P8-NEXT: stdu r1, -48(r1)
162 ; CHECK-P8-NEXT: std r0, 64(r1)
163 ; CHECK-P8-NEXT: mr r30, r3
164 ; CHECK-P8-NEXT: ld r3, 0(r4)
165 ; CHECK-P8-NEXT: bl __floatdikf
167 ; CHECK-P8-NEXT: xxswapd vs0, v2
168 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
169 ; CHECK-P8-NEXT: addi r1, r1, 48
170 ; CHECK-P8-NEXT: ld r0, 16(r1)
171 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
172 ; CHECK-P8-NEXT: mtlr r0
175 %0 = load i64, ptr %b, align 8
176 %conv = sitofp i64 %0 to fp128
177 store fp128 %conv, ptr %a, align 16
182 ; Function Attrs: norecurse nounwind
183 define void @sdwConv2qp_04(ptr nocapture %a, i1 %b) {
184 ; CHECK-LABEL: sdwConv2qp_04:
185 ; CHECK: # %bb.0: # %entry
186 ; CHECK-NEXT: andi. r4, r4, 1
187 ; CHECK-NEXT: li r4, 0
188 ; CHECK-NEXT: li r5, -1
189 ; CHECK-NEXT: iselgt r4, r5, r4
190 ; CHECK-NEXT: mtvsrwa v2, r4
191 ; CHECK-NEXT: xscvsdqp v2, v2
192 ; CHECK-NEXT: stxv v2, 0(r3)
195 ; CHECK-P8-LABEL: sdwConv2qp_04:
196 ; CHECK-P8: # %bb.0: # %entry
197 ; CHECK-P8-NEXT: mflr r0
198 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
199 ; CHECK-P8-NEXT: .cfi_offset lr, 16
200 ; CHECK-P8-NEXT: .cfi_offset r30, -16
201 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
202 ; CHECK-P8-NEXT: stdu r1, -48(r1)
203 ; CHECK-P8-NEXT: mr r30, r3
204 ; CHECK-P8-NEXT: andi. r3, r4, 1
205 ; CHECK-P8-NEXT: li r3, 0
206 ; CHECK-P8-NEXT: li r4, -1
207 ; CHECK-P8-NEXT: std r0, 64(r1)
208 ; CHECK-P8-NEXT: iselgt r3, r4, r3
209 ; CHECK-P8-NEXT: bl __floatsikf
211 ; CHECK-P8-NEXT: xxswapd vs0, v2
212 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
213 ; CHECK-P8-NEXT: addi r1, r1, 48
214 ; CHECK-P8-NEXT: ld r0, 16(r1)
215 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
216 ; CHECK-P8-NEXT: mtlr r0
219 %conv = sitofp i1 %b to fp128
220 store fp128 %conv, ptr %a, align 16
225 ; Function Attrs: norecurse nounwind
226 define void @udwConv2qp(ptr nocapture %a, i64 %b) {
227 ; CHECK-LABEL: udwConv2qp:
228 ; CHECK: # %bb.0: # %entry
229 ; CHECK-NEXT: mtvsrd v2, r4
230 ; CHECK-NEXT: xscvudqp v2, v2
231 ; CHECK-NEXT: stxv v2, 0(r3)
234 ; CHECK-P8-LABEL: udwConv2qp:
235 ; CHECK-P8: # %bb.0: # %entry
236 ; CHECK-P8-NEXT: mflr r0
237 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
238 ; CHECK-P8-NEXT: .cfi_offset lr, 16
239 ; CHECK-P8-NEXT: .cfi_offset r30, -16
240 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
241 ; CHECK-P8-NEXT: stdu r1, -48(r1)
242 ; CHECK-P8-NEXT: mr r30, r3
243 ; CHECK-P8-NEXT: mr r3, r4
244 ; CHECK-P8-NEXT: std r0, 64(r1)
245 ; CHECK-P8-NEXT: bl __floatundikf
247 ; CHECK-P8-NEXT: xxswapd vs0, v2
248 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
249 ; CHECK-P8-NEXT: addi r1, r1, 48
250 ; CHECK-P8-NEXT: ld r0, 16(r1)
251 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
252 ; CHECK-P8-NEXT: mtlr r0
255 %conv = uitofp i64 %b to fp128
256 store fp128 %conv, ptr %a, align 16
261 ; Function Attrs: norecurse nounwind
262 define void @udwConv2qp_01(ptr nocapture %a, i128 %b) {
263 ; CHECK-LABEL: udwConv2qp_01:
264 ; CHECK: # %bb.0: # %entry
265 ; CHECK-NEXT: mflr r0
266 ; CHECK-NEXT: .cfi_def_cfa_offset 48
267 ; CHECK-NEXT: .cfi_offset lr, 16
268 ; CHECK-NEXT: .cfi_offset r30, -16
269 ; CHECK-NEXT: std r30, -16(r1) # 8-byte Folded Spill
270 ; CHECK-NEXT: stdu r1, -48(r1)
271 ; CHECK-NEXT: mr r30, r3
272 ; CHECK-NEXT: mr r3, r4
273 ; CHECK-NEXT: mr r4, r5
274 ; CHECK-NEXT: std r0, 64(r1)
275 ; CHECK-NEXT: bl __floatuntikf
277 ; CHECK-NEXT: stxv v2, 0(r30)
278 ; CHECK-NEXT: addi r1, r1, 48
279 ; CHECK-NEXT: ld r0, 16(r1)
280 ; CHECK-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
281 ; CHECK-NEXT: mtlr r0
284 ; CHECK-P8-LABEL: udwConv2qp_01:
285 ; CHECK-P8: # %bb.0: # %entry
286 ; CHECK-P8-NEXT: mflr r0
287 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
288 ; CHECK-P8-NEXT: .cfi_offset lr, 16
289 ; CHECK-P8-NEXT: .cfi_offset r30, -16
290 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
291 ; CHECK-P8-NEXT: stdu r1, -48(r1)
292 ; CHECK-P8-NEXT: mr r30, r3
293 ; CHECK-P8-NEXT: mr r3, r4
294 ; CHECK-P8-NEXT: std r0, 64(r1)
295 ; CHECK-P8-NEXT: mr r4, r5
296 ; CHECK-P8-NEXT: bl __floatuntikf
298 ; CHECK-P8-NEXT: xxswapd vs0, v2
299 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
300 ; CHECK-P8-NEXT: addi r1, r1, 48
301 ; CHECK-P8-NEXT: ld r0, 16(r1)
302 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
303 ; CHECK-P8-NEXT: mtlr r0
306 %conv = uitofp i128 %b to fp128
307 store fp128 %conv, ptr %a, align 16
312 ; Function Attrs: norecurse nounwind
313 define void @udwConv2qp_02(ptr nocapture %a) {
314 ; CHECK-LABEL: udwConv2qp_02:
315 ; CHECK: # %bb.0: # %entry
316 ; CHECK-NEXT: addis r4, r2, .LC1@toc@ha
317 ; CHECK-NEXT: ld r4, .LC1@toc@l(r4)
318 ; CHECK-NEXT: lxsd v2, 32(r4)
319 ; CHECK-NEXT: xscvudqp v2, v2
320 ; CHECK-NEXT: stxv v2, 0(r3)
323 ; CHECK-P8-LABEL: udwConv2qp_02:
324 ; CHECK-P8: # %bb.0: # %entry
325 ; CHECK-P8-NEXT: mflr r0
326 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
327 ; CHECK-P8-NEXT: .cfi_offset lr, 16
328 ; CHECK-P8-NEXT: .cfi_offset r30, -16
329 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
330 ; CHECK-P8-NEXT: stdu r1, -48(r1)
331 ; CHECK-P8-NEXT: mr r30, r3
332 ; CHECK-P8-NEXT: addis r3, r2, .LC1@toc@ha
333 ; CHECK-P8-NEXT: std r0, 64(r1)
334 ; CHECK-P8-NEXT: ld r3, .LC1@toc@l(r3)
335 ; CHECK-P8-NEXT: ld r3, 32(r3)
336 ; CHECK-P8-NEXT: bl __floatundikf
338 ; CHECK-P8-NEXT: xxswapd vs0, v2
339 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
340 ; CHECK-P8-NEXT: addi r1, r1, 48
341 ; CHECK-P8-NEXT: ld r0, 16(r1)
342 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
343 ; CHECK-P8-NEXT: mtlr r0
346 %0 = load i64, ptr getelementptr inbounds
347 ([5 x i64], ptr @umem, i64 0, i64 4), align 8
348 %conv = uitofp i64 %0 to fp128
349 store fp128 %conv, ptr %a, align 16
354 ; Function Attrs: norecurse nounwind
355 define void @udwConv2qp_03(ptr nocapture %a, ptr nocapture readonly %b) {
356 ; CHECK-LABEL: udwConv2qp_03:
357 ; CHECK: # %bb.0: # %entry
358 ; CHECK-NEXT: lxsd v2, 0(r4)
359 ; CHECK-NEXT: xscvudqp v2, v2
360 ; CHECK-NEXT: stxv v2, 0(r3)
363 ; CHECK-P8-LABEL: udwConv2qp_03:
364 ; CHECK-P8: # %bb.0: # %entry
365 ; CHECK-P8-NEXT: mflr r0
366 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
367 ; CHECK-P8-NEXT: .cfi_offset lr, 16
368 ; CHECK-P8-NEXT: .cfi_offset r30, -16
369 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
370 ; CHECK-P8-NEXT: stdu r1, -48(r1)
371 ; CHECK-P8-NEXT: std r0, 64(r1)
372 ; CHECK-P8-NEXT: mr r30, r3
373 ; CHECK-P8-NEXT: ld r3, 0(r4)
374 ; CHECK-P8-NEXT: bl __floatundikf
376 ; CHECK-P8-NEXT: xxswapd vs0, v2
377 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
378 ; CHECK-P8-NEXT: addi r1, r1, 48
379 ; CHECK-P8-NEXT: ld r0, 16(r1)
380 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
381 ; CHECK-P8-NEXT: mtlr r0
384 %0 = load i64, ptr %b, align 8
385 %conv = uitofp i64 %0 to fp128
386 store fp128 %conv, ptr %a, align 16
391 ; Function Attrs: norecurse nounwind
392 define void @udwConv2qp_04(ptr nocapture %a, i1 %b) {
393 ; CHECK-LABEL: udwConv2qp_04:
394 ; CHECK: # %bb.0: # %entry
395 ; CHECK-NEXT: clrlwi r4, r4, 31
396 ; CHECK-NEXT: mtvsrwa v2, r4
397 ; CHECK-NEXT: xscvsdqp v2, v2
398 ; CHECK-NEXT: stxv v2, 0(r3)
401 ; CHECK-P8-LABEL: udwConv2qp_04:
402 ; CHECK-P8: # %bb.0: # %entry
403 ; CHECK-P8-NEXT: mflr r0
404 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
405 ; CHECK-P8-NEXT: .cfi_offset lr, 16
406 ; CHECK-P8-NEXT: .cfi_offset r30, -16
407 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
408 ; CHECK-P8-NEXT: stdu r1, -48(r1)
409 ; CHECK-P8-NEXT: mr r30, r3
410 ; CHECK-P8-NEXT: clrldi r3, r4, 63
411 ; CHECK-P8-NEXT: std r0, 64(r1)
412 ; CHECK-P8-NEXT: bl __floatsikf
414 ; CHECK-P8-NEXT: xxswapd vs0, v2
415 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
416 ; CHECK-P8-NEXT: addi r1, r1, 48
417 ; CHECK-P8-NEXT: ld r0, 16(r1)
418 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
419 ; CHECK-P8-NEXT: mtlr r0
422 %conv = uitofp i1 %b to fp128
423 store fp128 %conv, ptr %a, align 16
428 ; Function Attrs: norecurse nounwind
429 define ptr @sdwConv2qp_testXForm(ptr returned %sink,
430 ; CHECK-LABEL: sdwConv2qp_testXForm:
431 ; CHECK: # %bb.0: # %entry
432 ; CHECK-NEXT: lis r5, 1
433 ; CHECK-NEXT: ori r5, r5, 7797
434 ; CHECK-NEXT: lxsdx v2, r4, r5
435 ; CHECK-NEXT: xscvsdqp v2, v2
436 ; CHECK-NEXT: stxv v2, 0(r3)
439 ; CHECK-P8-LABEL: sdwConv2qp_testXForm:
440 ; CHECK-P8: # %bb.0: # %entry
441 ; CHECK-P8-NEXT: mflr r0
442 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
443 ; CHECK-P8-NEXT: .cfi_offset lr, 16
444 ; CHECK-P8-NEXT: .cfi_offset r30, -16
445 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
446 ; CHECK-P8-NEXT: stdu r1, -48(r1)
447 ; CHECK-P8-NEXT: mr r30, r3
448 ; CHECK-P8-NEXT: lis r3, 1
449 ; CHECK-P8-NEXT: std r0, 64(r1)
450 ; CHECK-P8-NEXT: ori r3, r3, 7797
451 ; CHECK-P8-NEXT: ldx r3, r4, r3
452 ; CHECK-P8-NEXT: bl __floatdikf
454 ; CHECK-P8-NEXT: xxswapd vs0, v2
455 ; CHECK-P8-NEXT: mr r3, r30
456 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
457 ; CHECK-P8-NEXT: addi r1, r1, 48
458 ; CHECK-P8-NEXT: ld r0, 16(r1)
459 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
460 ; CHECK-P8-NEXT: mtlr r0
462 ptr nocapture readonly %a) {
464 %add.ptr = getelementptr inbounds i8, ptr %a, i64 73333
465 %0 = load i64, ptr %add.ptr, align 8
466 %conv = sitofp i64 %0 to fp128
467 store fp128 %conv, ptr %sink, align 16
472 ; Function Attrs: norecurse nounwind
473 define ptr @udwConv2qp_testXForm(ptr returned %sink,
474 ; CHECK-LABEL: udwConv2qp_testXForm:
475 ; CHECK: # %bb.0: # %entry
476 ; CHECK-NEXT: lis r5, 1
477 ; CHECK-NEXT: ori r5, r5, 7797
478 ; CHECK-NEXT: lxsdx v2, r4, r5
479 ; CHECK-NEXT: xscvudqp v2, v2
480 ; CHECK-NEXT: stxv v2, 0(r3)
483 ; CHECK-P8-LABEL: udwConv2qp_testXForm:
484 ; CHECK-P8: # %bb.0: # %entry
485 ; CHECK-P8-NEXT: mflr r0
486 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
487 ; CHECK-P8-NEXT: .cfi_offset lr, 16
488 ; CHECK-P8-NEXT: .cfi_offset r30, -16
489 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
490 ; CHECK-P8-NEXT: stdu r1, -48(r1)
491 ; CHECK-P8-NEXT: mr r30, r3
492 ; CHECK-P8-NEXT: lis r3, 1
493 ; CHECK-P8-NEXT: std r0, 64(r1)
494 ; CHECK-P8-NEXT: ori r3, r3, 7797
495 ; CHECK-P8-NEXT: ldx r3, r4, r3
496 ; CHECK-P8-NEXT: bl __floatundikf
498 ; CHECK-P8-NEXT: xxswapd vs0, v2
499 ; CHECK-P8-NEXT: mr r3, r30
500 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
501 ; CHECK-P8-NEXT: addi r1, r1, 48
502 ; CHECK-P8-NEXT: ld r0, 16(r1)
503 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
504 ; CHECK-P8-NEXT: mtlr r0
506 ptr nocapture readonly %a) {
508 %add.ptr = getelementptr inbounds i8, ptr %a, i64 73333
509 %0 = load i64, ptr %add.ptr, align 8
510 %conv = uitofp i64 %0 to fp128
511 store fp128 %conv, ptr %sink, align 16
516 ; Function Attrs: norecurse nounwind
517 define void @swConv2qp(ptr nocapture %a, i32 signext %b) {
518 ; CHECK-LABEL: swConv2qp:
519 ; CHECK: # %bb.0: # %entry
520 ; CHECK-NEXT: mtvsrwa v2, r4
521 ; CHECK-NEXT: xscvsdqp v2, v2
522 ; CHECK-NEXT: stxv v2, 0(r3)
525 ; CHECK-P8-LABEL: swConv2qp:
526 ; CHECK-P8: # %bb.0: # %entry
527 ; CHECK-P8-NEXT: mflr r0
528 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
529 ; CHECK-P8-NEXT: .cfi_offset lr, 16
530 ; CHECK-P8-NEXT: .cfi_offset r30, -16
531 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
532 ; CHECK-P8-NEXT: stdu r1, -48(r1)
533 ; CHECK-P8-NEXT: mr r30, r3
534 ; CHECK-P8-NEXT: mr r3, r4
535 ; CHECK-P8-NEXT: std r0, 64(r1)
536 ; CHECK-P8-NEXT: bl __floatsikf
538 ; CHECK-P8-NEXT: xxswapd vs0, v2
539 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
540 ; CHECK-P8-NEXT: addi r1, r1, 48
541 ; CHECK-P8-NEXT: ld r0, 16(r1)
542 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
543 ; CHECK-P8-NEXT: mtlr r0
546 %conv = sitofp i32 %b to fp128
547 store fp128 %conv, ptr %a, align 16
552 ; Function Attrs: norecurse nounwind
553 define void @swConv2qp_02(ptr nocapture %a, ptr nocapture readonly %b) {
554 ; CHECK-LABEL: swConv2qp_02:
555 ; CHECK: # %bb.0: # %entry
556 ; CHECK-NEXT: lxsiwax v2, 0, r4
557 ; CHECK-NEXT: xscvsdqp v2, v2
558 ; CHECK-NEXT: stxv v2, 0(r3)
561 ; CHECK-P8-LABEL: swConv2qp_02:
562 ; CHECK-P8: # %bb.0: # %entry
563 ; CHECK-P8-NEXT: mflr r0
564 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
565 ; CHECK-P8-NEXT: .cfi_offset lr, 16
566 ; CHECK-P8-NEXT: .cfi_offset r30, -16
567 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
568 ; CHECK-P8-NEXT: stdu r1, -48(r1)
569 ; CHECK-P8-NEXT: std r0, 64(r1)
570 ; CHECK-P8-NEXT: mr r30, r3
571 ; CHECK-P8-NEXT: lwa r3, 0(r4)
572 ; CHECK-P8-NEXT: bl __floatsikf
574 ; CHECK-P8-NEXT: xxswapd vs0, v2
575 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
576 ; CHECK-P8-NEXT: addi r1, r1, 48
577 ; CHECK-P8-NEXT: ld r0, 16(r1)
578 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
579 ; CHECK-P8-NEXT: mtlr r0
582 %0 = load i32, ptr %b, align 4
583 %conv = sitofp i32 %0 to fp128
584 store fp128 %conv, ptr %a, align 16
589 ; Function Attrs: norecurse nounwind
590 define void @swConv2qp_03(ptr nocapture %a) {
591 ; CHECK-LABEL: swConv2qp_03:
592 ; CHECK: # %bb.0: # %entry
593 ; CHECK-NEXT: addis r4, r2, .LC2@toc@ha
594 ; CHECK-NEXT: ld r4, .LC2@toc@l(r4)
595 ; CHECK-NEXT: addi r4, r4, 12
596 ; CHECK-NEXT: lxsiwax v2, 0, r4
597 ; CHECK-NEXT: xscvsdqp v2, v2
598 ; CHECK-NEXT: stxv v2, 0(r3)
601 ; CHECK-P8-LABEL: swConv2qp_03:
602 ; CHECK-P8: # %bb.0: # %entry
603 ; CHECK-P8-NEXT: mflr r0
604 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
605 ; CHECK-P8-NEXT: .cfi_offset lr, 16
606 ; CHECK-P8-NEXT: .cfi_offset r30, -16
607 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
608 ; CHECK-P8-NEXT: stdu r1, -48(r1)
609 ; CHECK-P8-NEXT: mr r30, r3
610 ; CHECK-P8-NEXT: addis r3, r2, .LC2@toc@ha
611 ; CHECK-P8-NEXT: std r0, 64(r1)
612 ; CHECK-P8-NEXT: ld r3, .LC2@toc@l(r3)
613 ; CHECK-P8-NEXT: lwa r3, 12(r3)
614 ; CHECK-P8-NEXT: bl __floatsikf
616 ; CHECK-P8-NEXT: xxswapd vs0, v2
617 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
618 ; CHECK-P8-NEXT: addi r1, r1, 48
619 ; CHECK-P8-NEXT: ld r0, 16(r1)
620 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
621 ; CHECK-P8-NEXT: mtlr r0
624 %0 = load i32, ptr getelementptr inbounds
625 ([5 x i32], ptr @swMem, i64 0, i64 3), align 4
626 %conv = sitofp i32 %0 to fp128
627 store fp128 %conv, ptr %a, align 16
632 ; Function Attrs: norecurse nounwind
633 define void @uwConv2qp(ptr nocapture %a, i32 zeroext %b) {
634 ; CHECK-LABEL: uwConv2qp:
635 ; CHECK: # %bb.0: # %entry
636 ; CHECK-NEXT: mtvsrwz v2, r4
637 ; CHECK-NEXT: xscvudqp v2, v2
638 ; CHECK-NEXT: stxv v2, 0(r3)
641 ; CHECK-P8-LABEL: uwConv2qp:
642 ; CHECK-P8: # %bb.0: # %entry
643 ; CHECK-P8-NEXT: mflr r0
644 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
645 ; CHECK-P8-NEXT: .cfi_offset lr, 16
646 ; CHECK-P8-NEXT: .cfi_offset r30, -16
647 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
648 ; CHECK-P8-NEXT: stdu r1, -48(r1)
649 ; CHECK-P8-NEXT: mr r30, r3
650 ; CHECK-P8-NEXT: mr r3, r4
651 ; CHECK-P8-NEXT: std r0, 64(r1)
652 ; CHECK-P8-NEXT: bl __floatunsikf
654 ; CHECK-P8-NEXT: xxswapd vs0, v2
655 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
656 ; CHECK-P8-NEXT: addi r1, r1, 48
657 ; CHECK-P8-NEXT: ld r0, 16(r1)
658 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
659 ; CHECK-P8-NEXT: mtlr r0
662 %conv = uitofp i32 %b to fp128
663 store fp128 %conv, ptr %a, align 16
668 ; Function Attrs: norecurse nounwind
669 define void @uwConv2qp_02(ptr nocapture %a, ptr nocapture readonly %b) {
670 ; CHECK-LABEL: uwConv2qp_02:
671 ; CHECK: # %bb.0: # %entry
672 ; CHECK-NEXT: lxsiwzx v2, 0, r4
673 ; CHECK-NEXT: xscvudqp v2, v2
674 ; CHECK-NEXT: stxv v2, 0(r3)
677 ; CHECK-P8-LABEL: uwConv2qp_02:
678 ; CHECK-P8: # %bb.0: # %entry
679 ; CHECK-P8-NEXT: mflr r0
680 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
681 ; CHECK-P8-NEXT: .cfi_offset lr, 16
682 ; CHECK-P8-NEXT: .cfi_offset r30, -16
683 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
684 ; CHECK-P8-NEXT: stdu r1, -48(r1)
685 ; CHECK-P8-NEXT: std r0, 64(r1)
686 ; CHECK-P8-NEXT: mr r30, r3
687 ; CHECK-P8-NEXT: lwz r3, 0(r4)
688 ; CHECK-P8-NEXT: bl __floatunsikf
690 ; CHECK-P8-NEXT: xxswapd vs0, v2
691 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
692 ; CHECK-P8-NEXT: addi r1, r1, 48
693 ; CHECK-P8-NEXT: ld r0, 16(r1)
694 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
695 ; CHECK-P8-NEXT: mtlr r0
698 %0 = load i32, ptr %b, align 4
699 %conv = uitofp i32 %0 to fp128
700 store fp128 %conv, ptr %a, align 16
705 ; Function Attrs: norecurse nounwind
706 define void @uwConv2qp_03(ptr nocapture %a) {
707 ; CHECK-LABEL: uwConv2qp_03:
708 ; CHECK: # %bb.0: # %entry
709 ; CHECK-NEXT: addis r4, r2, .LC3@toc@ha
710 ; CHECK-NEXT: ld r4, .LC3@toc@l(r4)
711 ; CHECK-NEXT: addi r4, r4, 12
712 ; CHECK-NEXT: lxsiwzx v2, 0, r4
713 ; CHECK-NEXT: xscvudqp v2, v2
714 ; CHECK-NEXT: stxv v2, 0(r3)
717 ; CHECK-P8-LABEL: uwConv2qp_03:
718 ; CHECK-P8: # %bb.0: # %entry
719 ; CHECK-P8-NEXT: mflr r0
720 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
721 ; CHECK-P8-NEXT: .cfi_offset lr, 16
722 ; CHECK-P8-NEXT: .cfi_offset r30, -16
723 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
724 ; CHECK-P8-NEXT: stdu r1, -48(r1)
725 ; CHECK-P8-NEXT: mr r30, r3
726 ; CHECK-P8-NEXT: addis r3, r2, .LC3@toc@ha
727 ; CHECK-P8-NEXT: std r0, 64(r1)
728 ; CHECK-P8-NEXT: ld r3, .LC3@toc@l(r3)
729 ; CHECK-P8-NEXT: lwz r3, 12(r3)
730 ; CHECK-P8-NEXT: bl __floatunsikf
732 ; CHECK-P8-NEXT: xxswapd vs0, v2
733 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
734 ; CHECK-P8-NEXT: addi r1, r1, 48
735 ; CHECK-P8-NEXT: ld r0, 16(r1)
736 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
737 ; CHECK-P8-NEXT: mtlr r0
740 %0 = load i32, ptr getelementptr inbounds
741 ([5 x i32], ptr @uwMem, i64 0, i64 3), align 4
742 %conv = uitofp i32 %0 to fp128
743 store fp128 %conv, ptr %a, align 16
748 ; Function Attrs: norecurse nounwind
749 define void @uwConv2qp_04(ptr nocapture %a,
750 ; CHECK-LABEL: uwConv2qp_04:
751 ; CHECK: # %bb.0: # %entry
752 ; CHECK-NEXT: lwz r5, 0(r5)
753 ; CHECK-NEXT: add r4, r5, r4
754 ; CHECK-NEXT: mtvsrwz v2, r4
755 ; CHECK-NEXT: xscvudqp v2, v2
756 ; CHECK-NEXT: stxv v2, 0(r3)
759 ; CHECK-P8-LABEL: uwConv2qp_04:
760 ; CHECK-P8: # %bb.0: # %entry
761 ; CHECK-P8-NEXT: mflr r0
762 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
763 ; CHECK-P8-NEXT: .cfi_offset lr, 16
764 ; CHECK-P8-NEXT: .cfi_offset r30, -16
765 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
766 ; CHECK-P8-NEXT: stdu r1, -48(r1)
767 ; CHECK-P8-NEXT: std r0, 64(r1)
768 ; CHECK-P8-NEXT: mr r30, r3
769 ; CHECK-P8-NEXT: lwz r3, 0(r5)
770 ; CHECK-P8-NEXT: add r3, r3, r4
771 ; CHECK-P8-NEXT: clrldi r3, r3, 32
772 ; CHECK-P8-NEXT: bl __floatunsikf
774 ; CHECK-P8-NEXT: xxswapd vs0, v2
775 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
776 ; CHECK-P8-NEXT: addi r1, r1, 48
777 ; CHECK-P8-NEXT: ld r0, 16(r1)
778 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
779 ; CHECK-P8-NEXT: mtlr r0
781 i32 zeroext %b, ptr nocapture readonly %c) {
783 %0 = load i32, ptr %c, align 4
784 %add = add i32 %0, %b
785 %conv = uitofp i32 %add to fp128
786 store fp128 %conv, ptr %a, align 16
791 ; Function Attrs: norecurse nounwind
792 define void @uhwConv2qp(ptr nocapture %a, i16 zeroext %b) {
793 ; CHECK-LABEL: uhwConv2qp:
794 ; CHECK: # %bb.0: # %entry
795 ; CHECK-NEXT: mtvsrwz v2, r4
796 ; CHECK-NEXT: xscvudqp v2, v2
797 ; CHECK-NEXT: stxv v2, 0(r3)
800 ; CHECK-P8-LABEL: uhwConv2qp:
801 ; CHECK-P8: # %bb.0: # %entry
802 ; CHECK-P8-NEXT: mflr r0
803 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
804 ; CHECK-P8-NEXT: .cfi_offset lr, 16
805 ; CHECK-P8-NEXT: .cfi_offset r30, -16
806 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
807 ; CHECK-P8-NEXT: stdu r1, -48(r1)
808 ; CHECK-P8-NEXT: mr r30, r3
809 ; CHECK-P8-NEXT: mr r3, r4
810 ; CHECK-P8-NEXT: std r0, 64(r1)
811 ; CHECK-P8-NEXT: bl __floatunsikf
813 ; CHECK-P8-NEXT: xxswapd vs0, v2
814 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
815 ; CHECK-P8-NEXT: addi r1, r1, 48
816 ; CHECK-P8-NEXT: ld r0, 16(r1)
817 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
818 ; CHECK-P8-NEXT: mtlr r0
821 %conv = uitofp i16 %b to fp128
822 store fp128 %conv, ptr %a, align 16
828 ; Function Attrs: norecurse nounwind
829 define void @uhwConv2qp_02(ptr nocapture %a, ptr nocapture readonly %b) {
830 ; CHECK-LABEL: uhwConv2qp_02:
831 ; CHECK: # %bb.0: # %entry
832 ; CHECK-NEXT: lxsihzx v2, 0, r4
833 ; CHECK-NEXT: xscvudqp v2, v2
834 ; CHECK-NEXT: stxv v2, 0(r3)
837 ; CHECK-P8-LABEL: uhwConv2qp_02:
838 ; CHECK-P8: # %bb.0: # %entry
839 ; CHECK-P8-NEXT: mflr r0
840 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
841 ; CHECK-P8-NEXT: .cfi_offset lr, 16
842 ; CHECK-P8-NEXT: .cfi_offset r30, -16
843 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
844 ; CHECK-P8-NEXT: stdu r1, -48(r1)
845 ; CHECK-P8-NEXT: std r0, 64(r1)
846 ; CHECK-P8-NEXT: mr r30, r3
847 ; CHECK-P8-NEXT: lhz r3, 0(r4)
848 ; CHECK-P8-NEXT: bl __floatunsikf
850 ; CHECK-P8-NEXT: xxswapd vs0, v2
851 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
852 ; CHECK-P8-NEXT: addi r1, r1, 48
853 ; CHECK-P8-NEXT: ld r0, 16(r1)
854 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
855 ; CHECK-P8-NEXT: mtlr r0
858 %0 = load i16, ptr %b, align 2
859 %conv = uitofp i16 %0 to fp128
860 store fp128 %conv, ptr %a, align 16
865 ; Function Attrs: norecurse nounwind
866 define void @uhwConv2qp_03(ptr nocapture %a) {
867 ; CHECK-LABEL: uhwConv2qp_03:
868 ; CHECK: # %bb.0: # %entry
869 ; CHECK-NEXT: addis r4, r2, .LC4@toc@ha
870 ; CHECK-NEXT: ld r4, .LC4@toc@l(r4)
871 ; CHECK-NEXT: addi r4, r4, 6
872 ; CHECK-NEXT: lxsihzx v2, 0, r4
873 ; CHECK-NEXT: xscvudqp v2, v2
874 ; CHECK-NEXT: stxv v2, 0(r3)
877 ; CHECK-P8-LABEL: uhwConv2qp_03:
878 ; CHECK-P8: # %bb.0: # %entry
879 ; CHECK-P8-NEXT: mflr r0
880 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
881 ; CHECK-P8-NEXT: .cfi_offset lr, 16
882 ; CHECK-P8-NEXT: .cfi_offset r30, -16
883 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
884 ; CHECK-P8-NEXT: stdu r1, -48(r1)
885 ; CHECK-P8-NEXT: mr r30, r3
886 ; CHECK-P8-NEXT: addis r3, r2, .LC4@toc@ha
887 ; CHECK-P8-NEXT: std r0, 64(r1)
888 ; CHECK-P8-NEXT: ld r3, .LC4@toc@l(r3)
889 ; CHECK-P8-NEXT: lhz r3, 6(r3)
890 ; CHECK-P8-NEXT: bl __floatunsikf
892 ; CHECK-P8-NEXT: xxswapd vs0, v2
893 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
894 ; CHECK-P8-NEXT: addi r1, r1, 48
895 ; CHECK-P8-NEXT: ld r0, 16(r1)
896 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
897 ; CHECK-P8-NEXT: mtlr r0
900 %0 = load i16, ptr getelementptr inbounds
901 ([5 x i16], ptr @uhwMem, i64 0, i64 3), align 2
902 %conv = uitofp i16 %0 to fp128
903 store fp128 %conv, ptr %a, align 16
908 ; Function Attrs: norecurse nounwind
909 define void @uhwConv2qp_04(ptr nocapture %a, i16 zeroext %b,
910 ; CHECK-LABEL: uhwConv2qp_04:
911 ; CHECK: # %bb.0: # %entry
912 ; CHECK-NEXT: lhz r5, 0(r5)
913 ; CHECK-NEXT: add r4, r5, r4
914 ; CHECK-NEXT: mtvsrwa v2, r4
915 ; CHECK-NEXT: xscvsdqp v2, v2
916 ; CHECK-NEXT: stxv v2, 0(r3)
919 ; CHECK-P8-LABEL: uhwConv2qp_04:
920 ; CHECK-P8: # %bb.0: # %entry
921 ; CHECK-P8-NEXT: mflr r0
922 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
923 ; CHECK-P8-NEXT: .cfi_offset lr, 16
924 ; CHECK-P8-NEXT: .cfi_offset r30, -16
925 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
926 ; CHECK-P8-NEXT: stdu r1, -48(r1)
927 ; CHECK-P8-NEXT: std r0, 64(r1)
928 ; CHECK-P8-NEXT: mr r30, r3
929 ; CHECK-P8-NEXT: lhz r3, 0(r5)
930 ; CHECK-P8-NEXT: add r3, r3, r4
931 ; CHECK-P8-NEXT: clrldi r3, r3, 32
932 ; CHECK-P8-NEXT: bl __floatsikf
934 ; CHECK-P8-NEXT: xxswapd vs0, v2
935 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
936 ; CHECK-P8-NEXT: addi r1, r1, 48
937 ; CHECK-P8-NEXT: ld r0, 16(r1)
938 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
939 ; CHECK-P8-NEXT: mtlr r0
941 ptr nocapture readonly %c) {
943 %conv = zext i16 %b to i32
944 %0 = load i16, ptr %c, align 2
945 %conv1 = zext i16 %0 to i32
946 %add = add nuw nsw i32 %conv1, %conv
947 %conv2 = sitofp i32 %add to fp128
948 store fp128 %conv2, ptr %a, align 16
953 ; Function Attrs: norecurse nounwind
954 define void @ubConv2qp(ptr nocapture %a, i8 zeroext %b) {
955 ; CHECK-LABEL: ubConv2qp:
956 ; CHECK: # %bb.0: # %entry
957 ; CHECK-NEXT: mtvsrwz v2, r4
958 ; CHECK-NEXT: xscvudqp v2, v2
959 ; CHECK-NEXT: stxv v2, 0(r3)
962 ; CHECK-P8-LABEL: ubConv2qp:
963 ; CHECK-P8: # %bb.0: # %entry
964 ; CHECK-P8-NEXT: mflr r0
965 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
966 ; CHECK-P8-NEXT: .cfi_offset lr, 16
967 ; CHECK-P8-NEXT: .cfi_offset r30, -16
968 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
969 ; CHECK-P8-NEXT: stdu r1, -48(r1)
970 ; CHECK-P8-NEXT: mr r30, r3
971 ; CHECK-P8-NEXT: mr r3, r4
972 ; CHECK-P8-NEXT: std r0, 64(r1)
973 ; CHECK-P8-NEXT: bl __floatunsikf
975 ; CHECK-P8-NEXT: xxswapd vs0, v2
976 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
977 ; CHECK-P8-NEXT: addi r1, r1, 48
978 ; CHECK-P8-NEXT: ld r0, 16(r1)
979 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
980 ; CHECK-P8-NEXT: mtlr r0
983 %conv = uitofp i8 %b to fp128
984 store fp128 %conv, ptr %a, align 16
989 ; Function Attrs: norecurse nounwind
990 define void @ubConv2qp_02(ptr nocapture %a, ptr nocapture readonly %b) {
991 ; CHECK-LABEL: ubConv2qp_02:
992 ; CHECK: # %bb.0: # %entry
993 ; CHECK-NEXT: lxsibzx v2, 0, r4
994 ; CHECK-NEXT: xscvudqp v2, v2
995 ; CHECK-NEXT: stxv v2, 0(r3)
998 ; CHECK-P8-LABEL: ubConv2qp_02:
999 ; CHECK-P8: # %bb.0: # %entry
1000 ; CHECK-P8-NEXT: mflr r0
1001 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1002 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1003 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1004 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1005 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1006 ; CHECK-P8-NEXT: std r0, 64(r1)
1007 ; CHECK-P8-NEXT: mr r30, r3
1008 ; CHECK-P8-NEXT: lbz r3, 0(r4)
1009 ; CHECK-P8-NEXT: bl __floatunsikf
1010 ; CHECK-P8-NEXT: nop
1011 ; CHECK-P8-NEXT: xxswapd vs0, v2
1012 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
1013 ; CHECK-P8-NEXT: addi r1, r1, 48
1014 ; CHECK-P8-NEXT: ld r0, 16(r1)
1015 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1016 ; CHECK-P8-NEXT: mtlr r0
1017 ; CHECK-P8-NEXT: blr
1019 %0 = load i8, ptr %b, align 1
1020 %conv = uitofp i8 %0 to fp128
1021 store fp128 %conv, ptr %a, align 16
1026 ; Function Attrs: norecurse nounwind
1027 define void @ubConv2qp_03(ptr nocapture %a) {
1028 ; CHECK-LABEL: ubConv2qp_03:
1029 ; CHECK: # %bb.0: # %entry
1030 ; CHECK-NEXT: addis r4, r2, .LC5@toc@ha
1031 ; CHECK-NEXT: ld r4, .LC5@toc@l(r4)
1032 ; CHECK-NEXT: addi r4, r4, 2
1033 ; CHECK-NEXT: lxsibzx v2, 0, r4
1034 ; CHECK-NEXT: xscvudqp v2, v2
1035 ; CHECK-NEXT: stxv v2, 0(r3)
1038 ; CHECK-P8-LABEL: ubConv2qp_03:
1039 ; CHECK-P8: # %bb.0: # %entry
1040 ; CHECK-P8-NEXT: mflr r0
1041 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1042 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1043 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1044 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1045 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1046 ; CHECK-P8-NEXT: mr r30, r3
1047 ; CHECK-P8-NEXT: addis r3, r2, .LC5@toc@ha
1048 ; CHECK-P8-NEXT: std r0, 64(r1)
1049 ; CHECK-P8-NEXT: ld r3, .LC5@toc@l(r3)
1050 ; CHECK-P8-NEXT: lbz r3, 2(r3)
1051 ; CHECK-P8-NEXT: bl __floatunsikf
1052 ; CHECK-P8-NEXT: nop
1053 ; CHECK-P8-NEXT: xxswapd vs0, v2
1054 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
1055 ; CHECK-P8-NEXT: addi r1, r1, 48
1056 ; CHECK-P8-NEXT: ld r0, 16(r1)
1057 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1058 ; CHECK-P8-NEXT: mtlr r0
1059 ; CHECK-P8-NEXT: blr
1061 %0 = load i8, ptr getelementptr inbounds
1062 ([5 x i8], ptr @ubMem, i64 0, i64 2), align 1
1063 %conv = uitofp i8 %0 to fp128
1064 store fp128 %conv, ptr %a, align 16
1069 ; Function Attrs: norecurse nounwind
1070 define void @ubConv2qp_04(ptr nocapture %a, i8 zeroext %b,
1071 ; CHECK-LABEL: ubConv2qp_04:
1072 ; CHECK: # %bb.0: # %entry
1073 ; CHECK-NEXT: lbz r5, 0(r5)
1074 ; CHECK-NEXT: add r4, r5, r4
1075 ; CHECK-NEXT: mtvsrwa v2, r4
1076 ; CHECK-NEXT: xscvsdqp v2, v2
1077 ; CHECK-NEXT: stxv v2, 0(r3)
1080 ; CHECK-P8-LABEL: ubConv2qp_04:
1081 ; CHECK-P8: # %bb.0: # %entry
1082 ; CHECK-P8-NEXT: mflr r0
1083 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1084 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1085 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1086 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1087 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1088 ; CHECK-P8-NEXT: std r0, 64(r1)
1089 ; CHECK-P8-NEXT: mr r30, r3
1090 ; CHECK-P8-NEXT: lbz r3, 0(r5)
1091 ; CHECK-P8-NEXT: add r3, r3, r4
1092 ; CHECK-P8-NEXT: clrldi r3, r3, 32
1093 ; CHECK-P8-NEXT: bl __floatsikf
1094 ; CHECK-P8-NEXT: nop
1095 ; CHECK-P8-NEXT: xxswapd vs0, v2
1096 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
1097 ; CHECK-P8-NEXT: addi r1, r1, 48
1098 ; CHECK-P8-NEXT: ld r0, 16(r1)
1099 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1100 ; CHECK-P8-NEXT: mtlr r0
1101 ; CHECK-P8-NEXT: blr
1102 ptr nocapture readonly %c) {
1104 %conv = zext i8 %b to i32
1105 %0 = load i8, ptr %c, align 1
1106 %conv1 = zext i8 %0 to i32
1107 %add = add nuw nsw i32 %conv1, %conv
1108 %conv2 = sitofp i32 %add to fp128
1109 store fp128 %conv2, ptr %a, align 16
1116 @f128Array = global [4 x fp128]
1117 [fp128 0xL00000000000000004004C00000000000,
1118 fp128 0xLF000000000000000400808AB851EB851,
1119 fp128 0xL5000000000000000400E0C26324C8366,
1120 fp128 0xL8000000000000000400A24E2E147AE14], align 16
1121 @f128global = global fp128 0xL300000000000000040089CA8F5C28F5C, align 16
1123 ; Function Attrs: norecurse nounwind readonly
1124 define double @qpConv2dp(ptr nocapture readonly %a) {
1125 ; CHECK-LABEL: qpConv2dp:
1126 ; CHECK: # %bb.0: # %entry
1127 ; CHECK-NEXT: lxv v2, 0(r3)
1128 ; CHECK-NEXT: xscvqpdp v2, v2
1129 ; CHECK-NEXT: xscpsgndp f1, v2, v2
1132 ; CHECK-P8-LABEL: qpConv2dp:
1133 ; CHECK-P8: # %bb.0: # %entry
1134 ; CHECK-P8-NEXT: mflr r0
1135 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1136 ; CHECK-P8-NEXT: std r0, 48(r1)
1137 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1138 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1139 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1140 ; CHECK-P8-NEXT: xxswapd v2, vs0
1141 ; CHECK-P8-NEXT: bl __trunckfdf2
1142 ; CHECK-P8-NEXT: nop
1143 ; CHECK-P8-NEXT: addi r1, r1, 32
1144 ; CHECK-P8-NEXT: ld r0, 16(r1)
1145 ; CHECK-P8-NEXT: mtlr r0
1146 ; CHECK-P8-NEXT: blr
1148 %0 = load fp128, ptr %a, align 16
1149 %conv = fptrunc fp128 %0 to double
1153 ; Function Attrs: norecurse nounwind
1154 define void @qpConv2dp_02(ptr nocapture %res) {
1155 ; CHECK-LABEL: qpConv2dp_02:
1156 ; CHECK: # %bb.0: # %entry
1157 ; CHECK-NEXT: addis r4, r2, .LC6@toc@ha
1158 ; CHECK-NEXT: ld r4, .LC6@toc@l(r4)
1159 ; CHECK-NEXT: lxv v2, 0(r4)
1160 ; CHECK-NEXT: xscvqpdp v2, v2
1161 ; CHECK-NEXT: stxsd v2, 0(r3)
1164 ; CHECK-P8-LABEL: qpConv2dp_02:
1165 ; CHECK-P8: # %bb.0: # %entry
1166 ; CHECK-P8-NEXT: mflr r0
1167 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1168 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1169 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1170 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1171 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1172 ; CHECK-P8-NEXT: mr r30, r3
1173 ; CHECK-P8-NEXT: addis r3, r2, .LC6@toc@ha
1174 ; CHECK-P8-NEXT: std r0, 64(r1)
1175 ; CHECK-P8-NEXT: ld r3, .LC6@toc@l(r3)
1176 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1177 ; CHECK-P8-NEXT: xxswapd v2, vs0
1178 ; CHECK-P8-NEXT: bl __trunckfdf2
1179 ; CHECK-P8-NEXT: nop
1180 ; CHECK-P8-NEXT: stfd f1, 0(r30)
1181 ; CHECK-P8-NEXT: addi r1, r1, 48
1182 ; CHECK-P8-NEXT: ld r0, 16(r1)
1183 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1184 ; CHECK-P8-NEXT: mtlr r0
1185 ; CHECK-P8-NEXT: blr
1187 %0 = load fp128, ptr @f128global, align 16
1188 %conv = fptrunc fp128 %0 to double
1189 store double %conv, ptr %res, align 8
1193 ; Function Attrs: norecurse nounwind
1194 define void @qpConv2dp_03(ptr nocapture %res, i32 signext %idx) {
1195 ; CHECK-LABEL: qpConv2dp_03:
1196 ; CHECK: # %bb.0: # %entry
1197 ; CHECK-NEXT: addis r5, r2, .LC7@toc@ha
1198 ; CHECK-NEXT: sldi r4, r4, 3
1199 ; CHECK-NEXT: ld r5, .LC7@toc@l(r5)
1200 ; CHECK-NEXT: lxv v2, 0(r5)
1201 ; CHECK-NEXT: xscvqpdp v2, v2
1202 ; CHECK-NEXT: stxsdx v2, r3, r4
1205 ; CHECK-P8-LABEL: qpConv2dp_03:
1206 ; CHECK-P8: # %bb.0: # %entry
1207 ; CHECK-P8-NEXT: mflr r0
1208 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 64
1209 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1210 ; CHECK-P8-NEXT: .cfi_offset r29, -24
1211 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1212 ; CHECK-P8-NEXT: std r29, -24(r1) # 8-byte Folded Spill
1213 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1214 ; CHECK-P8-NEXT: stdu r1, -64(r1)
1215 ; CHECK-P8-NEXT: mr r29, r3
1216 ; CHECK-P8-NEXT: addis r3, r2, .LC7@toc@ha
1217 ; CHECK-P8-NEXT: std r0, 80(r1)
1218 ; CHECK-P8-NEXT: mr r30, r4
1219 ; CHECK-P8-NEXT: ld r3, .LC7@toc@l(r3)
1220 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1221 ; CHECK-P8-NEXT: xxswapd v2, vs0
1222 ; CHECK-P8-NEXT: bl __trunckfdf2
1223 ; CHECK-P8-NEXT: nop
1224 ; CHECK-P8-NEXT: sldi r3, r30, 3
1225 ; CHECK-P8-NEXT: stfdx f1, r29, r3
1226 ; CHECK-P8-NEXT: addi r1, r1, 64
1227 ; CHECK-P8-NEXT: ld r0, 16(r1)
1228 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1229 ; CHECK-P8-NEXT: ld r29, -24(r1) # 8-byte Folded Reload
1230 ; CHECK-P8-NEXT: mtlr r0
1231 ; CHECK-P8-NEXT: blr
1233 %0 = load fp128, ptr @f128Array, align 16
1234 %conv = fptrunc fp128 %0 to double
1235 %idxprom = sext i32 %idx to i64
1236 %arrayidx = getelementptr inbounds double, ptr %res, i64 %idxprom
1237 store double %conv, ptr %arrayidx, align 8
1241 ; Function Attrs: norecurse nounwind
1242 define void @qpConv2dp_04(ptr nocapture readonly %a, ptr nocapture readonly %b, ptr nocapture %res) {
1243 ; CHECK-LABEL: qpConv2dp_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: xscvqpdp v2, v2
1249 ; CHECK-NEXT: stxsd v2, 0(r5)
1252 ; CHECK-P8-LABEL: qpConv2dp_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 __trunckfdf2
1269 ; CHECK-P8-NEXT: nop
1270 ; CHECK-P8-NEXT: stfd f1, 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
1277 %0 = load fp128, ptr %a, align 16
1278 %1 = load fp128, ptr %b, align 16
1279 %add = fadd fp128 %0, %1
1280 %conv = fptrunc fp128 %add to double
1281 store double %conv, ptr %res, align 8
1287 ; Function Attrs: norecurse nounwind readonly
1288 define float @qpConv2sp(ptr nocapture readonly %a) {
1289 ; CHECK-LABEL: qpConv2sp:
1290 ; CHECK: # %bb.0: # %entry
1291 ; CHECK-NEXT: lxv v2, 0(r3)
1292 ; CHECK-NEXT: xscvqpdpo v2, v2
1293 ; CHECK-NEXT: xsrsp f1, v2
1296 ; CHECK-P8-LABEL: qpConv2sp:
1297 ; CHECK-P8: # %bb.0: # %entry
1298 ; CHECK-P8-NEXT: mflr r0
1299 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1300 ; CHECK-P8-NEXT: std r0, 48(r1)
1301 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1302 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1303 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1304 ; CHECK-P8-NEXT: xxswapd v2, vs0
1305 ; CHECK-P8-NEXT: bl __trunckfsf2
1306 ; CHECK-P8-NEXT: nop
1307 ; CHECK-P8-NEXT: addi r1, r1, 32
1308 ; CHECK-P8-NEXT: ld r0, 16(r1)
1309 ; CHECK-P8-NEXT: mtlr r0
1310 ; CHECK-P8-NEXT: blr
1312 %0 = load fp128, ptr %a, align 16
1313 %conv = fptrunc fp128 %0 to float
1317 ; Function Attrs: norecurse nounwind
1318 define void @qpConv2sp_02(ptr nocapture %res) {
1319 ; CHECK-LABEL: qpConv2sp_02:
1320 ; CHECK: # %bb.0: # %entry
1321 ; CHECK-NEXT: addis r4, r2, .LC6@toc@ha
1322 ; CHECK-NEXT: ld r4, .LC6@toc@l(r4)
1323 ; CHECK-NEXT: lxv v2, 0(r4)
1324 ; CHECK-NEXT: xscvqpdpo v2, v2
1325 ; CHECK-NEXT: xsrsp f0, v2
1326 ; CHECK-NEXT: stfs f0, 0(r3)
1329 ; CHECK-P8-LABEL: qpConv2sp_02:
1330 ; CHECK-P8: # %bb.0: # %entry
1331 ; CHECK-P8-NEXT: mflr r0
1332 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1333 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1334 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1335 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1336 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1337 ; CHECK-P8-NEXT: mr r30, r3
1338 ; CHECK-P8-NEXT: addis r3, r2, .LC6@toc@ha
1339 ; CHECK-P8-NEXT: std r0, 64(r1)
1340 ; CHECK-P8-NEXT: ld r3, .LC6@toc@l(r3)
1341 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1342 ; CHECK-P8-NEXT: xxswapd v2, vs0
1343 ; CHECK-P8-NEXT: bl __trunckfsf2
1344 ; CHECK-P8-NEXT: nop
1345 ; CHECK-P8-NEXT: stfs f1, 0(r30)
1346 ; CHECK-P8-NEXT: addi r1, r1, 48
1347 ; CHECK-P8-NEXT: ld r0, 16(r1)
1348 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1349 ; CHECK-P8-NEXT: mtlr r0
1350 ; CHECK-P8-NEXT: blr
1352 %0 = load fp128, ptr @f128global, align 16
1353 %conv = fptrunc fp128 %0 to float
1354 store float %conv, ptr %res, align 4
1358 ; Function Attrs: norecurse nounwind
1359 define void @qpConv2sp_03(ptr nocapture %res, i32 signext %idx) {
1360 ; CHECK-LABEL: qpConv2sp_03:
1361 ; CHECK: # %bb.0: # %entry
1362 ; CHECK-NEXT: addis r5, r2, .LC7@toc@ha
1363 ; CHECK-NEXT: sldi r4, r4, 2
1364 ; CHECK-NEXT: ld r5, .LC7@toc@l(r5)
1365 ; CHECK-NEXT: lxv v2, 48(r5)
1366 ; CHECK-NEXT: xscvqpdpo v2, v2
1367 ; CHECK-NEXT: xsrsp f0, v2
1368 ; CHECK-NEXT: stfsx f0, r3, r4
1371 ; CHECK-P8-LABEL: qpConv2sp_03:
1372 ; CHECK-P8: # %bb.0: # %entry
1373 ; CHECK-P8-NEXT: mflr r0
1374 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 64
1375 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1376 ; CHECK-P8-NEXT: .cfi_offset r29, -24
1377 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1378 ; CHECK-P8-NEXT: std r29, -24(r1) # 8-byte Folded Spill
1379 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1380 ; CHECK-P8-NEXT: stdu r1, -64(r1)
1381 ; CHECK-P8-NEXT: mr r29, r3
1382 ; CHECK-P8-NEXT: addis r3, r2, .LC7@toc@ha
1383 ; CHECK-P8-NEXT: std r0, 80(r1)
1384 ; CHECK-P8-NEXT: mr r30, r4
1385 ; CHECK-P8-NEXT: ld r3, .LC7@toc@l(r3)
1386 ; CHECK-P8-NEXT: addi r3, r3, 48
1387 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1388 ; CHECK-P8-NEXT: xxswapd v2, vs0
1389 ; CHECK-P8-NEXT: bl __trunckfsf2
1390 ; CHECK-P8-NEXT: nop
1391 ; CHECK-P8-NEXT: sldi r3, r30, 2
1392 ; CHECK-P8-NEXT: stfsx f1, r29, r3
1393 ; CHECK-P8-NEXT: addi r1, r1, 64
1394 ; CHECK-P8-NEXT: ld r0, 16(r1)
1395 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1396 ; CHECK-P8-NEXT: ld r29, -24(r1) # 8-byte Folded Reload
1397 ; CHECK-P8-NEXT: mtlr r0
1398 ; CHECK-P8-NEXT: blr
1400 %0 = load fp128, ptr getelementptr inbounds ([4 x fp128], ptr @f128Array, i64 0, i64 3), align 16
1401 %conv = fptrunc fp128 %0 to float
1402 %idxprom = sext i32 %idx to i64
1403 %arrayidx = getelementptr inbounds float, ptr %res, i64 %idxprom
1404 store float %conv, ptr %arrayidx, align 4
1408 ; Function Attrs: norecurse nounwind
1409 define void @qpConv2sp_04(ptr nocapture readonly %a, ptr nocapture readonly %b, ptr nocapture %res) {
1410 ; CHECK-LABEL: qpConv2sp_04:
1411 ; CHECK: # %bb.0: # %entry
1412 ; CHECK-NEXT: lxv v2, 0(r3)
1413 ; CHECK-NEXT: lxv v3, 0(r4)
1414 ; CHECK-NEXT: xsaddqp v2, v2, v3
1415 ; CHECK-NEXT: xscvqpdpo v2, v2
1416 ; CHECK-NEXT: xsrsp f0, v2
1417 ; CHECK-NEXT: stfs f0, 0(r5)
1420 ; CHECK-P8-LABEL: qpConv2sp_04:
1421 ; CHECK-P8: # %bb.0: # %entry
1422 ; CHECK-P8-NEXT: mflr r0
1423 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1424 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1425 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1426 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1427 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1428 ; CHECK-P8-NEXT: std r0, 64(r1)
1429 ; CHECK-P8-NEXT: mr r30, r5
1430 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
1431 ; CHECK-P8-NEXT: xxswapd v2, vs0
1432 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r4
1433 ; CHECK-P8-NEXT: xxswapd v3, vs0
1434 ; CHECK-P8-NEXT: bl __addkf3
1435 ; CHECK-P8-NEXT: nop
1436 ; CHECK-P8-NEXT: bl __trunckfsf2
1437 ; CHECK-P8-NEXT: nop
1438 ; CHECK-P8-NEXT: stfs f1, 0(r30)
1439 ; CHECK-P8-NEXT: addi r1, r1, 48
1440 ; CHECK-P8-NEXT: ld r0, 16(r1)
1441 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1442 ; CHECK-P8-NEXT: mtlr r0
1443 ; CHECK-P8-NEXT: blr
1445 %0 = load fp128, ptr %a, align 16
1446 %1 = load fp128, ptr %b, align 16
1447 %add = fadd fp128 %0, %1
1448 %conv = fptrunc fp128 %add to float
1449 store float %conv, ptr %res, align 4
1453 @f128Glob = common global fp128 0xL00000000000000000000000000000000, align 16
1455 ; Function Attrs: norecurse nounwind readnone
1456 define fp128 @dpConv2qp(double %a) {
1457 ; CHECK-LABEL: dpConv2qp:
1458 ; CHECK: # %bb.0: # %entry
1459 ; CHECK-NEXT: xscpsgndp v2, f1, f1
1460 ; CHECK-NEXT: xscvdpqp v2, v2
1463 ; CHECK-P8-LABEL: dpConv2qp:
1464 ; CHECK-P8: # %bb.0: # %entry
1465 ; CHECK-P8-NEXT: mflr r0
1466 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1467 ; CHECK-P8-NEXT: std r0, 48(r1)
1468 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1469 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1470 ; CHECK-P8-NEXT: bl __extenddfkf2
1471 ; CHECK-P8-NEXT: nop
1472 ; CHECK-P8-NEXT: addi r1, r1, 32
1473 ; CHECK-P8-NEXT: ld r0, 16(r1)
1474 ; CHECK-P8-NEXT: mtlr r0
1475 ; CHECK-P8-NEXT: blr
1477 %conv = fpext double %a to fp128
1481 ; Function Attrs: norecurse nounwind
1482 define void @dpConv2qp_02(ptr nocapture readonly %a) {
1483 ; CHECK-LABEL: dpConv2qp_02:
1484 ; CHECK: # %bb.0: # %entry
1485 ; CHECK-NEXT: lxsd v2, 0(r3)
1486 ; CHECK-NEXT: addis r3, r2, .LC8@toc@ha
1487 ; CHECK-NEXT: ld r3, .LC8@toc@l(r3)
1488 ; CHECK-NEXT: xscvdpqp v2, v2
1489 ; CHECK-NEXT: stxv v2, 0(r3)
1492 ; CHECK-P8-LABEL: dpConv2qp_02:
1493 ; CHECK-P8: # %bb.0: # %entry
1494 ; CHECK-P8-NEXT: mflr r0
1495 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1496 ; CHECK-P8-NEXT: std r0, 48(r1)
1497 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1498 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1499 ; CHECK-P8-NEXT: lfd f1, 0(r3)
1500 ; CHECK-P8-NEXT: bl __extenddfkf2
1501 ; CHECK-P8-NEXT: nop
1502 ; CHECK-P8-NEXT: addis r3, r2, .LC8@toc@ha
1503 ; CHECK-P8-NEXT: xxswapd vs0, v2
1504 ; CHECK-P8-NEXT: ld r3, .LC8@toc@l(r3)
1505 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r3
1506 ; CHECK-P8-NEXT: addi r1, r1, 32
1507 ; CHECK-P8-NEXT: ld r0, 16(r1)
1508 ; CHECK-P8-NEXT: mtlr r0
1509 ; CHECK-P8-NEXT: blr
1511 %0 = load double, ptr %a, align 8
1512 %conv = fpext double %0 to fp128
1513 store fp128 %conv, ptr @f128Glob, align 16
1517 ; Function Attrs: norecurse nounwind
1518 define void @dpConv2qp_02b(ptr nocapture readonly %a, i32 signext %idx) {
1519 ; CHECK-LABEL: dpConv2qp_02b:
1520 ; CHECK: # %bb.0: # %entry
1521 ; CHECK-NEXT: sldi r4, r4, 3
1522 ; CHECK-NEXT: lxsdx v2, r3, r4
1523 ; CHECK-NEXT: addis r3, r2, .LC8@toc@ha
1524 ; CHECK-NEXT: ld r3, .LC8@toc@l(r3)
1525 ; CHECK-NEXT: xscvdpqp v2, v2
1526 ; CHECK-NEXT: stxv v2, 0(r3)
1529 ; CHECK-P8-LABEL: dpConv2qp_02b:
1530 ; CHECK-P8: # %bb.0: # %entry
1531 ; CHECK-P8-NEXT: mflr r0
1532 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1533 ; CHECK-P8-NEXT: std r0, 48(r1)
1534 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1535 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1536 ; CHECK-P8-NEXT: sldi r4, r4, 3
1537 ; CHECK-P8-NEXT: lfdx f1, r3, r4
1538 ; CHECK-P8-NEXT: bl __extenddfkf2
1539 ; CHECK-P8-NEXT: nop
1540 ; CHECK-P8-NEXT: addis r3, r2, .LC8@toc@ha
1541 ; CHECK-P8-NEXT: xxswapd vs0, v2
1542 ; CHECK-P8-NEXT: ld r3, .LC8@toc@l(r3)
1543 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r3
1544 ; CHECK-P8-NEXT: addi r1, r1, 32
1545 ; CHECK-P8-NEXT: ld r0, 16(r1)
1546 ; CHECK-P8-NEXT: mtlr r0
1547 ; CHECK-P8-NEXT: blr
1549 %idxprom = sext i32 %idx to i64
1550 %arrayidx = getelementptr inbounds double, ptr %a, i64 %idxprom
1551 %0 = load double, ptr %arrayidx, align 8
1552 %conv = fpext double %0 to fp128
1553 store fp128 %conv, ptr @f128Glob, align 16
1557 ; Function Attrs: norecurse nounwind
1558 define void @dpConv2qp_03(ptr nocapture %res, i32 signext %idx, double %a) {
1559 ; CHECK-LABEL: dpConv2qp_03:
1560 ; CHECK: # %bb.0: # %entry
1561 ; CHECK-NEXT: xscpsgndp v2, f1, f1
1562 ; CHECK-NEXT: sldi r4, r4, 4
1563 ; CHECK-NEXT: xscvdpqp v2, v2
1564 ; CHECK-NEXT: stxvx v2, r3, r4
1567 ; CHECK-P8-LABEL: dpConv2qp_03:
1568 ; CHECK-P8: # %bb.0: # %entry
1569 ; CHECK-P8-NEXT: mflr r0
1570 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 64
1571 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1572 ; CHECK-P8-NEXT: .cfi_offset r29, -24
1573 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1574 ; CHECK-P8-NEXT: std r29, -24(r1) # 8-byte Folded Spill
1575 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1576 ; CHECK-P8-NEXT: stdu r1, -64(r1)
1577 ; CHECK-P8-NEXT: std r0, 80(r1)
1578 ; CHECK-P8-NEXT: mr r30, r4
1579 ; CHECK-P8-NEXT: mr r29, r3
1580 ; CHECK-P8-NEXT: bl __extenddfkf2
1581 ; CHECK-P8-NEXT: nop
1582 ; CHECK-P8-NEXT: xxswapd vs0, v2
1583 ; CHECK-P8-NEXT: sldi r3, r30, 4
1584 ; CHECK-P8-NEXT: stxvd2x vs0, r29, r3
1585 ; CHECK-P8-NEXT: addi r1, r1, 64
1586 ; CHECK-P8-NEXT: ld r0, 16(r1)
1587 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1588 ; CHECK-P8-NEXT: ld r29, -24(r1) # 8-byte Folded Reload
1589 ; CHECK-P8-NEXT: mtlr r0
1590 ; CHECK-P8-NEXT: blr
1592 %conv = fpext double %a to fp128
1593 %idxprom = sext i32 %idx to i64
1594 %arrayidx = getelementptr inbounds fp128, ptr %res, i64 %idxprom
1595 store fp128 %conv, ptr %arrayidx, align 16
1599 ; Function Attrs: norecurse nounwind
1600 define void @dpConv2qp_04(double %a, ptr nocapture %res) {
1601 ; CHECK-LABEL: dpConv2qp_04:
1602 ; CHECK: # %bb.0: # %entry
1603 ; CHECK-NEXT: xscpsgndp v2, f1, f1
1604 ; CHECK-NEXT: xscvdpqp v2, v2
1605 ; CHECK-NEXT: stxv v2, 0(r4)
1608 ; CHECK-P8-LABEL: dpConv2qp_04:
1609 ; CHECK-P8: # %bb.0: # %entry
1610 ; CHECK-P8-NEXT: mflr r0
1611 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1612 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1613 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1614 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1615 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1616 ; CHECK-P8-NEXT: std r0, 64(r1)
1617 ; CHECK-P8-NEXT: mr r30, r4
1618 ; CHECK-P8-NEXT: bl __extenddfkf2
1619 ; CHECK-P8-NEXT: nop
1620 ; CHECK-P8-NEXT: xxswapd vs0, v2
1621 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
1622 ; CHECK-P8-NEXT: addi r1, r1, 48
1623 ; CHECK-P8-NEXT: ld r0, 16(r1)
1624 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1625 ; CHECK-P8-NEXT: mtlr r0
1626 ; CHECK-P8-NEXT: blr
1628 %conv = fpext double %a to fp128
1629 store fp128 %conv, ptr %res, align 16
1633 ; Function Attrs: norecurse nounwind readnone
1634 define fp128 @spConv2qp(float %a) {
1635 ; CHECK-LABEL: spConv2qp:
1636 ; CHECK: # %bb.0: # %entry
1637 ; CHECK-NEXT: xscpsgndp v2, f1, f1
1638 ; CHECK-NEXT: xscvdpqp v2, v2
1641 ; CHECK-P8-LABEL: spConv2qp:
1642 ; CHECK-P8: # %bb.0: # %entry
1643 ; CHECK-P8-NEXT: mflr r0
1644 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1645 ; CHECK-P8-NEXT: std r0, 48(r1)
1646 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1647 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1648 ; CHECK-P8-NEXT: bl __extendsfkf2
1649 ; CHECK-P8-NEXT: nop
1650 ; CHECK-P8-NEXT: addi r1, r1, 32
1651 ; CHECK-P8-NEXT: ld r0, 16(r1)
1652 ; CHECK-P8-NEXT: mtlr r0
1653 ; CHECK-P8-NEXT: blr
1655 %conv = fpext float %a to fp128
1659 ; Function Attrs: norecurse nounwind
1660 define void @spConv2qp_02(ptr nocapture readonly %a) {
1661 ; CHECK-LABEL: spConv2qp_02:
1662 ; CHECK: # %bb.0: # %entry
1663 ; CHECK-NEXT: lxssp v2, 0(r3)
1664 ; CHECK-NEXT: addis r3, r2, .LC8@toc@ha
1665 ; CHECK-NEXT: ld r3, .LC8@toc@l(r3)
1666 ; CHECK-NEXT: xscvdpqp v2, v2
1667 ; CHECK-NEXT: stxv v2, 0(r3)
1670 ; CHECK-P8-LABEL: spConv2qp_02:
1671 ; CHECK-P8: # %bb.0: # %entry
1672 ; CHECK-P8-NEXT: mflr r0
1673 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1674 ; CHECK-P8-NEXT: std r0, 48(r1)
1675 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1676 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1677 ; CHECK-P8-NEXT: lfs f1, 0(r3)
1678 ; CHECK-P8-NEXT: bl __extendsfkf2
1679 ; CHECK-P8-NEXT: nop
1680 ; CHECK-P8-NEXT: addis r3, r2, .LC8@toc@ha
1681 ; CHECK-P8-NEXT: xxswapd vs0, v2
1682 ; CHECK-P8-NEXT: ld r3, .LC8@toc@l(r3)
1683 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r3
1684 ; CHECK-P8-NEXT: addi r1, r1, 32
1685 ; CHECK-P8-NEXT: ld r0, 16(r1)
1686 ; CHECK-P8-NEXT: mtlr r0
1687 ; CHECK-P8-NEXT: blr
1689 %0 = load float, ptr %a, align 4
1690 %conv = fpext float %0 to fp128
1691 store fp128 %conv, ptr @f128Glob, align 16
1695 ; Function Attrs: norecurse nounwind
1696 define void @spConv2qp_02b(ptr nocapture readonly %a, i32 signext %idx) {
1697 ; CHECK-LABEL: spConv2qp_02b:
1698 ; CHECK: # %bb.0: # %entry
1699 ; CHECK-NEXT: sldi r4, r4, 2
1700 ; CHECK-NEXT: lxsspx v2, r3, r4
1701 ; CHECK-NEXT: addis r3, r2, .LC8@toc@ha
1702 ; CHECK-NEXT: ld r3, .LC8@toc@l(r3)
1703 ; CHECK-NEXT: xscvdpqp v2, v2
1704 ; CHECK-NEXT: stxv v2, 0(r3)
1707 ; CHECK-P8-LABEL: spConv2qp_02b:
1708 ; CHECK-P8: # %bb.0: # %entry
1709 ; CHECK-P8-NEXT: mflr r0
1710 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1711 ; CHECK-P8-NEXT: std r0, 48(r1)
1712 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1713 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1714 ; CHECK-P8-NEXT: sldi r4, r4, 2
1715 ; CHECK-P8-NEXT: lfsx f1, r3, r4
1716 ; CHECK-P8-NEXT: bl __extendsfkf2
1717 ; CHECK-P8-NEXT: nop
1718 ; CHECK-P8-NEXT: addis r3, r2, .LC8@toc@ha
1719 ; CHECK-P8-NEXT: xxswapd vs0, v2
1720 ; CHECK-P8-NEXT: ld r3, .LC8@toc@l(r3)
1721 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r3
1722 ; CHECK-P8-NEXT: addi r1, r1, 32
1723 ; CHECK-P8-NEXT: ld r0, 16(r1)
1724 ; CHECK-P8-NEXT: mtlr r0
1725 ; CHECK-P8-NEXT: blr
1727 %idxprom = sext i32 %idx to i64
1728 %arrayidx = getelementptr inbounds float, ptr %a, i64 %idxprom
1729 %0 = load float, ptr %arrayidx, align 4
1730 %conv = fpext float %0 to fp128
1731 store fp128 %conv, ptr @f128Glob, align 16
1735 ; Function Attrs: norecurse nounwind
1736 define void @spConv2qp_03(ptr nocapture %res, i32 signext %idx, float %a) {
1737 ; CHECK-LABEL: spConv2qp_03:
1738 ; CHECK: # %bb.0: # %entry
1739 ; CHECK-NEXT: xscpsgndp v2, f1, f1
1740 ; CHECK-NEXT: sldi r4, r4, 4
1741 ; CHECK-NEXT: xscvdpqp v2, v2
1742 ; CHECK-NEXT: stxvx v2, r3, r4
1745 ; CHECK-P8-LABEL: spConv2qp_03:
1746 ; CHECK-P8: # %bb.0: # %entry
1747 ; CHECK-P8-NEXT: mflr r0
1748 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 64
1749 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1750 ; CHECK-P8-NEXT: .cfi_offset r29, -24
1751 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1752 ; CHECK-P8-NEXT: std r29, -24(r1) # 8-byte Folded Spill
1753 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1754 ; CHECK-P8-NEXT: stdu r1, -64(r1)
1755 ; CHECK-P8-NEXT: std r0, 80(r1)
1756 ; CHECK-P8-NEXT: mr r30, r4
1757 ; CHECK-P8-NEXT: mr r29, r3
1758 ; CHECK-P8-NEXT: bl __extendsfkf2
1759 ; CHECK-P8-NEXT: nop
1760 ; CHECK-P8-NEXT: xxswapd vs0, v2
1761 ; CHECK-P8-NEXT: sldi r3, r30, 4
1762 ; CHECK-P8-NEXT: stxvd2x vs0, r29, r3
1763 ; CHECK-P8-NEXT: addi r1, r1, 64
1764 ; CHECK-P8-NEXT: ld r0, 16(r1)
1765 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1766 ; CHECK-P8-NEXT: ld r29, -24(r1) # 8-byte Folded Reload
1767 ; CHECK-P8-NEXT: mtlr r0
1768 ; CHECK-P8-NEXT: blr
1770 %conv = fpext float %a to fp128
1771 %idxprom = sext i32 %idx to i64
1772 %arrayidx = getelementptr inbounds fp128, ptr %res, i64 %idxprom
1773 store fp128 %conv, ptr %arrayidx, align 16
1777 ; Function Attrs: norecurse nounwind
1778 define void @spConv2qp_04(float %a, ptr nocapture %res) {
1779 ; CHECK-LABEL: spConv2qp_04:
1780 ; CHECK: # %bb.0: # %entry
1781 ; CHECK-NEXT: xscpsgndp v2, f1, f1
1782 ; CHECK-NEXT: xscvdpqp v2, v2
1783 ; CHECK-NEXT: stxv v2, 0(r4)
1786 ; CHECK-P8-LABEL: spConv2qp_04:
1787 ; CHECK-P8: # %bb.0: # %entry
1788 ; CHECK-P8-NEXT: mflr r0
1789 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1790 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1791 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1792 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1793 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1794 ; CHECK-P8-NEXT: std r0, 64(r1)
1795 ; CHECK-P8-NEXT: mr r30, r4
1796 ; CHECK-P8-NEXT: bl __extendsfkf2
1797 ; CHECK-P8-NEXT: nop
1798 ; CHECK-P8-NEXT: xxswapd vs0, v2
1799 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
1800 ; CHECK-P8-NEXT: addi r1, r1, 48
1801 ; CHECK-P8-NEXT: ld r0, 16(r1)
1802 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1803 ; CHECK-P8-NEXT: mtlr r0
1804 ; CHECK-P8-NEXT: blr
1806 %conv = fpext float %a to fp128
1807 store fp128 %conv, ptr %res, align 16
1812 ; Function Attrs: norecurse nounwind
1813 define void @cvdp2sw2qp(double %val, ptr nocapture %res) {
1814 ; CHECK-LABEL: cvdp2sw2qp:
1815 ; CHECK: # %bb.0: # %entry
1816 ; CHECK-NEXT: xscvdpsxws v2, f1
1817 ; CHECK-NEXT: vextsw2d v2, v2
1818 ; CHECK-NEXT: xscvsdqp v2, v2
1819 ; CHECK-NEXT: stxv v2, 0(r4)
1822 ; CHECK-P8-LABEL: cvdp2sw2qp:
1823 ; CHECK-P8: # %bb.0: # %entry
1824 ; CHECK-P8-NEXT: mflr r0
1825 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1826 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1827 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1828 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1829 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1830 ; CHECK-P8-NEXT: xscvdpsxws f0, f1
1831 ; CHECK-P8-NEXT: std r0, 64(r1)
1832 ; CHECK-P8-NEXT: mr r30, r4
1833 ; CHECK-P8-NEXT: mffprwz r3, f0
1834 ; CHECK-P8-NEXT: extsw r3, r3
1835 ; CHECK-P8-NEXT: bl __floatsikf
1836 ; CHECK-P8-NEXT: nop
1837 ; CHECK-P8-NEXT: xxswapd vs0, v2
1838 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
1839 ; CHECK-P8-NEXT: addi r1, r1, 48
1840 ; CHECK-P8-NEXT: ld r0, 16(r1)
1841 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1842 ; CHECK-P8-NEXT: mtlr r0
1843 ; CHECK-P8-NEXT: blr
1845 %conv = fptosi double %val to i32
1846 %conv1 = sitofp i32 %conv to fp128
1847 store fp128 %conv1, ptr %res, align 16
1851 ; Function Attrs: norecurse nounwind
1852 define void @cvdp2sdw2qp(double %val, ptr nocapture %res) {
1853 ; CHECK-LABEL: cvdp2sdw2qp:
1854 ; CHECK: # %bb.0: # %entry
1855 ; CHECK-NEXT: xscvdpsxds v2, f1
1856 ; CHECK-NEXT: xscvsdqp v2, v2
1857 ; CHECK-NEXT: stxv v2, 0(r4)
1860 ; CHECK-P8-LABEL: cvdp2sdw2qp:
1861 ; CHECK-P8: # %bb.0: # %entry
1862 ; CHECK-P8-NEXT: mflr r0
1863 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1864 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1865 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1866 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1867 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1868 ; CHECK-P8-NEXT: xscvdpsxds f0, f1
1869 ; CHECK-P8-NEXT: std r0, 64(r1)
1870 ; CHECK-P8-NEXT: mr r30, r4
1871 ; CHECK-P8-NEXT: mffprd r3, f0
1872 ; CHECK-P8-NEXT: bl __floatdikf
1873 ; CHECK-P8-NEXT: nop
1874 ; CHECK-P8-NEXT: xxswapd vs0, v2
1875 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
1876 ; CHECK-P8-NEXT: addi r1, r1, 48
1877 ; CHECK-P8-NEXT: ld r0, 16(r1)
1878 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1879 ; CHECK-P8-NEXT: mtlr r0
1880 ; CHECK-P8-NEXT: blr
1882 %conv = fptosi double %val to i64
1883 %conv1 = sitofp i64 %conv to fp128
1884 store fp128 %conv1, ptr %res, align 16
1888 ; Function Attrs: norecurse nounwind
1889 define void @cvsp2sw2qp(float %val, ptr nocapture %res) {
1890 ; CHECK-LABEL: cvsp2sw2qp:
1891 ; CHECK: # %bb.0: # %entry
1892 ; CHECK-NEXT: xscvdpsxws v2, f1
1893 ; CHECK-NEXT: vextsw2d v2, v2
1894 ; CHECK-NEXT: xscvsdqp v2, v2
1895 ; CHECK-NEXT: stxv v2, 0(r4)
1898 ; CHECK-P8-LABEL: cvsp2sw2qp:
1899 ; CHECK-P8: # %bb.0: # %entry
1900 ; CHECK-P8-NEXT: mflr r0
1901 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1902 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1903 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1904 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1905 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1906 ; CHECK-P8-NEXT: xscvdpsxws f0, f1
1907 ; CHECK-P8-NEXT: std r0, 64(r1)
1908 ; CHECK-P8-NEXT: mr r30, r4
1909 ; CHECK-P8-NEXT: mffprwz r3, f0
1910 ; CHECK-P8-NEXT: extsw r3, r3
1911 ; CHECK-P8-NEXT: bl __floatsikf
1912 ; CHECK-P8-NEXT: nop
1913 ; CHECK-P8-NEXT: xxswapd vs0, v2
1914 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
1915 ; CHECK-P8-NEXT: addi r1, r1, 48
1916 ; CHECK-P8-NEXT: ld r0, 16(r1)
1917 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1918 ; CHECK-P8-NEXT: mtlr r0
1919 ; CHECK-P8-NEXT: blr
1921 %conv = fptosi float %val to i32
1922 %conv1 = sitofp i32 %conv to fp128
1923 store fp128 %conv1, ptr %res, align 16
1927 ; Function Attrs: norecurse nounwind
1928 define void @cvsp2sdw2qp(float %val, ptr nocapture %res) {
1929 ; CHECK-LABEL: cvsp2sdw2qp:
1930 ; CHECK: # %bb.0: # %entry
1931 ; CHECK-NEXT: xscvdpsxds v2, f1
1932 ; CHECK-NEXT: xscvsdqp v2, v2
1933 ; CHECK-NEXT: stxv v2, 0(r4)
1936 ; CHECK-P8-LABEL: cvsp2sdw2qp:
1937 ; CHECK-P8: # %bb.0: # %entry
1938 ; CHECK-P8-NEXT: mflr r0
1939 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1940 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1941 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1942 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1943 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1944 ; CHECK-P8-NEXT: xscvdpsxds f0, f1
1945 ; CHECK-P8-NEXT: std r0, 64(r1)
1946 ; CHECK-P8-NEXT: mr r30, r4
1947 ; CHECK-P8-NEXT: mffprd r3, f0
1948 ; CHECK-P8-NEXT: bl __floatdikf
1949 ; CHECK-P8-NEXT: nop
1950 ; CHECK-P8-NEXT: xxswapd vs0, v2
1951 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
1952 ; CHECK-P8-NEXT: addi r1, r1, 48
1953 ; CHECK-P8-NEXT: ld r0, 16(r1)
1954 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1955 ; CHECK-P8-NEXT: mtlr r0
1956 ; CHECK-P8-NEXT: blr
1958 %conv = fptosi float %val to i64
1959 %conv1 = sitofp i64 %conv to fp128
1960 store fp128 %conv1, ptr %res, align 16
1964 ; Function Attrs: norecurse nounwind
1965 define void @cvdp2uw2qp(double %val, ptr nocapture %res) {
1966 ; CHECK-LABEL: cvdp2uw2qp:
1967 ; CHECK: # %bb.0: # %entry
1968 ; CHECK-NEXT: xscvdpuxws f0, f1
1969 ; CHECK-NEXT: xxextractuw v2, vs0, 8
1970 ; CHECK-NEXT: xscvudqp v2, v2
1971 ; CHECK-NEXT: stxv v2, 0(r4)
1974 ; CHECK-P8-LABEL: cvdp2uw2qp:
1975 ; CHECK-P8: # %bb.0: # %entry
1976 ; CHECK-P8-NEXT: mflr r0
1977 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1978 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1979 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1980 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1981 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1982 ; CHECK-P8-NEXT: xscvdpuxws f0, f1
1983 ; CHECK-P8-NEXT: std r0, 64(r1)
1984 ; CHECK-P8-NEXT: mr r30, r4
1985 ; CHECK-P8-NEXT: mffprwz r3, f0
1986 ; CHECK-P8-NEXT: bl __floatunsikf
1987 ; CHECK-P8-NEXT: nop
1988 ; CHECK-P8-NEXT: xxswapd vs0, v2
1989 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
1990 ; CHECK-P8-NEXT: addi r1, r1, 48
1991 ; CHECK-P8-NEXT: ld r0, 16(r1)
1992 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1993 ; CHECK-P8-NEXT: mtlr r0
1994 ; CHECK-P8-NEXT: blr
1996 %conv = fptoui double %val to i32
1997 %conv1 = uitofp i32 %conv to fp128
1998 store fp128 %conv1, ptr %res, align 16
2002 ; Function Attrs: norecurse nounwind
2003 define void @cvdp2udw2qp(double %val, ptr nocapture %res) {
2004 ; CHECK-LABEL: cvdp2udw2qp:
2005 ; CHECK: # %bb.0: # %entry
2006 ; CHECK-NEXT: xscvdpuxds v2, f1
2007 ; CHECK-NEXT: xscvudqp v2, v2
2008 ; CHECK-NEXT: stxv v2, 0(r4)
2011 ; CHECK-P8-LABEL: cvdp2udw2qp:
2012 ; CHECK-P8: # %bb.0: # %entry
2013 ; CHECK-P8-NEXT: mflr r0
2014 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
2015 ; CHECK-P8-NEXT: .cfi_offset lr, 16
2016 ; CHECK-P8-NEXT: .cfi_offset r30, -16
2017 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
2018 ; CHECK-P8-NEXT: stdu r1, -48(r1)
2019 ; CHECK-P8-NEXT: xscvdpuxds f0, f1
2020 ; CHECK-P8-NEXT: std r0, 64(r1)
2021 ; CHECK-P8-NEXT: mr r30, r4
2022 ; CHECK-P8-NEXT: mffprd r3, f0
2023 ; CHECK-P8-NEXT: bl __floatundikf
2024 ; CHECK-P8-NEXT: nop
2025 ; CHECK-P8-NEXT: xxswapd vs0, v2
2026 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
2027 ; CHECK-P8-NEXT: addi r1, r1, 48
2028 ; CHECK-P8-NEXT: ld r0, 16(r1)
2029 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
2030 ; CHECK-P8-NEXT: mtlr r0
2031 ; CHECK-P8-NEXT: blr
2033 %conv = fptoui double %val to i64
2034 %conv1 = uitofp i64 %conv to fp128
2035 store fp128 %conv1, ptr %res, align 16
2039 ; Function Attrs: norecurse nounwind
2040 define void @cvsp2uw2qp(float %val, ptr nocapture %res) {
2041 ; CHECK-LABEL: cvsp2uw2qp:
2042 ; CHECK: # %bb.0: # %entry
2043 ; CHECK-NEXT: xscvdpuxws f0, f1
2044 ; CHECK-NEXT: xxextractuw v2, vs0, 8
2045 ; CHECK-NEXT: xscvudqp v2, v2
2046 ; CHECK-NEXT: stxv v2, 0(r4)
2049 ; CHECK-P8-LABEL: cvsp2uw2qp:
2050 ; CHECK-P8: # %bb.0: # %entry
2051 ; CHECK-P8-NEXT: mflr r0
2052 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
2053 ; CHECK-P8-NEXT: .cfi_offset lr, 16
2054 ; CHECK-P8-NEXT: .cfi_offset r30, -16
2055 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
2056 ; CHECK-P8-NEXT: stdu r1, -48(r1)
2057 ; CHECK-P8-NEXT: xscvdpuxws f0, f1
2058 ; CHECK-P8-NEXT: std r0, 64(r1)
2059 ; CHECK-P8-NEXT: mr r30, r4
2060 ; CHECK-P8-NEXT: mffprwz r3, f0
2061 ; CHECK-P8-NEXT: bl __floatunsikf
2062 ; CHECK-P8-NEXT: nop
2063 ; CHECK-P8-NEXT: xxswapd vs0, v2
2064 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
2065 ; CHECK-P8-NEXT: addi r1, r1, 48
2066 ; CHECK-P8-NEXT: ld r0, 16(r1)
2067 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
2068 ; CHECK-P8-NEXT: mtlr r0
2069 ; CHECK-P8-NEXT: blr
2071 %conv = fptoui float %val to i32
2072 %conv1 = uitofp i32 %conv to fp128
2073 store fp128 %conv1, ptr %res, align 16
2077 ; Function Attrs: norecurse nounwind
2078 define void @cvsp2udw2qp(float %val, ptr nocapture %res) {
2079 ; CHECK-LABEL: cvsp2udw2qp:
2080 ; CHECK: # %bb.0: # %entry
2081 ; CHECK-NEXT: xscvdpuxds v2, f1
2082 ; CHECK-NEXT: xscvudqp v2, v2
2083 ; CHECK-NEXT: stxv v2, 0(r4)
2086 ; CHECK-P8-LABEL: cvsp2udw2qp:
2087 ; CHECK-P8: # %bb.0: # %entry
2088 ; CHECK-P8-NEXT: mflr r0
2089 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
2090 ; CHECK-P8-NEXT: .cfi_offset lr, 16
2091 ; CHECK-P8-NEXT: .cfi_offset r30, -16
2092 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
2093 ; CHECK-P8-NEXT: stdu r1, -48(r1)
2094 ; CHECK-P8-NEXT: xscvdpuxds f0, f1
2095 ; CHECK-P8-NEXT: std r0, 64(r1)
2096 ; CHECK-P8-NEXT: mr r30, r4
2097 ; CHECK-P8-NEXT: mffprd r3, f0
2098 ; CHECK-P8-NEXT: bl __floatundikf
2099 ; CHECK-P8-NEXT: nop
2100 ; CHECK-P8-NEXT: xxswapd vs0, v2
2101 ; CHECK-P8-NEXT: stxvd2x vs0, 0, r30
2102 ; CHECK-P8-NEXT: addi r1, r1, 48
2103 ; CHECK-P8-NEXT: ld r0, 16(r1)
2104 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
2105 ; CHECK-P8-NEXT: mtlr r0
2106 ; CHECK-P8-NEXT: blr
2108 %conv = fptoui float %val to i64
2109 %conv1 = uitofp i64 %conv to fp128
2110 store fp128 %conv1, ptr %res, align 16
2114 ; Function Attrs: norecurse nounwind readonly
2115 define i128 @qpConv2i128(ptr nocapture readonly %a) {
2116 ; CHECK-LABEL: qpConv2i128:
2117 ; CHECK: # %bb.0: # %entry
2118 ; CHECK-NEXT: mflr r0
2119 ; CHECK-NEXT: stdu r1, -32(r1)
2120 ; CHECK-NEXT: std r0, 48(r1)
2121 ; CHECK-NEXT: .cfi_def_cfa_offset 32
2122 ; CHECK-NEXT: .cfi_offset lr, 16
2123 ; CHECK-NEXT: lxv v2, 0(r3)
2124 ; CHECK-NEXT: bl __fixkfti
2126 ; CHECK-NEXT: addi r1, r1, 32
2127 ; CHECK-NEXT: ld r0, 16(r1)
2128 ; CHECK-NEXT: mtlr r0
2131 ; CHECK-P8-LABEL: qpConv2i128:
2132 ; CHECK-P8: # %bb.0: # %entry
2133 ; CHECK-P8-NEXT: mflr r0
2134 ; CHECK-P8-NEXT: stdu r1, -32(r1)
2135 ; CHECK-P8-NEXT: std r0, 48(r1)
2136 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
2137 ; CHECK-P8-NEXT: .cfi_offset lr, 16
2138 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
2139 ; CHECK-P8-NEXT: xxswapd v2, vs0
2140 ; CHECK-P8-NEXT: bl __fixkfti
2141 ; CHECK-P8-NEXT: nop
2142 ; CHECK-P8-NEXT: addi r1, r1, 32
2143 ; CHECK-P8-NEXT: ld r0, 16(r1)
2144 ; CHECK-P8-NEXT: mtlr r0
2145 ; CHECK-P8-NEXT: blr
2147 %0 = load fp128, ptr %a, align 16
2148 %conv = fptosi fp128 %0 to i128
2152 ; Function Attrs: norecurse nounwind readonly
2153 define i128 @qpConv2ui128(ptr nocapture readonly %a) {
2154 ; CHECK-LABEL: qpConv2ui128:
2155 ; CHECK: # %bb.0: # %entry
2156 ; CHECK-NEXT: mflr r0
2157 ; CHECK-NEXT: stdu r1, -32(r1)
2158 ; CHECK-NEXT: std r0, 48(r1)
2159 ; CHECK-NEXT: .cfi_def_cfa_offset 32
2160 ; CHECK-NEXT: .cfi_offset lr, 16
2161 ; CHECK-NEXT: lxv v2, 0(r3)
2162 ; CHECK-NEXT: bl __fixunskfti
2164 ; CHECK-NEXT: addi r1, r1, 32
2165 ; CHECK-NEXT: ld r0, 16(r1)
2166 ; CHECK-NEXT: mtlr r0
2169 ; CHECK-P8-LABEL: qpConv2ui128:
2170 ; CHECK-P8: # %bb.0: # %entry
2171 ; CHECK-P8-NEXT: mflr r0
2172 ; CHECK-P8-NEXT: stdu r1, -32(r1)
2173 ; CHECK-P8-NEXT: std r0, 48(r1)
2174 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
2175 ; CHECK-P8-NEXT: .cfi_offset lr, 16
2176 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
2177 ; CHECK-P8-NEXT: xxswapd v2, vs0
2178 ; CHECK-P8-NEXT: bl __fixunskfti
2179 ; CHECK-P8-NEXT: nop
2180 ; CHECK-P8-NEXT: addi r1, r1, 32
2181 ; CHECK-P8-NEXT: ld r0, 16(r1)
2182 ; CHECK-P8-NEXT: mtlr r0
2183 ; CHECK-P8-NEXT: blr
2185 %0 = load fp128, ptr %a, align 16
2186 %conv = fptoui fp128 %0 to i128
2190 ; Function Attrs: norecurse nounwind readonly
2191 define i1 @qpConv2ui1(ptr nocapture readonly %a) {
2192 ; CHECK-LABEL: qpConv2ui1:
2193 ; CHECK: # %bb.0: # %entry
2194 ; CHECK-NEXT: lxv v2, 0(r3)
2195 ; CHECK-NEXT: xscvqpswz v2, v2
2196 ; CHECK-NEXT: mfvsrwz r3, v2
2199 ; CHECK-P8-LABEL: qpConv2ui1:
2200 ; CHECK-P8: # %bb.0: # %entry
2201 ; CHECK-P8-NEXT: mflr r0
2202 ; CHECK-P8-NEXT: stdu r1, -32(r1)
2203 ; CHECK-P8-NEXT: std r0, 48(r1)
2204 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
2205 ; CHECK-P8-NEXT: .cfi_offset lr, 16
2206 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
2207 ; CHECK-P8-NEXT: xxswapd v2, vs0
2208 ; CHECK-P8-NEXT: bl __fixkfsi
2209 ; CHECK-P8-NEXT: nop
2210 ; CHECK-P8-NEXT: addi r1, r1, 32
2211 ; CHECK-P8-NEXT: ld r0, 16(r1)
2212 ; CHECK-P8-NEXT: mtlr r0
2213 ; CHECK-P8-NEXT: blr
2215 %0 = load fp128, ptr %a, align 16
2216 %conv = fptoui fp128 %0 to i1
2220 ; Function Attrs: norecurse nounwind readonly
2221 define i1 @qpConv2si1(ptr nocapture readonly %a) {
2222 ; CHECK-LABEL: qpConv2si1:
2223 ; CHECK: # %bb.0: # %entry
2224 ; CHECK-NEXT: lxv v2, 0(r3)
2225 ; CHECK-NEXT: xscvqpswz v2, v2
2226 ; CHECK-NEXT: mfvsrwz r3, v2
2229 ; CHECK-P8-LABEL: qpConv2si1:
2230 ; CHECK-P8: # %bb.0: # %entry
2231 ; CHECK-P8-NEXT: mflr r0
2232 ; CHECK-P8-NEXT: stdu r1, -32(r1)
2233 ; CHECK-P8-NEXT: std r0, 48(r1)
2234 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
2235 ; CHECK-P8-NEXT: .cfi_offset lr, 16
2236 ; CHECK-P8-NEXT: lxvd2x vs0, 0, r3
2237 ; CHECK-P8-NEXT: xxswapd v2, vs0
2238 ; CHECK-P8-NEXT: bl __fixkfsi
2239 ; CHECK-P8-NEXT: nop
2240 ; CHECK-P8-NEXT: addi r1, r1, 32
2241 ; CHECK-P8-NEXT: ld r0, 16(r1)
2242 ; CHECK-P8-NEXT: mtlr r0
2243 ; CHECK-P8-NEXT: blr
2245 %0 = load fp128, ptr %a, align 16
2246 %conv = fptosi fp128 %0 to i1