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(fp128* 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: std r0, 16(r1)
33 ; CHECK-P8-NEXT: stdu r1, -48(r1)
34 ; CHECK-P8-NEXT: mr r30, r3
35 ; CHECK-P8-NEXT: mr r3, r4
36 ; CHECK-P8-NEXT: bl __floatdikf
38 ; CHECK-P8-NEXT: stvx v2, 0, r30
39 ; CHECK-P8-NEXT: addi r1, r1, 48
40 ; CHECK-P8-NEXT: ld r0, 16(r1)
41 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
42 ; CHECK-P8-NEXT: mtlr r0
45 %conv = sitofp i64 %b to fp128
46 store fp128 %conv, fp128* %a, align 16
51 ; Function Attrs: norecurse nounwind
52 define void @sdwConv2qp_01(fp128* nocapture %a, i128 %b) {
53 ; CHECK-LABEL: sdwConv2qp_01:
54 ; CHECK: # %bb.0: # %entry
56 ; CHECK-NEXT: .cfi_def_cfa_offset 48
57 ; CHECK-NEXT: .cfi_offset lr, 16
58 ; CHECK-NEXT: .cfi_offset r30, -16
59 ; CHECK-NEXT: std r30, -16(r1) # 8-byte Folded Spill
60 ; CHECK-NEXT: std r0, 16(r1)
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: bl __floattikf
67 ; CHECK-NEXT: stxv v2, 0(r30)
68 ; CHECK-NEXT: addi r1, r1, 48
69 ; CHECK-NEXT: ld r0, 16(r1)
70 ; CHECK-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
74 ; CHECK-P8-LABEL: sdwConv2qp_01:
75 ; CHECK-P8: # %bb.0: # %entry
76 ; CHECK-P8-NEXT: mflr r0
77 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
78 ; CHECK-P8-NEXT: .cfi_offset lr, 16
79 ; CHECK-P8-NEXT: .cfi_offset r30, -16
80 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
81 ; CHECK-P8-NEXT: std r0, 16(r1)
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: mr r4, r5
86 ; CHECK-P8-NEXT: bl __floattikf
88 ; CHECK-P8-NEXT: stvx v2, 0, r30
89 ; CHECK-P8-NEXT: addi r1, r1, 48
90 ; CHECK-P8-NEXT: ld r0, 16(r1)
91 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
92 ; CHECK-P8-NEXT: mtlr r0
95 %conv = sitofp i128 %b to fp128
96 store fp128 %conv, fp128* %a, align 16
101 ; Function Attrs: norecurse nounwind
102 define void @sdwConv2qp_02(fp128* nocapture %a) {
103 ; CHECK-LABEL: sdwConv2qp_02:
104 ; CHECK: # %bb.0: # %entry
105 ; CHECK-NEXT: addis r4, r2, .LC0@toc@ha
106 ; CHECK-NEXT: ld r4, .LC0@toc@l(r4)
107 ; CHECK-NEXT: lxsd v2, 16(r4)
108 ; CHECK-NEXT: xscvsdqp v2, v2
109 ; CHECK-NEXT: stxv v2, 0(r3)
112 ; CHECK-P8-LABEL: sdwConv2qp_02:
113 ; CHECK-P8: # %bb.0: # %entry
114 ; CHECK-P8-NEXT: mflr r0
115 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
116 ; CHECK-P8-NEXT: .cfi_offset lr, 16
117 ; CHECK-P8-NEXT: .cfi_offset r30, -16
118 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
119 ; CHECK-P8-NEXT: std r0, 16(r1)
120 ; CHECK-P8-NEXT: stdu r1, -48(r1)
121 ; CHECK-P8-NEXT: addis r4, r2, .LC0@toc@ha
122 ; CHECK-P8-NEXT: mr r30, r3
123 ; CHECK-P8-NEXT: ld r4, .LC0@toc@l(r4)
124 ; CHECK-P8-NEXT: ld r4, 16(r4)
125 ; CHECK-P8-NEXT: mr r3, r4
126 ; CHECK-P8-NEXT: bl __floatdikf
128 ; CHECK-P8-NEXT: stvx v2, 0, r30
129 ; CHECK-P8-NEXT: addi r1, r1, 48
130 ; CHECK-P8-NEXT: ld r0, 16(r1)
131 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
132 ; CHECK-P8-NEXT: mtlr r0
135 %0 = load i64, i64* getelementptr inbounds
136 ([5 x i64], [5 x i64]* @mem, i64 0, i64 2), align 8
137 %conv = sitofp i64 %0 to fp128
138 store fp128 %conv, fp128* %a, align 16
143 ; Function Attrs: norecurse nounwind
144 define void @sdwConv2qp_03(fp128* nocapture %a, i64* nocapture readonly %b) {
145 ; CHECK-LABEL: sdwConv2qp_03:
146 ; CHECK: # %bb.0: # %entry
147 ; CHECK-NEXT: lxsd v2, 0(r4)
148 ; CHECK-NEXT: xscvsdqp v2, v2
149 ; CHECK-NEXT: stxv v2, 0(r3)
152 ; CHECK-P8-LABEL: sdwConv2qp_03:
153 ; CHECK-P8: # %bb.0: # %entry
154 ; CHECK-P8-NEXT: mflr r0
155 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
156 ; CHECK-P8-NEXT: .cfi_offset lr, 16
157 ; CHECK-P8-NEXT: .cfi_offset r30, -16
158 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
159 ; CHECK-P8-NEXT: std r0, 16(r1)
160 ; CHECK-P8-NEXT: stdu r1, -48(r1)
161 ; CHECK-P8-NEXT: ld r4, 0(r4)
162 ; CHECK-P8-NEXT: mr r30, r3
163 ; CHECK-P8-NEXT: mr r3, r4
164 ; CHECK-P8-NEXT: bl __floatdikf
166 ; CHECK-P8-NEXT: stvx v2, 0, r30
167 ; CHECK-P8-NEXT: addi r1, r1, 48
168 ; CHECK-P8-NEXT: ld r0, 16(r1)
169 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
170 ; CHECK-P8-NEXT: mtlr r0
173 %0 = load i64, i64* %b, align 8
174 %conv = sitofp i64 %0 to fp128
175 store fp128 %conv, fp128* %a, align 16
180 ; Function Attrs: norecurse nounwind
181 define void @sdwConv2qp_04(fp128* nocapture %a, i1 %b) {
182 ; CHECK-LABEL: sdwConv2qp_04:
183 ; CHECK: # %bb.0: # %entry
184 ; CHECK-NEXT: andi. r4, r4, 1
185 ; CHECK-NEXT: li r4, 0
186 ; CHECK-NEXT: li r5, -1
187 ; CHECK-NEXT: iselgt r4, r5, r4
188 ; CHECK-NEXT: mtvsrwa v2, r4
189 ; CHECK-NEXT: xscvsdqp v2, v2
190 ; CHECK-NEXT: stxv v2, 0(r3)
193 ; CHECK-P8-LABEL: sdwConv2qp_04:
194 ; CHECK-P8: # %bb.0: # %entry
195 ; CHECK-P8-NEXT: mflr r0
196 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
197 ; CHECK-P8-NEXT: .cfi_offset lr, 16
198 ; CHECK-P8-NEXT: .cfi_offset r30, -16
199 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
200 ; CHECK-P8-NEXT: std r0, 16(r1)
201 ; CHECK-P8-NEXT: stdu r1, -48(r1)
202 ; CHECK-P8-NEXT: mr r30, r3
203 ; CHECK-P8-NEXT: andi. r3, r4, 1
204 ; CHECK-P8-NEXT: li r4, -1
205 ; CHECK-P8-NEXT: li r3, 0
206 ; CHECK-P8-NEXT: iselgt r3, r4, r3
207 ; CHECK-P8-NEXT: bl __floatsikf
209 ; CHECK-P8-NEXT: stvx v2, 0, r30
210 ; CHECK-P8-NEXT: addi r1, r1, 48
211 ; CHECK-P8-NEXT: ld r0, 16(r1)
212 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
213 ; CHECK-P8-NEXT: mtlr r0
216 %conv = sitofp i1 %b to fp128
217 store fp128 %conv, fp128* %a, align 16
222 ; Function Attrs: norecurse nounwind
223 define void @udwConv2qp(fp128* nocapture %a, i64 %b) {
224 ; CHECK-LABEL: udwConv2qp:
225 ; CHECK: # %bb.0: # %entry
226 ; CHECK-NEXT: mtvsrd v2, r4
227 ; CHECK-NEXT: xscvudqp v2, v2
228 ; CHECK-NEXT: stxv v2, 0(r3)
231 ; CHECK-P8-LABEL: udwConv2qp:
232 ; CHECK-P8: # %bb.0: # %entry
233 ; CHECK-P8-NEXT: mflr r0
234 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
235 ; CHECK-P8-NEXT: .cfi_offset lr, 16
236 ; CHECK-P8-NEXT: .cfi_offset r30, -16
237 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
238 ; CHECK-P8-NEXT: std r0, 16(r1)
239 ; CHECK-P8-NEXT: stdu r1, -48(r1)
240 ; CHECK-P8-NEXT: mr r30, r3
241 ; CHECK-P8-NEXT: mr r3, r4
242 ; CHECK-P8-NEXT: bl __floatundikf
244 ; CHECK-P8-NEXT: stvx v2, 0, r30
245 ; CHECK-P8-NEXT: addi r1, r1, 48
246 ; CHECK-P8-NEXT: ld r0, 16(r1)
247 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
248 ; CHECK-P8-NEXT: mtlr r0
251 %conv = uitofp i64 %b to fp128
252 store fp128 %conv, fp128* %a, align 16
257 ; Function Attrs: norecurse nounwind
258 define void @udwConv2qp_01(fp128* nocapture %a, i128 %b) {
259 ; CHECK-LABEL: udwConv2qp_01:
260 ; CHECK: # %bb.0: # %entry
261 ; CHECK-NEXT: mflr r0
262 ; CHECK-NEXT: .cfi_def_cfa_offset 48
263 ; CHECK-NEXT: .cfi_offset lr, 16
264 ; CHECK-NEXT: .cfi_offset r30, -16
265 ; CHECK-NEXT: std r30, -16(r1) # 8-byte Folded Spill
266 ; CHECK-NEXT: std r0, 16(r1)
267 ; CHECK-NEXT: stdu r1, -48(r1)
268 ; CHECK-NEXT: mr r30, r3
269 ; CHECK-NEXT: mr r3, r4
270 ; CHECK-NEXT: mr r4, r5
271 ; CHECK-NEXT: bl __floatuntikf
273 ; CHECK-NEXT: stxv v2, 0(r30)
274 ; CHECK-NEXT: addi r1, r1, 48
275 ; CHECK-NEXT: ld r0, 16(r1)
276 ; CHECK-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
277 ; CHECK-NEXT: mtlr r0
280 ; CHECK-P8-LABEL: udwConv2qp_01:
281 ; CHECK-P8: # %bb.0: # %entry
282 ; CHECK-P8-NEXT: mflr r0
283 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
284 ; CHECK-P8-NEXT: .cfi_offset lr, 16
285 ; CHECK-P8-NEXT: .cfi_offset r30, -16
286 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
287 ; CHECK-P8-NEXT: std r0, 16(r1)
288 ; CHECK-P8-NEXT: stdu r1, -48(r1)
289 ; CHECK-P8-NEXT: mr r30, r3
290 ; CHECK-P8-NEXT: mr r3, r4
291 ; CHECK-P8-NEXT: mr r4, r5
292 ; CHECK-P8-NEXT: bl __floatuntikf
294 ; CHECK-P8-NEXT: stvx v2, 0, r30
295 ; CHECK-P8-NEXT: addi r1, r1, 48
296 ; CHECK-P8-NEXT: ld r0, 16(r1)
297 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
298 ; CHECK-P8-NEXT: mtlr r0
301 %conv = uitofp i128 %b to fp128
302 store fp128 %conv, fp128* %a, align 16
307 ; Function Attrs: norecurse nounwind
308 define void @udwConv2qp_02(fp128* nocapture %a) {
309 ; CHECK-LABEL: udwConv2qp_02:
310 ; CHECK: # %bb.0: # %entry
311 ; CHECK-NEXT: addis r4, r2, .LC1@toc@ha
312 ; CHECK-NEXT: ld r4, .LC1@toc@l(r4)
313 ; CHECK-NEXT: lxsd v2, 32(r4)
314 ; CHECK-NEXT: xscvudqp v2, v2
315 ; CHECK-NEXT: stxv v2, 0(r3)
318 ; CHECK-P8-LABEL: udwConv2qp_02:
319 ; CHECK-P8: # %bb.0: # %entry
320 ; CHECK-P8-NEXT: mflr r0
321 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
322 ; CHECK-P8-NEXT: .cfi_offset lr, 16
323 ; CHECK-P8-NEXT: .cfi_offset r30, -16
324 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
325 ; CHECK-P8-NEXT: std r0, 16(r1)
326 ; CHECK-P8-NEXT: stdu r1, -48(r1)
327 ; CHECK-P8-NEXT: addis r4, r2, .LC1@toc@ha
328 ; CHECK-P8-NEXT: mr r30, r3
329 ; CHECK-P8-NEXT: ld r4, .LC1@toc@l(r4)
330 ; CHECK-P8-NEXT: ld r4, 32(r4)
331 ; CHECK-P8-NEXT: mr r3, r4
332 ; CHECK-P8-NEXT: bl __floatundikf
334 ; CHECK-P8-NEXT: stvx v2, 0, r30
335 ; CHECK-P8-NEXT: addi r1, r1, 48
336 ; CHECK-P8-NEXT: ld r0, 16(r1)
337 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
338 ; CHECK-P8-NEXT: mtlr r0
341 %0 = load i64, i64* getelementptr inbounds
342 ([5 x i64], [5 x i64]* @umem, i64 0, i64 4), align 8
343 %conv = uitofp i64 %0 to fp128
344 store fp128 %conv, fp128* %a, align 16
349 ; Function Attrs: norecurse nounwind
350 define void @udwConv2qp_03(fp128* nocapture %a, i64* nocapture readonly %b) {
351 ; CHECK-LABEL: udwConv2qp_03:
352 ; CHECK: # %bb.0: # %entry
353 ; CHECK-NEXT: lxsd v2, 0(r4)
354 ; CHECK-NEXT: xscvudqp v2, v2
355 ; CHECK-NEXT: stxv v2, 0(r3)
358 ; CHECK-P8-LABEL: udwConv2qp_03:
359 ; CHECK-P8: # %bb.0: # %entry
360 ; CHECK-P8-NEXT: mflr r0
361 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
362 ; CHECK-P8-NEXT: .cfi_offset lr, 16
363 ; CHECK-P8-NEXT: .cfi_offset r30, -16
364 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
365 ; CHECK-P8-NEXT: std r0, 16(r1)
366 ; CHECK-P8-NEXT: stdu r1, -48(r1)
367 ; CHECK-P8-NEXT: ld r4, 0(r4)
368 ; CHECK-P8-NEXT: mr r30, r3
369 ; CHECK-P8-NEXT: mr r3, r4
370 ; CHECK-P8-NEXT: bl __floatundikf
372 ; CHECK-P8-NEXT: stvx v2, 0, r30
373 ; CHECK-P8-NEXT: addi r1, r1, 48
374 ; CHECK-P8-NEXT: ld r0, 16(r1)
375 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
376 ; CHECK-P8-NEXT: mtlr r0
379 %0 = load i64, i64* %b, align 8
380 %conv = uitofp i64 %0 to fp128
381 store fp128 %conv, fp128* %a, align 16
386 ; Function Attrs: norecurse nounwind
387 define void @udwConv2qp_04(fp128* nocapture %a, i1 %b) {
388 ; CHECK-LABEL: udwConv2qp_04:
389 ; CHECK: # %bb.0: # %entry
390 ; CHECK-NEXT: clrlwi r4, r4, 31
391 ; CHECK-NEXT: mtvsrwa v2, r4
392 ; CHECK-NEXT: xscvsdqp v2, v2
393 ; CHECK-NEXT: stxv v2, 0(r3)
396 ; CHECK-P8-LABEL: udwConv2qp_04:
397 ; CHECK-P8: # %bb.0: # %entry
398 ; CHECK-P8-NEXT: mflr r0
399 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
400 ; CHECK-P8-NEXT: .cfi_offset lr, 16
401 ; CHECK-P8-NEXT: .cfi_offset r30, -16
402 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
403 ; CHECK-P8-NEXT: std r0, 16(r1)
404 ; CHECK-P8-NEXT: stdu r1, -48(r1)
405 ; CHECK-P8-NEXT: mr r30, r3
406 ; CHECK-P8-NEXT: clrldi r3, r4, 63
407 ; CHECK-P8-NEXT: bl __floatsikf
409 ; CHECK-P8-NEXT: stvx v2, 0, r30
410 ; CHECK-P8-NEXT: addi r1, r1, 48
411 ; CHECK-P8-NEXT: ld r0, 16(r1)
412 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
413 ; CHECK-P8-NEXT: mtlr r0
416 %conv = uitofp i1 %b to fp128
417 store fp128 %conv, fp128* %a, align 16
422 ; Function Attrs: norecurse nounwind
423 define fp128* @sdwConv2qp_testXForm(fp128* returned %sink,
424 ; CHECK-LABEL: sdwConv2qp_testXForm:
425 ; CHECK: # %bb.0: # %entry
426 ; CHECK-NEXT: lis r5, 1
427 ; CHECK-NEXT: ori r5, r5, 7797
428 ; CHECK-NEXT: lxsdx v2, r4, r5
429 ; CHECK-NEXT: xscvsdqp v2, v2
430 ; CHECK-NEXT: stxv v2, 0(r3)
433 ; CHECK-P8-LABEL: sdwConv2qp_testXForm:
434 ; CHECK-P8: # %bb.0: # %entry
435 ; CHECK-P8-NEXT: mflr r0
436 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
437 ; CHECK-P8-NEXT: .cfi_offset lr, 16
438 ; CHECK-P8-NEXT: .cfi_offset r30, -16
439 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
440 ; CHECK-P8-NEXT: std r0, 16(r1)
441 ; CHECK-P8-NEXT: stdu r1, -48(r1)
442 ; CHECK-P8-NEXT: lis r5, 1
443 ; CHECK-P8-NEXT: mr r30, r3
444 ; CHECK-P8-NEXT: ori r5, r5, 7797
445 ; CHECK-P8-NEXT: ldx r4, r4, r5
446 ; CHECK-P8-NEXT: mr r3, r4
447 ; CHECK-P8-NEXT: bl __floatdikf
449 ; CHECK-P8-NEXT: mr r3, r30
450 ; CHECK-P8-NEXT: stvx v2, 0, r30
451 ; CHECK-P8-NEXT: addi r1, r1, 48
452 ; CHECK-P8-NEXT: ld r0, 16(r1)
453 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
454 ; CHECK-P8-NEXT: mtlr r0
456 i8* nocapture readonly %a) {
458 %add.ptr = getelementptr inbounds i8, i8* %a, i64 73333
459 %0 = bitcast i8* %add.ptr to i64*
460 %1 = load i64, i64* %0, align 8
461 %conv = sitofp i64 %1 to fp128
462 store fp128 %conv, fp128* %sink, align 16
467 ; Function Attrs: norecurse nounwind
468 define fp128* @udwConv2qp_testXForm(fp128* returned %sink,
469 ; CHECK-LABEL: udwConv2qp_testXForm:
470 ; CHECK: # %bb.0: # %entry
471 ; CHECK-NEXT: lis r5, 1
472 ; CHECK-NEXT: ori r5, r5, 7797
473 ; CHECK-NEXT: lxsdx v2, r4, r5
474 ; CHECK-NEXT: xscvudqp v2, v2
475 ; CHECK-NEXT: stxv v2, 0(r3)
478 ; CHECK-P8-LABEL: udwConv2qp_testXForm:
479 ; CHECK-P8: # %bb.0: # %entry
480 ; CHECK-P8-NEXT: mflr r0
481 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
482 ; CHECK-P8-NEXT: .cfi_offset lr, 16
483 ; CHECK-P8-NEXT: .cfi_offset r30, -16
484 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
485 ; CHECK-P8-NEXT: std r0, 16(r1)
486 ; CHECK-P8-NEXT: stdu r1, -48(r1)
487 ; CHECK-P8-NEXT: lis r5, 1
488 ; CHECK-P8-NEXT: mr r30, r3
489 ; CHECK-P8-NEXT: ori r5, r5, 7797
490 ; CHECK-P8-NEXT: ldx r4, r4, r5
491 ; CHECK-P8-NEXT: mr r3, r4
492 ; CHECK-P8-NEXT: bl __floatundikf
494 ; CHECK-P8-NEXT: mr r3, r30
495 ; CHECK-P8-NEXT: stvx v2, 0, r30
496 ; CHECK-P8-NEXT: addi r1, r1, 48
497 ; CHECK-P8-NEXT: ld r0, 16(r1)
498 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
499 ; CHECK-P8-NEXT: mtlr r0
501 i8* nocapture readonly %a) {
503 %add.ptr = getelementptr inbounds i8, i8* %a, i64 73333
504 %0 = bitcast i8* %add.ptr to i64*
505 %1 = load i64, i64* %0, align 8
506 %conv = uitofp i64 %1 to fp128
507 store fp128 %conv, fp128* %sink, align 16
512 ; Function Attrs: norecurse nounwind
513 define void @swConv2qp(fp128* nocapture %a, i32 signext %b) {
514 ; CHECK-LABEL: swConv2qp:
515 ; CHECK: # %bb.0: # %entry
516 ; CHECK-NEXT: mtvsrwa v2, r4
517 ; CHECK-NEXT: xscvsdqp v2, v2
518 ; CHECK-NEXT: stxv v2, 0(r3)
521 ; CHECK-P8-LABEL: swConv2qp:
522 ; CHECK-P8: # %bb.0: # %entry
523 ; CHECK-P8-NEXT: mflr r0
524 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
525 ; CHECK-P8-NEXT: .cfi_offset lr, 16
526 ; CHECK-P8-NEXT: .cfi_offset r30, -16
527 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
528 ; CHECK-P8-NEXT: std r0, 16(r1)
529 ; CHECK-P8-NEXT: stdu r1, -48(r1)
530 ; CHECK-P8-NEXT: mr r30, r3
531 ; CHECK-P8-NEXT: mr r3, r4
532 ; CHECK-P8-NEXT: bl __floatsikf
534 ; CHECK-P8-NEXT: stvx v2, 0, r30
535 ; CHECK-P8-NEXT: addi r1, r1, 48
536 ; CHECK-P8-NEXT: ld r0, 16(r1)
537 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
538 ; CHECK-P8-NEXT: mtlr r0
541 %conv = sitofp i32 %b to fp128
542 store fp128 %conv, fp128* %a, align 16
547 ; Function Attrs: norecurse nounwind
548 define void @swConv2qp_02(fp128* nocapture %a, i32* nocapture readonly %b) {
549 ; CHECK-LABEL: swConv2qp_02:
550 ; CHECK: # %bb.0: # %entry
551 ; CHECK-NEXT: lxsiwax v2, 0, r4
552 ; CHECK-NEXT: xscvsdqp v2, v2
553 ; CHECK-NEXT: stxv v2, 0(r3)
556 ; CHECK-P8-LABEL: swConv2qp_02:
557 ; CHECK-P8: # %bb.0: # %entry
558 ; CHECK-P8-NEXT: mflr r0
559 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
560 ; CHECK-P8-NEXT: .cfi_offset lr, 16
561 ; CHECK-P8-NEXT: .cfi_offset r30, -16
562 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
563 ; CHECK-P8-NEXT: std r0, 16(r1)
564 ; CHECK-P8-NEXT: stdu r1, -48(r1)
565 ; CHECK-P8-NEXT: lwa r4, 0(r4)
566 ; CHECK-P8-NEXT: mr r30, r3
567 ; CHECK-P8-NEXT: mr r3, r4
568 ; CHECK-P8-NEXT: bl __floatsikf
570 ; CHECK-P8-NEXT: stvx v2, 0, r30
571 ; CHECK-P8-NEXT: addi r1, r1, 48
572 ; CHECK-P8-NEXT: ld r0, 16(r1)
573 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
574 ; CHECK-P8-NEXT: mtlr r0
577 %0 = load i32, i32* %b, align 4
578 %conv = sitofp i32 %0 to fp128
579 store fp128 %conv, fp128* %a, align 16
584 ; Function Attrs: norecurse nounwind
585 define void @swConv2qp_03(fp128* nocapture %a) {
586 ; CHECK-LABEL: swConv2qp_03:
587 ; CHECK: # %bb.0: # %entry
588 ; CHECK-NEXT: addis r4, r2, .LC2@toc@ha
589 ; CHECK-NEXT: ld r4, .LC2@toc@l(r4)
590 ; CHECK-NEXT: addi r4, r4, 12
591 ; CHECK-NEXT: lxsiwax v2, 0, r4
592 ; CHECK-NEXT: xscvsdqp v2, v2
593 ; CHECK-NEXT: stxv v2, 0(r3)
596 ; CHECK-P8-LABEL: swConv2qp_03:
597 ; CHECK-P8: # %bb.0: # %entry
598 ; CHECK-P8-NEXT: mflr r0
599 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
600 ; CHECK-P8-NEXT: .cfi_offset lr, 16
601 ; CHECK-P8-NEXT: .cfi_offset r30, -16
602 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
603 ; CHECK-P8-NEXT: std r0, 16(r1)
604 ; CHECK-P8-NEXT: stdu r1, -48(r1)
605 ; CHECK-P8-NEXT: addis r4, r2, .LC2@toc@ha
606 ; CHECK-P8-NEXT: mr r30, r3
607 ; CHECK-P8-NEXT: ld r4, .LC2@toc@l(r4)
608 ; CHECK-P8-NEXT: lwa r4, 12(r4)
609 ; CHECK-P8-NEXT: mr r3, r4
610 ; CHECK-P8-NEXT: bl __floatsikf
612 ; CHECK-P8-NEXT: stvx v2, 0, r30
613 ; CHECK-P8-NEXT: addi r1, r1, 48
614 ; CHECK-P8-NEXT: ld r0, 16(r1)
615 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
616 ; CHECK-P8-NEXT: mtlr r0
619 %0 = load i32, i32* getelementptr inbounds
620 ([5 x i32], [5 x i32]* @swMem, i64 0, i64 3), align 4
621 %conv = sitofp i32 %0 to fp128
622 store fp128 %conv, fp128* %a, align 16
627 ; Function Attrs: norecurse nounwind
628 define void @uwConv2qp(fp128* nocapture %a, i32 zeroext %b) {
629 ; CHECK-LABEL: uwConv2qp:
630 ; CHECK: # %bb.0: # %entry
631 ; CHECK-NEXT: mtvsrwz v2, r4
632 ; CHECK-NEXT: xscvudqp v2, v2
633 ; CHECK-NEXT: stxv v2, 0(r3)
636 ; CHECK-P8-LABEL: uwConv2qp:
637 ; CHECK-P8: # %bb.0: # %entry
638 ; CHECK-P8-NEXT: mflr r0
639 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
640 ; CHECK-P8-NEXT: .cfi_offset lr, 16
641 ; CHECK-P8-NEXT: .cfi_offset r30, -16
642 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
643 ; CHECK-P8-NEXT: std r0, 16(r1)
644 ; CHECK-P8-NEXT: stdu r1, -48(r1)
645 ; CHECK-P8-NEXT: mr r30, r3
646 ; CHECK-P8-NEXT: mr r3, r4
647 ; CHECK-P8-NEXT: bl __floatunsikf
649 ; CHECK-P8-NEXT: stvx v2, 0, r30
650 ; CHECK-P8-NEXT: addi r1, r1, 48
651 ; CHECK-P8-NEXT: ld r0, 16(r1)
652 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
653 ; CHECK-P8-NEXT: mtlr r0
656 %conv = uitofp i32 %b to fp128
657 store fp128 %conv, fp128* %a, align 16
662 ; Function Attrs: norecurse nounwind
663 define void @uwConv2qp_02(fp128* nocapture %a, i32* nocapture readonly %b) {
664 ; CHECK-LABEL: uwConv2qp_02:
665 ; CHECK: # %bb.0: # %entry
666 ; CHECK-NEXT: lxsiwzx v2, 0, r4
667 ; CHECK-NEXT: xscvudqp v2, v2
668 ; CHECK-NEXT: stxv v2, 0(r3)
671 ; CHECK-P8-LABEL: uwConv2qp_02:
672 ; CHECK-P8: # %bb.0: # %entry
673 ; CHECK-P8-NEXT: mflr r0
674 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
675 ; CHECK-P8-NEXT: .cfi_offset lr, 16
676 ; CHECK-P8-NEXT: .cfi_offset r30, -16
677 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
678 ; CHECK-P8-NEXT: std r0, 16(r1)
679 ; CHECK-P8-NEXT: stdu r1, -48(r1)
680 ; CHECK-P8-NEXT: lwz r4, 0(r4)
681 ; CHECK-P8-NEXT: mr r30, r3
682 ; CHECK-P8-NEXT: mr r3, r4
683 ; CHECK-P8-NEXT: bl __floatunsikf
685 ; CHECK-P8-NEXT: stvx v2, 0, r30
686 ; CHECK-P8-NEXT: addi r1, r1, 48
687 ; CHECK-P8-NEXT: ld r0, 16(r1)
688 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
689 ; CHECK-P8-NEXT: mtlr r0
692 %0 = load i32, i32* %b, align 4
693 %conv = uitofp i32 %0 to fp128
694 store fp128 %conv, fp128* %a, align 16
699 ; Function Attrs: norecurse nounwind
700 define void @uwConv2qp_03(fp128* nocapture %a) {
701 ; CHECK-LABEL: uwConv2qp_03:
702 ; CHECK: # %bb.0: # %entry
703 ; CHECK-NEXT: addis r4, r2, .LC3@toc@ha
704 ; CHECK-NEXT: ld r4, .LC3@toc@l(r4)
705 ; CHECK-NEXT: addi r4, r4, 12
706 ; CHECK-NEXT: lxsiwzx v2, 0, r4
707 ; CHECK-NEXT: xscvudqp v2, v2
708 ; CHECK-NEXT: stxv v2, 0(r3)
711 ; CHECK-P8-LABEL: uwConv2qp_03:
712 ; CHECK-P8: # %bb.0: # %entry
713 ; CHECK-P8-NEXT: mflr r0
714 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
715 ; CHECK-P8-NEXT: .cfi_offset lr, 16
716 ; CHECK-P8-NEXT: .cfi_offset r30, -16
717 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
718 ; CHECK-P8-NEXT: std r0, 16(r1)
719 ; CHECK-P8-NEXT: stdu r1, -48(r1)
720 ; CHECK-P8-NEXT: addis r4, r2, .LC3@toc@ha
721 ; CHECK-P8-NEXT: mr r30, r3
722 ; CHECK-P8-NEXT: ld r4, .LC3@toc@l(r4)
723 ; CHECK-P8-NEXT: lwz r4, 12(r4)
724 ; CHECK-P8-NEXT: mr r3, r4
725 ; CHECK-P8-NEXT: bl __floatunsikf
727 ; CHECK-P8-NEXT: stvx v2, 0, r30
728 ; CHECK-P8-NEXT: addi r1, r1, 48
729 ; CHECK-P8-NEXT: ld r0, 16(r1)
730 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
731 ; CHECK-P8-NEXT: mtlr r0
734 %0 = load i32, i32* getelementptr inbounds
735 ([5 x i32], [5 x i32]* @uwMem, i64 0, i64 3), align 4
736 %conv = uitofp i32 %0 to fp128
737 store fp128 %conv, fp128* %a, align 16
742 ; Function Attrs: norecurse nounwind
743 define void @uwConv2qp_04(fp128* nocapture %a,
744 ; CHECK-LABEL: uwConv2qp_04:
745 ; CHECK: # %bb.0: # %entry
746 ; CHECK-NEXT: lwz r5, 0(r5)
747 ; CHECK-NEXT: add r4, r5, r4
748 ; CHECK-NEXT: mtvsrwz v2, r4
749 ; CHECK-NEXT: xscvudqp v2, v2
750 ; CHECK-NEXT: stxv v2, 0(r3)
753 ; CHECK-P8-LABEL: uwConv2qp_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: std r0, 16(r1)
761 ; CHECK-P8-NEXT: stdu r1, -48(r1)
762 ; CHECK-P8-NEXT: mr r30, r3
763 ; CHECK-P8-NEXT: lwz r3, 0(r5)
764 ; CHECK-P8-NEXT: add r3, r3, r4
765 ; CHECK-P8-NEXT: clrldi r3, r3, 32
766 ; CHECK-P8-NEXT: bl __floatunsikf
768 ; CHECK-P8-NEXT: stvx v2, 0, r30
769 ; CHECK-P8-NEXT: addi r1, r1, 48
770 ; CHECK-P8-NEXT: ld r0, 16(r1)
771 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
772 ; CHECK-P8-NEXT: mtlr r0
774 i32 zeroext %b, i32* nocapture readonly %c) {
776 %0 = load i32, i32* %c, align 4
777 %add = add i32 %0, %b
778 %conv = uitofp i32 %add to fp128
779 store fp128 %conv, fp128* %a, align 16
784 ; Function Attrs: norecurse nounwind
785 define void @uhwConv2qp(fp128* nocapture %a, i16 zeroext %b) {
786 ; CHECK-LABEL: uhwConv2qp:
787 ; CHECK: # %bb.0: # %entry
788 ; CHECK-NEXT: mtvsrwz v2, r4
789 ; CHECK-NEXT: xscvudqp v2, v2
790 ; CHECK-NEXT: stxv v2, 0(r3)
793 ; CHECK-P8-LABEL: uhwConv2qp:
794 ; CHECK-P8: # %bb.0: # %entry
795 ; CHECK-P8-NEXT: mflr r0
796 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
797 ; CHECK-P8-NEXT: .cfi_offset lr, 16
798 ; CHECK-P8-NEXT: .cfi_offset r30, -16
799 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
800 ; CHECK-P8-NEXT: std r0, 16(r1)
801 ; CHECK-P8-NEXT: stdu r1, -48(r1)
802 ; CHECK-P8-NEXT: mr r30, r3
803 ; CHECK-P8-NEXT: mr r3, r4
804 ; CHECK-P8-NEXT: bl __floatunsikf
806 ; CHECK-P8-NEXT: stvx v2, 0, r30
807 ; CHECK-P8-NEXT: addi r1, r1, 48
808 ; CHECK-P8-NEXT: ld r0, 16(r1)
809 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
810 ; CHECK-P8-NEXT: mtlr r0
813 %conv = uitofp i16 %b to fp128
814 store fp128 %conv, fp128* %a, align 16
820 ; Function Attrs: norecurse nounwind
821 define void @uhwConv2qp_02(fp128* nocapture %a, i16* nocapture readonly %b) {
822 ; CHECK-LABEL: uhwConv2qp_02:
823 ; CHECK: # %bb.0: # %entry
824 ; CHECK-NEXT: lxsihzx v2, 0, r4
825 ; CHECK-NEXT: xscvudqp v2, v2
826 ; CHECK-NEXT: stxv v2, 0(r3)
829 ; CHECK-P8-LABEL: uhwConv2qp_02:
830 ; CHECK-P8: # %bb.0: # %entry
831 ; CHECK-P8-NEXT: mflr r0
832 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
833 ; CHECK-P8-NEXT: .cfi_offset lr, 16
834 ; CHECK-P8-NEXT: .cfi_offset r30, -16
835 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
836 ; CHECK-P8-NEXT: std r0, 16(r1)
837 ; CHECK-P8-NEXT: stdu r1, -48(r1)
838 ; CHECK-P8-NEXT: lhz r4, 0(r4)
839 ; CHECK-P8-NEXT: mr r30, r3
840 ; CHECK-P8-NEXT: mr r3, r4
841 ; CHECK-P8-NEXT: bl __floatunsikf
843 ; CHECK-P8-NEXT: stvx v2, 0, r30
844 ; CHECK-P8-NEXT: addi r1, r1, 48
845 ; CHECK-P8-NEXT: ld r0, 16(r1)
846 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
847 ; CHECK-P8-NEXT: mtlr r0
850 %0 = load i16, i16* %b, align 2
851 %conv = uitofp i16 %0 to fp128
852 store fp128 %conv, fp128* %a, align 16
857 ; Function Attrs: norecurse nounwind
858 define void @uhwConv2qp_03(fp128* nocapture %a) {
859 ; CHECK-LABEL: uhwConv2qp_03:
860 ; CHECK: # %bb.0: # %entry
861 ; CHECK-NEXT: addis r4, r2, .LC4@toc@ha
862 ; CHECK-NEXT: ld r4, .LC4@toc@l(r4)
863 ; CHECK-NEXT: addi r4, r4, 6
864 ; CHECK-NEXT: lxsihzx v2, 0, r4
865 ; CHECK-NEXT: xscvudqp v2, v2
866 ; CHECK-NEXT: stxv v2, 0(r3)
869 ; CHECK-P8-LABEL: uhwConv2qp_03:
870 ; CHECK-P8: # %bb.0: # %entry
871 ; CHECK-P8-NEXT: mflr r0
872 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
873 ; CHECK-P8-NEXT: .cfi_offset lr, 16
874 ; CHECK-P8-NEXT: .cfi_offset r30, -16
875 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
876 ; CHECK-P8-NEXT: std r0, 16(r1)
877 ; CHECK-P8-NEXT: stdu r1, -48(r1)
878 ; CHECK-P8-NEXT: addis r4, r2, .LC4@toc@ha
879 ; CHECK-P8-NEXT: mr r30, r3
880 ; CHECK-P8-NEXT: ld r4, .LC4@toc@l(r4)
881 ; CHECK-P8-NEXT: lhz r4, 6(r4)
882 ; CHECK-P8-NEXT: mr r3, r4
883 ; CHECK-P8-NEXT: bl __floatunsikf
885 ; CHECK-P8-NEXT: stvx v2, 0, r30
886 ; CHECK-P8-NEXT: addi r1, r1, 48
887 ; CHECK-P8-NEXT: ld r0, 16(r1)
888 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
889 ; CHECK-P8-NEXT: mtlr r0
892 %0 = load i16, i16* getelementptr inbounds
893 ([5 x i16], [5 x i16]* @uhwMem, i64 0, i64 3), align 2
894 %conv = uitofp i16 %0 to fp128
895 store fp128 %conv, fp128* %a, align 16
900 ; Function Attrs: norecurse nounwind
901 define void @uhwConv2qp_04(fp128* nocapture %a, i16 zeroext %b,
902 ; CHECK-LABEL: uhwConv2qp_04:
903 ; CHECK: # %bb.0: # %entry
904 ; CHECK-NEXT: lhz r5, 0(r5)
905 ; CHECK-NEXT: add r4, r5, r4
906 ; CHECK-NEXT: mtvsrwa v2, r4
907 ; CHECK-NEXT: xscvsdqp v2, v2
908 ; CHECK-NEXT: stxv v2, 0(r3)
911 ; CHECK-P8-LABEL: uhwConv2qp_04:
912 ; CHECK-P8: # %bb.0: # %entry
913 ; CHECK-P8-NEXT: mflr r0
914 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
915 ; CHECK-P8-NEXT: .cfi_offset lr, 16
916 ; CHECK-P8-NEXT: .cfi_offset r30, -16
917 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
918 ; CHECK-P8-NEXT: std r0, 16(r1)
919 ; CHECK-P8-NEXT: stdu r1, -48(r1)
920 ; CHECK-P8-NEXT: mr r30, r3
921 ; CHECK-P8-NEXT: lhz r3, 0(r5)
922 ; CHECK-P8-NEXT: add r3, r3, r4
923 ; CHECK-P8-NEXT: clrldi r3, r3, 32
924 ; CHECK-P8-NEXT: bl __floatsikf
926 ; CHECK-P8-NEXT: stvx v2, 0, r30
927 ; CHECK-P8-NEXT: addi r1, r1, 48
928 ; CHECK-P8-NEXT: ld r0, 16(r1)
929 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
930 ; CHECK-P8-NEXT: mtlr r0
932 i16* nocapture readonly %c) {
934 %conv = zext i16 %b to i32
935 %0 = load i16, i16* %c, align 2
936 %conv1 = zext i16 %0 to i32
937 %add = add nuw nsw i32 %conv1, %conv
938 %conv2 = sitofp i32 %add to fp128
939 store fp128 %conv2, fp128* %a, align 16
944 ; Function Attrs: norecurse nounwind
945 define void @ubConv2qp(fp128* nocapture %a, i8 zeroext %b) {
946 ; CHECK-LABEL: ubConv2qp:
947 ; CHECK: # %bb.0: # %entry
948 ; CHECK-NEXT: mtvsrwz v2, r4
949 ; CHECK-NEXT: xscvudqp v2, v2
950 ; CHECK-NEXT: stxv v2, 0(r3)
953 ; CHECK-P8-LABEL: ubConv2qp:
954 ; CHECK-P8: # %bb.0: # %entry
955 ; CHECK-P8-NEXT: mflr r0
956 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
957 ; CHECK-P8-NEXT: .cfi_offset lr, 16
958 ; CHECK-P8-NEXT: .cfi_offset r30, -16
959 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
960 ; CHECK-P8-NEXT: std r0, 16(r1)
961 ; CHECK-P8-NEXT: stdu r1, -48(r1)
962 ; CHECK-P8-NEXT: mr r30, r3
963 ; CHECK-P8-NEXT: mr r3, r4
964 ; CHECK-P8-NEXT: bl __floatunsikf
966 ; CHECK-P8-NEXT: stvx v2, 0, r30
967 ; CHECK-P8-NEXT: addi r1, r1, 48
968 ; CHECK-P8-NEXT: ld r0, 16(r1)
969 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
970 ; CHECK-P8-NEXT: mtlr r0
973 %conv = uitofp i8 %b to fp128
974 store fp128 %conv, fp128* %a, align 16
979 ; Function Attrs: norecurse nounwind
980 define void @ubConv2qp_02(fp128* nocapture %a, i8* nocapture readonly %b) {
981 ; CHECK-LABEL: ubConv2qp_02:
982 ; CHECK: # %bb.0: # %entry
983 ; CHECK-NEXT: lxsibzx v2, 0, r4
984 ; CHECK-NEXT: xscvudqp v2, v2
985 ; CHECK-NEXT: stxv v2, 0(r3)
988 ; CHECK-P8-LABEL: ubConv2qp_02:
989 ; CHECK-P8: # %bb.0: # %entry
990 ; CHECK-P8-NEXT: mflr r0
991 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
992 ; CHECK-P8-NEXT: .cfi_offset lr, 16
993 ; CHECK-P8-NEXT: .cfi_offset r30, -16
994 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
995 ; CHECK-P8-NEXT: std r0, 16(r1)
996 ; CHECK-P8-NEXT: stdu r1, -48(r1)
997 ; CHECK-P8-NEXT: lbz r4, 0(r4)
998 ; CHECK-P8-NEXT: mr r30, r3
999 ; CHECK-P8-NEXT: mr r3, r4
1000 ; CHECK-P8-NEXT: bl __floatunsikf
1001 ; CHECK-P8-NEXT: nop
1002 ; CHECK-P8-NEXT: stvx v2, 0, r30
1003 ; CHECK-P8-NEXT: addi r1, r1, 48
1004 ; CHECK-P8-NEXT: ld r0, 16(r1)
1005 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1006 ; CHECK-P8-NEXT: mtlr r0
1007 ; CHECK-P8-NEXT: blr
1009 %0 = load i8, i8* %b, align 1
1010 %conv = uitofp i8 %0 to fp128
1011 store fp128 %conv, fp128* %a, align 16
1016 ; Function Attrs: norecurse nounwind
1017 define void @ubConv2qp_03(fp128* nocapture %a) {
1018 ; CHECK-LABEL: ubConv2qp_03:
1019 ; CHECK: # %bb.0: # %entry
1020 ; CHECK-NEXT: addis r4, r2, .LC5@toc@ha
1021 ; CHECK-NEXT: ld r4, .LC5@toc@l(r4)
1022 ; CHECK-NEXT: addi r4, r4, 2
1023 ; CHECK-NEXT: lxsibzx v2, 0, r4
1024 ; CHECK-NEXT: xscvudqp v2, v2
1025 ; CHECK-NEXT: stxv v2, 0(r3)
1028 ; CHECK-P8-LABEL: ubConv2qp_03:
1029 ; CHECK-P8: # %bb.0: # %entry
1030 ; CHECK-P8-NEXT: mflr r0
1031 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1032 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1033 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1034 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1035 ; CHECK-P8-NEXT: std r0, 16(r1)
1036 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1037 ; CHECK-P8-NEXT: addis r4, r2, .LC5@toc@ha
1038 ; CHECK-P8-NEXT: mr r30, r3
1039 ; CHECK-P8-NEXT: ld r4, .LC5@toc@l(r4)
1040 ; CHECK-P8-NEXT: lbz r4, 2(r4)
1041 ; CHECK-P8-NEXT: mr r3, r4
1042 ; CHECK-P8-NEXT: bl __floatunsikf
1043 ; CHECK-P8-NEXT: nop
1044 ; CHECK-P8-NEXT: stvx v2, 0, r30
1045 ; CHECK-P8-NEXT: addi r1, r1, 48
1046 ; CHECK-P8-NEXT: ld r0, 16(r1)
1047 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1048 ; CHECK-P8-NEXT: mtlr r0
1049 ; CHECK-P8-NEXT: blr
1051 %0 = load i8, i8* getelementptr inbounds
1052 ([5 x i8], [5 x i8]* @ubMem, i64 0, i64 2), align 1
1053 %conv = uitofp i8 %0 to fp128
1054 store fp128 %conv, fp128* %a, align 16
1059 ; Function Attrs: norecurse nounwind
1060 define void @ubConv2qp_04(fp128* nocapture %a, i8 zeroext %b,
1061 ; CHECK-LABEL: ubConv2qp_04:
1062 ; CHECK: # %bb.0: # %entry
1063 ; CHECK-NEXT: lbz r5, 0(r5)
1064 ; CHECK-NEXT: add r4, r5, r4
1065 ; CHECK-NEXT: mtvsrwa v2, r4
1066 ; CHECK-NEXT: xscvsdqp v2, v2
1067 ; CHECK-NEXT: stxv v2, 0(r3)
1070 ; CHECK-P8-LABEL: ubConv2qp_04:
1071 ; CHECK-P8: # %bb.0: # %entry
1072 ; CHECK-P8-NEXT: mflr r0
1073 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1074 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1075 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1076 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1077 ; CHECK-P8-NEXT: std r0, 16(r1)
1078 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1079 ; CHECK-P8-NEXT: mr r30, r3
1080 ; CHECK-P8-NEXT: lbz r3, 0(r5)
1081 ; CHECK-P8-NEXT: add r3, r3, r4
1082 ; CHECK-P8-NEXT: clrldi r3, r3, 32
1083 ; CHECK-P8-NEXT: bl __floatsikf
1084 ; CHECK-P8-NEXT: nop
1085 ; CHECK-P8-NEXT: stvx v2, 0, r30
1086 ; CHECK-P8-NEXT: addi r1, r1, 48
1087 ; CHECK-P8-NEXT: ld r0, 16(r1)
1088 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1089 ; CHECK-P8-NEXT: mtlr r0
1090 ; CHECK-P8-NEXT: blr
1091 i8* nocapture readonly %c) {
1093 %conv = zext i8 %b to i32
1094 %0 = load i8, i8* %c, align 1
1095 %conv1 = zext i8 %0 to i32
1096 %add = add nuw nsw i32 %conv1, %conv
1097 %conv2 = sitofp i32 %add to fp128
1098 store fp128 %conv2, fp128* %a, align 16
1105 @f128Array = global [4 x fp128]
1106 [fp128 0xL00000000000000004004C00000000000,
1107 fp128 0xLF000000000000000400808AB851EB851,
1108 fp128 0xL5000000000000000400E0C26324C8366,
1109 fp128 0xL8000000000000000400A24E2E147AE14], align 16
1110 @f128global = global fp128 0xL300000000000000040089CA8F5C28F5C, align 16
1112 ; Function Attrs: norecurse nounwind readonly
1113 define double @qpConv2dp(fp128* nocapture readonly %a) {
1114 ; CHECK-LABEL: qpConv2dp:
1115 ; CHECK: # %bb.0: # %entry
1116 ; CHECK-NEXT: lxv v2, 0(r3)
1117 ; CHECK-NEXT: xscvqpdp v2, v2
1118 ; CHECK-NEXT: xscpsgndp f1, v2, v2
1121 ; CHECK-P8-LABEL: qpConv2dp:
1122 ; CHECK-P8: # %bb.0: # %entry
1123 ; CHECK-P8-NEXT: mflr r0
1124 ; CHECK-P8-NEXT: std r0, 16(r1)
1125 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1126 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1127 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1128 ; CHECK-P8-NEXT: lvx v2, 0, r3
1129 ; CHECK-P8-NEXT: bl __trunckfdf2
1130 ; CHECK-P8-NEXT: nop
1131 ; CHECK-P8-NEXT: addi r1, r1, 32
1132 ; CHECK-P8-NEXT: ld r0, 16(r1)
1133 ; CHECK-P8-NEXT: mtlr r0
1134 ; CHECK-P8-NEXT: blr
1136 %0 = load fp128, fp128* %a, align 16
1137 %conv = fptrunc fp128 %0 to double
1141 ; Function Attrs: norecurse nounwind
1142 define void @qpConv2dp_02(double* nocapture %res) {
1143 ; CHECK-LABEL: qpConv2dp_02:
1144 ; CHECK: # %bb.0: # %entry
1145 ; CHECK-NEXT: addis r4, r2, .LC6@toc@ha
1146 ; CHECK-NEXT: ld r4, .LC6@toc@l(r4)
1147 ; CHECK-NEXT: lxv v2, 0(r4)
1148 ; CHECK-NEXT: xscvqpdp v2, v2
1149 ; CHECK-NEXT: stxsd v2, 0(r3)
1152 ; CHECK-P8-LABEL: qpConv2dp_02:
1153 ; CHECK-P8: # %bb.0: # %entry
1154 ; CHECK-P8-NEXT: mflr r0
1155 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1156 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1157 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1158 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1159 ; CHECK-P8-NEXT: std r0, 16(r1)
1160 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1161 ; CHECK-P8-NEXT: addis r4, r2, .LC6@toc@ha
1162 ; CHECK-P8-NEXT: mr r30, r3
1163 ; CHECK-P8-NEXT: ld r4, .LC6@toc@l(r4)
1164 ; CHECK-P8-NEXT: lvx v2, 0, r4
1165 ; CHECK-P8-NEXT: bl __trunckfdf2
1166 ; CHECK-P8-NEXT: nop
1167 ; CHECK-P8-NEXT: stfd f1, 0(r30)
1168 ; CHECK-P8-NEXT: addi r1, r1, 48
1169 ; CHECK-P8-NEXT: ld r0, 16(r1)
1170 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1171 ; CHECK-P8-NEXT: mtlr r0
1172 ; CHECK-P8-NEXT: blr
1174 %0 = load fp128, fp128* @f128global, align 16
1175 %conv = fptrunc fp128 %0 to double
1176 store double %conv, double* %res, align 8
1180 ; Function Attrs: norecurse nounwind
1181 define void @qpConv2dp_03(double* nocapture %res, i32 signext %idx) {
1182 ; CHECK-LABEL: qpConv2dp_03:
1183 ; CHECK: # %bb.0: # %entry
1184 ; CHECK-NEXT: addis r5, r2, .LC7@toc@ha
1185 ; CHECK-NEXT: sldi r4, r4, 3
1186 ; CHECK-NEXT: ld r5, .LC7@toc@l(r5)
1187 ; CHECK-NEXT: lxv v2, 0(r5)
1188 ; CHECK-NEXT: xscvqpdp v2, v2
1189 ; CHECK-NEXT: stxsdx v2, r3, r4
1192 ; CHECK-P8-LABEL: qpConv2dp_03:
1193 ; CHECK-P8: # %bb.0: # %entry
1194 ; CHECK-P8-NEXT: mflr r0
1195 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 64
1196 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1197 ; CHECK-P8-NEXT: .cfi_offset r29, -24
1198 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1199 ; CHECK-P8-NEXT: std r29, -24(r1) # 8-byte Folded Spill
1200 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1201 ; CHECK-P8-NEXT: std r0, 16(r1)
1202 ; CHECK-P8-NEXT: stdu r1, -64(r1)
1203 ; CHECK-P8-NEXT: mr r30, r4
1204 ; CHECK-P8-NEXT: addis r4, r2, .LC7@toc@ha
1205 ; CHECK-P8-NEXT: mr r29, r3
1206 ; CHECK-P8-NEXT: ld r4, .LC7@toc@l(r4)
1207 ; CHECK-P8-NEXT: lvx v2, 0, r4
1208 ; CHECK-P8-NEXT: bl __trunckfdf2
1209 ; CHECK-P8-NEXT: nop
1210 ; CHECK-P8-NEXT: sldi r3, r30, 3
1211 ; CHECK-P8-NEXT: stfdx f1, r29, r3
1212 ; CHECK-P8-NEXT: addi r1, r1, 64
1213 ; CHECK-P8-NEXT: ld r0, 16(r1)
1214 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1215 ; CHECK-P8-NEXT: ld r29, -24(r1) # 8-byte Folded Reload
1216 ; CHECK-P8-NEXT: mtlr r0
1217 ; CHECK-P8-NEXT: blr
1219 %0 = load fp128, fp128* getelementptr inbounds ([4 x fp128], [4 x fp128]* @f128Array, i64 0, i64 0), align 16
1220 %conv = fptrunc fp128 %0 to double
1221 %idxprom = sext i32 %idx to i64
1222 %arrayidx = getelementptr inbounds double, double* %res, i64 %idxprom
1223 store double %conv, double* %arrayidx, align 8
1227 ; Function Attrs: norecurse nounwind
1228 define void @qpConv2dp_04(fp128* nocapture readonly %a, fp128* nocapture readonly %b, double* nocapture %res) {
1229 ; CHECK-LABEL: qpConv2dp_04:
1230 ; CHECK: # %bb.0: # %entry
1231 ; CHECK-NEXT: lxv v2, 0(r3)
1232 ; CHECK-NEXT: lxv v3, 0(r4)
1233 ; CHECK-NEXT: xsaddqp v2, v2, v3
1234 ; CHECK-NEXT: xscvqpdp v2, v2
1235 ; CHECK-NEXT: stxsd v2, 0(r5)
1238 ; CHECK-P8-LABEL: qpConv2dp_04:
1239 ; CHECK-P8: # %bb.0: # %entry
1240 ; CHECK-P8-NEXT: mflr r0
1241 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1242 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1243 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1244 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1245 ; CHECK-P8-NEXT: std r0, 16(r1)
1246 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1247 ; CHECK-P8-NEXT: lvx v2, 0, r3
1248 ; CHECK-P8-NEXT: lvx v3, 0, r4
1249 ; CHECK-P8-NEXT: mr r30, r5
1250 ; CHECK-P8-NEXT: bl __addkf3
1251 ; CHECK-P8-NEXT: nop
1252 ; CHECK-P8-NEXT: bl __trunckfdf2
1253 ; CHECK-P8-NEXT: nop
1254 ; CHECK-P8-NEXT: stfd f1, 0(r30)
1255 ; CHECK-P8-NEXT: addi r1, r1, 48
1256 ; CHECK-P8-NEXT: ld r0, 16(r1)
1257 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1258 ; CHECK-P8-NEXT: mtlr r0
1259 ; CHECK-P8-NEXT: blr
1261 %0 = load fp128, fp128* %a, align 16
1262 %1 = load fp128, fp128* %b, align 16
1263 %add = fadd fp128 %0, %1
1264 %conv = fptrunc fp128 %add to double
1265 store double %conv, double* %res, align 8
1271 ; Function Attrs: norecurse nounwind readonly
1272 define float @qpConv2sp(fp128* nocapture readonly %a) {
1273 ; CHECK-LABEL: qpConv2sp:
1274 ; CHECK: # %bb.0: # %entry
1275 ; CHECK-NEXT: lxv v2, 0(r3)
1276 ; CHECK-NEXT: xscvqpdpo v2, v2
1277 ; CHECK-NEXT: xsrsp f1, v2
1280 ; CHECK-P8-LABEL: qpConv2sp:
1281 ; CHECK-P8: # %bb.0: # %entry
1282 ; CHECK-P8-NEXT: mflr r0
1283 ; CHECK-P8-NEXT: std r0, 16(r1)
1284 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1285 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1286 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1287 ; CHECK-P8-NEXT: lvx v2, 0, r3
1288 ; CHECK-P8-NEXT: bl __trunckfsf2
1289 ; CHECK-P8-NEXT: nop
1290 ; CHECK-P8-NEXT: addi r1, r1, 32
1291 ; CHECK-P8-NEXT: ld r0, 16(r1)
1292 ; CHECK-P8-NEXT: mtlr r0
1293 ; CHECK-P8-NEXT: blr
1295 %0 = load fp128, fp128* %a, align 16
1296 %conv = fptrunc fp128 %0 to float
1300 ; Function Attrs: norecurse nounwind
1301 define void @qpConv2sp_02(float* nocapture %res) {
1302 ; CHECK-LABEL: qpConv2sp_02:
1303 ; CHECK: # %bb.0: # %entry
1304 ; CHECK-NEXT: addis r4, r2, .LC6@toc@ha
1305 ; CHECK-NEXT: ld r4, .LC6@toc@l(r4)
1306 ; CHECK-NEXT: lxv v2, 0(r4)
1307 ; CHECK-NEXT: xscvqpdpo v2, v2
1308 ; CHECK-NEXT: xsrsp f0, v2
1309 ; CHECK-NEXT: stfs f0, 0(r3)
1312 ; CHECK-P8-LABEL: qpConv2sp_02:
1313 ; CHECK-P8: # %bb.0: # %entry
1314 ; CHECK-P8-NEXT: mflr r0
1315 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1316 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1317 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1318 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1319 ; CHECK-P8-NEXT: std r0, 16(r1)
1320 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1321 ; CHECK-P8-NEXT: addis r4, r2, .LC6@toc@ha
1322 ; CHECK-P8-NEXT: mr r30, r3
1323 ; CHECK-P8-NEXT: ld r4, .LC6@toc@l(r4)
1324 ; CHECK-P8-NEXT: lvx v2, 0, r4
1325 ; CHECK-P8-NEXT: bl __trunckfsf2
1326 ; CHECK-P8-NEXT: nop
1327 ; CHECK-P8-NEXT: stfs f1, 0(r30)
1328 ; CHECK-P8-NEXT: addi r1, r1, 48
1329 ; CHECK-P8-NEXT: ld r0, 16(r1)
1330 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1331 ; CHECK-P8-NEXT: mtlr r0
1332 ; CHECK-P8-NEXT: blr
1334 %0 = load fp128, fp128* @f128global, align 16
1335 %conv = fptrunc fp128 %0 to float
1336 store float %conv, float* %res, align 4
1340 ; Function Attrs: norecurse nounwind
1341 define void @qpConv2sp_03(float* nocapture %res, i32 signext %idx) {
1342 ; CHECK-LABEL: qpConv2sp_03:
1343 ; CHECK: # %bb.0: # %entry
1344 ; CHECK-NEXT: addis r5, r2, .LC7@toc@ha
1345 ; CHECK-NEXT: sldi r4, r4, 2
1346 ; CHECK-NEXT: ld r5, .LC7@toc@l(r5)
1347 ; CHECK-NEXT: lxv v2, 48(r5)
1348 ; CHECK-NEXT: xscvqpdpo v2, v2
1349 ; CHECK-NEXT: xsrsp f0, v2
1350 ; CHECK-NEXT: stfsx f0, r3, r4
1353 ; CHECK-P8-LABEL: qpConv2sp_03:
1354 ; CHECK-P8: # %bb.0: # %entry
1355 ; CHECK-P8-NEXT: mflr r0
1356 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 64
1357 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1358 ; CHECK-P8-NEXT: .cfi_offset r29, -24
1359 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1360 ; CHECK-P8-NEXT: std r29, -24(r1) # 8-byte Folded Spill
1361 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1362 ; CHECK-P8-NEXT: std r0, 16(r1)
1363 ; CHECK-P8-NEXT: stdu r1, -64(r1)
1364 ; CHECK-P8-NEXT: mr r30, r4
1365 ; CHECK-P8-NEXT: addis r4, r2, .LC7@toc@ha
1366 ; CHECK-P8-NEXT: mr r29, r3
1367 ; CHECK-P8-NEXT: ld r4, .LC7@toc@l(r4)
1368 ; CHECK-P8-NEXT: addi r4, r4, 48
1369 ; CHECK-P8-NEXT: lvx v2, 0, r4
1370 ; CHECK-P8-NEXT: bl __trunckfsf2
1371 ; CHECK-P8-NEXT: nop
1372 ; CHECK-P8-NEXT: sldi r3, r30, 2
1373 ; CHECK-P8-NEXT: stfsx f1, r29, r3
1374 ; CHECK-P8-NEXT: addi r1, r1, 64
1375 ; CHECK-P8-NEXT: ld r0, 16(r1)
1376 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1377 ; CHECK-P8-NEXT: ld r29, -24(r1) # 8-byte Folded Reload
1378 ; CHECK-P8-NEXT: mtlr r0
1379 ; CHECK-P8-NEXT: blr
1381 %0 = load fp128, fp128* getelementptr inbounds ([4 x fp128], [4 x fp128]* @f128Array, i64 0, i64 3), align 16
1382 %conv = fptrunc fp128 %0 to float
1383 %idxprom = sext i32 %idx to i64
1384 %arrayidx = getelementptr inbounds float, float* %res, i64 %idxprom
1385 store float %conv, float* %arrayidx, align 4
1389 ; Function Attrs: norecurse nounwind
1390 define void @qpConv2sp_04(fp128* nocapture readonly %a, fp128* nocapture readonly %b, float* nocapture %res) {
1391 ; CHECK-LABEL: qpConv2sp_04:
1392 ; CHECK: # %bb.0: # %entry
1393 ; CHECK-NEXT: lxv v2, 0(r3)
1394 ; CHECK-NEXT: lxv v3, 0(r4)
1395 ; CHECK-NEXT: xsaddqp v2, v2, v3
1396 ; CHECK-NEXT: xscvqpdpo v2, v2
1397 ; CHECK-NEXT: xsrsp f0, v2
1398 ; CHECK-NEXT: stfs f0, 0(r5)
1401 ; CHECK-P8-LABEL: qpConv2sp_04:
1402 ; CHECK-P8: # %bb.0: # %entry
1403 ; CHECK-P8-NEXT: mflr r0
1404 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1405 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1406 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1407 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1408 ; CHECK-P8-NEXT: std r0, 16(r1)
1409 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1410 ; CHECK-P8-NEXT: lvx v2, 0, r3
1411 ; CHECK-P8-NEXT: lvx v3, 0, r4
1412 ; CHECK-P8-NEXT: mr r30, r5
1413 ; CHECK-P8-NEXT: bl __addkf3
1414 ; CHECK-P8-NEXT: nop
1415 ; CHECK-P8-NEXT: bl __trunckfsf2
1416 ; CHECK-P8-NEXT: nop
1417 ; CHECK-P8-NEXT: stfs f1, 0(r30)
1418 ; CHECK-P8-NEXT: addi r1, r1, 48
1419 ; CHECK-P8-NEXT: ld r0, 16(r1)
1420 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1421 ; CHECK-P8-NEXT: mtlr r0
1422 ; CHECK-P8-NEXT: blr
1424 %0 = load fp128, fp128* %a, align 16
1425 %1 = load fp128, fp128* %b, align 16
1426 %add = fadd fp128 %0, %1
1427 %conv = fptrunc fp128 %add to float
1428 store float %conv, float* %res, align 4
1432 @f128Glob = common global fp128 0xL00000000000000000000000000000000, align 16
1434 ; Function Attrs: norecurse nounwind readnone
1435 define fp128 @dpConv2qp(double %a) {
1436 ; CHECK-LABEL: dpConv2qp:
1437 ; CHECK: # %bb.0: # %entry
1438 ; CHECK-NEXT: xscpsgndp v2, f1, f1
1439 ; CHECK-NEXT: xscvdpqp v2, v2
1442 ; CHECK-P8-LABEL: dpConv2qp:
1443 ; CHECK-P8: # %bb.0: # %entry
1444 ; CHECK-P8-NEXT: mflr r0
1445 ; CHECK-P8-NEXT: std r0, 16(r1)
1446 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1447 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1448 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1449 ; CHECK-P8-NEXT: bl __extenddfkf2
1450 ; CHECK-P8-NEXT: nop
1451 ; CHECK-P8-NEXT: addi r1, r1, 32
1452 ; CHECK-P8-NEXT: ld r0, 16(r1)
1453 ; CHECK-P8-NEXT: mtlr r0
1454 ; CHECK-P8-NEXT: blr
1456 %conv = fpext double %a to fp128
1460 ; Function Attrs: norecurse nounwind
1461 define void @dpConv2qp_02(double* nocapture readonly %a) {
1462 ; CHECK-LABEL: dpConv2qp_02:
1463 ; CHECK: # %bb.0: # %entry
1464 ; CHECK-NEXT: lxsd v2, 0(r3)
1465 ; CHECK-NEXT: addis r3, r2, .LC8@toc@ha
1466 ; CHECK-NEXT: ld r3, .LC8@toc@l(r3)
1467 ; CHECK-NEXT: xscvdpqp v2, v2
1468 ; CHECK-NEXT: stxv v2, 0(r3)
1471 ; CHECK-P8-LABEL: dpConv2qp_02:
1472 ; CHECK-P8: # %bb.0: # %entry
1473 ; CHECK-P8-NEXT: mflr r0
1474 ; CHECK-P8-NEXT: std r0, 16(r1)
1475 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1476 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1477 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1478 ; CHECK-P8-NEXT: lfd f1, 0(r3)
1479 ; CHECK-P8-NEXT: bl __extenddfkf2
1480 ; CHECK-P8-NEXT: nop
1481 ; CHECK-P8-NEXT: addis r3, r2, .LC8@toc@ha
1482 ; CHECK-P8-NEXT: ld r3, .LC8@toc@l(r3)
1483 ; CHECK-P8-NEXT: stvx v2, 0, r3
1484 ; CHECK-P8-NEXT: addi r1, r1, 32
1485 ; CHECK-P8-NEXT: ld r0, 16(r1)
1486 ; CHECK-P8-NEXT: mtlr r0
1487 ; CHECK-P8-NEXT: blr
1489 %0 = load double, double* %a, align 8
1490 %conv = fpext double %0 to fp128
1491 store fp128 %conv, fp128* @f128Glob, align 16
1495 ; Function Attrs: norecurse nounwind
1496 define void @dpConv2qp_02b(double* nocapture readonly %a, i32 signext %idx) {
1497 ; CHECK-LABEL: dpConv2qp_02b:
1498 ; CHECK: # %bb.0: # %entry
1499 ; CHECK-NEXT: sldi r4, r4, 3
1500 ; CHECK-NEXT: lxsdx v2, r3, r4
1501 ; CHECK-NEXT: addis r3, r2, .LC8@toc@ha
1502 ; CHECK-NEXT: ld r3, .LC8@toc@l(r3)
1503 ; CHECK-NEXT: xscvdpqp v2, v2
1504 ; CHECK-NEXT: stxv v2, 0(r3)
1507 ; CHECK-P8-LABEL: dpConv2qp_02b:
1508 ; CHECK-P8: # %bb.0: # %entry
1509 ; CHECK-P8-NEXT: mflr r0
1510 ; CHECK-P8-NEXT: std r0, 16(r1)
1511 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1512 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1513 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1514 ; CHECK-P8-NEXT: sldi r4, r4, 3
1515 ; CHECK-P8-NEXT: lfdx f1, r3, r4
1516 ; CHECK-P8-NEXT: bl __extenddfkf2
1517 ; CHECK-P8-NEXT: nop
1518 ; CHECK-P8-NEXT: addis r3, r2, .LC8@toc@ha
1519 ; CHECK-P8-NEXT: ld r3, .LC8@toc@l(r3)
1520 ; CHECK-P8-NEXT: stvx v2, 0, r3
1521 ; CHECK-P8-NEXT: addi r1, r1, 32
1522 ; CHECK-P8-NEXT: ld r0, 16(r1)
1523 ; CHECK-P8-NEXT: mtlr r0
1524 ; CHECK-P8-NEXT: blr
1526 %idxprom = sext i32 %idx to i64
1527 %arrayidx = getelementptr inbounds double, double* %a, i64 %idxprom
1528 %0 = load double, double* %arrayidx, align 8
1529 %conv = fpext double %0 to fp128
1530 store fp128 %conv, fp128* @f128Glob, align 16
1534 ; Function Attrs: norecurse nounwind
1535 define void @dpConv2qp_03(fp128* nocapture %res, i32 signext %idx, double %a) {
1536 ; CHECK-LABEL: dpConv2qp_03:
1537 ; CHECK: # %bb.0: # %entry
1538 ; CHECK-NEXT: xscpsgndp v2, f1, f1
1539 ; CHECK-NEXT: sldi r4, r4, 4
1540 ; CHECK-NEXT: xscvdpqp v2, v2
1541 ; CHECK-NEXT: stxvx v2, r3, r4
1544 ; CHECK-P8-LABEL: dpConv2qp_03:
1545 ; CHECK-P8: # %bb.0: # %entry
1546 ; CHECK-P8-NEXT: mflr r0
1547 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 64
1548 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1549 ; CHECK-P8-NEXT: .cfi_offset r29, -24
1550 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1551 ; CHECK-P8-NEXT: std r29, -24(r1) # 8-byte Folded Spill
1552 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1553 ; CHECK-P8-NEXT: std r0, 16(r1)
1554 ; CHECK-P8-NEXT: stdu r1, -64(r1)
1555 ; CHECK-P8-NEXT: mr r30, r4
1556 ; CHECK-P8-NEXT: mr r29, r3
1557 ; CHECK-P8-NEXT: bl __extenddfkf2
1558 ; CHECK-P8-NEXT: nop
1559 ; CHECK-P8-NEXT: sldi r3, r30, 4
1560 ; CHECK-P8-NEXT: stvx v2, r29, r3
1561 ; CHECK-P8-NEXT: addi r1, r1, 64
1562 ; CHECK-P8-NEXT: ld r0, 16(r1)
1563 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1564 ; CHECK-P8-NEXT: ld r29, -24(r1) # 8-byte Folded Reload
1565 ; CHECK-P8-NEXT: mtlr r0
1566 ; CHECK-P8-NEXT: blr
1568 %conv = fpext double %a to fp128
1569 %idxprom = sext i32 %idx to i64
1570 %arrayidx = getelementptr inbounds fp128, fp128* %res, i64 %idxprom
1571 store fp128 %conv, fp128* %arrayidx, align 16
1575 ; Function Attrs: norecurse nounwind
1576 define void @dpConv2qp_04(double %a, fp128* nocapture %res) {
1577 ; CHECK-LABEL: dpConv2qp_04:
1578 ; CHECK: # %bb.0: # %entry
1579 ; CHECK-NEXT: xscpsgndp v2, f1, f1
1580 ; CHECK-NEXT: xscvdpqp v2, v2
1581 ; CHECK-NEXT: stxv v2, 0(r4)
1584 ; CHECK-P8-LABEL: dpConv2qp_04:
1585 ; CHECK-P8: # %bb.0: # %entry
1586 ; CHECK-P8-NEXT: mflr r0
1587 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1588 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1589 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1590 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1591 ; CHECK-P8-NEXT: std r0, 16(r1)
1592 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1593 ; CHECK-P8-NEXT: mr r30, r4
1594 ; CHECK-P8-NEXT: bl __extenddfkf2
1595 ; CHECK-P8-NEXT: nop
1596 ; CHECK-P8-NEXT: stvx v2, 0, r30
1597 ; CHECK-P8-NEXT: addi r1, r1, 48
1598 ; CHECK-P8-NEXT: ld r0, 16(r1)
1599 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1600 ; CHECK-P8-NEXT: mtlr r0
1601 ; CHECK-P8-NEXT: blr
1603 %conv = fpext double %a to fp128
1604 store fp128 %conv, fp128* %res, align 16
1608 ; Function Attrs: norecurse nounwind readnone
1609 define fp128 @spConv2qp(float %a) {
1610 ; CHECK-LABEL: spConv2qp:
1611 ; CHECK: # %bb.0: # %entry
1612 ; CHECK-NEXT: xscpsgndp v2, f1, f1
1613 ; CHECK-NEXT: xscvdpqp v2, v2
1616 ; CHECK-P8-LABEL: spConv2qp:
1617 ; CHECK-P8: # %bb.0: # %entry
1618 ; CHECK-P8-NEXT: mflr r0
1619 ; CHECK-P8-NEXT: std r0, 16(r1)
1620 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1621 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1622 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1623 ; CHECK-P8-NEXT: bl __extendsfkf2
1624 ; CHECK-P8-NEXT: nop
1625 ; CHECK-P8-NEXT: addi r1, r1, 32
1626 ; CHECK-P8-NEXT: ld r0, 16(r1)
1627 ; CHECK-P8-NEXT: mtlr r0
1628 ; CHECK-P8-NEXT: blr
1630 %conv = fpext float %a to fp128
1634 ; Function Attrs: norecurse nounwind
1635 define void @spConv2qp_02(float* nocapture readonly %a) {
1636 ; CHECK-LABEL: spConv2qp_02:
1637 ; CHECK: # %bb.0: # %entry
1638 ; CHECK-NEXT: lxssp v2, 0(r3)
1639 ; CHECK-NEXT: addis r3, r2, .LC8@toc@ha
1640 ; CHECK-NEXT: ld r3, .LC8@toc@l(r3)
1641 ; CHECK-NEXT: xscvdpqp v2, v2
1642 ; CHECK-NEXT: stxv v2, 0(r3)
1645 ; CHECK-P8-LABEL: spConv2qp_02:
1646 ; CHECK-P8: # %bb.0: # %entry
1647 ; CHECK-P8-NEXT: mflr r0
1648 ; CHECK-P8-NEXT: std r0, 16(r1)
1649 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1650 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1651 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1652 ; CHECK-P8-NEXT: lfs f1, 0(r3)
1653 ; CHECK-P8-NEXT: bl __extendsfkf2
1654 ; CHECK-P8-NEXT: nop
1655 ; CHECK-P8-NEXT: addis r3, r2, .LC8@toc@ha
1656 ; CHECK-P8-NEXT: ld r3, .LC8@toc@l(r3)
1657 ; CHECK-P8-NEXT: stvx v2, 0, r3
1658 ; CHECK-P8-NEXT: addi r1, r1, 32
1659 ; CHECK-P8-NEXT: ld r0, 16(r1)
1660 ; CHECK-P8-NEXT: mtlr r0
1661 ; CHECK-P8-NEXT: blr
1663 %0 = load float, float* %a, align 4
1664 %conv = fpext float %0 to fp128
1665 store fp128 %conv, fp128* @f128Glob, align 16
1669 ; Function Attrs: norecurse nounwind
1670 define void @spConv2qp_02b(float* nocapture readonly %a, i32 signext %idx) {
1671 ; CHECK-LABEL: spConv2qp_02b:
1672 ; CHECK: # %bb.0: # %entry
1673 ; CHECK-NEXT: sldi r4, r4, 2
1674 ; CHECK-NEXT: lxsspx v2, r3, r4
1675 ; CHECK-NEXT: addis r3, r2, .LC8@toc@ha
1676 ; CHECK-NEXT: ld r3, .LC8@toc@l(r3)
1677 ; CHECK-NEXT: xscvdpqp v2, v2
1678 ; CHECK-NEXT: stxv v2, 0(r3)
1681 ; CHECK-P8-LABEL: spConv2qp_02b:
1682 ; CHECK-P8: # %bb.0: # %entry
1683 ; CHECK-P8-NEXT: mflr r0
1684 ; CHECK-P8-NEXT: std r0, 16(r1)
1685 ; CHECK-P8-NEXT: stdu r1, -32(r1)
1686 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
1687 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1688 ; CHECK-P8-NEXT: sldi r4, r4, 2
1689 ; CHECK-P8-NEXT: lfsx f1, r3, r4
1690 ; CHECK-P8-NEXT: bl __extendsfkf2
1691 ; CHECK-P8-NEXT: nop
1692 ; CHECK-P8-NEXT: addis r3, r2, .LC8@toc@ha
1693 ; CHECK-P8-NEXT: ld r3, .LC8@toc@l(r3)
1694 ; CHECK-P8-NEXT: stvx v2, 0, r3
1695 ; CHECK-P8-NEXT: addi r1, r1, 32
1696 ; CHECK-P8-NEXT: ld r0, 16(r1)
1697 ; CHECK-P8-NEXT: mtlr r0
1698 ; CHECK-P8-NEXT: blr
1700 %idxprom = sext i32 %idx to i64
1701 %arrayidx = getelementptr inbounds float, float* %a, i64 %idxprom
1702 %0 = load float, float* %arrayidx, align 4
1703 %conv = fpext float %0 to fp128
1704 store fp128 %conv, fp128* @f128Glob, align 16
1708 ; Function Attrs: norecurse nounwind
1709 define void @spConv2qp_03(fp128* nocapture %res, i32 signext %idx, float %a) {
1710 ; CHECK-LABEL: spConv2qp_03:
1711 ; CHECK: # %bb.0: # %entry
1712 ; CHECK-NEXT: xscpsgndp v2, f1, f1
1713 ; CHECK-NEXT: sldi r4, r4, 4
1714 ; CHECK-NEXT: xscvdpqp v2, v2
1715 ; CHECK-NEXT: stxvx v2, r3, r4
1718 ; CHECK-P8-LABEL: spConv2qp_03:
1719 ; CHECK-P8: # %bb.0: # %entry
1720 ; CHECK-P8-NEXT: mflr r0
1721 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 64
1722 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1723 ; CHECK-P8-NEXT: .cfi_offset r29, -24
1724 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1725 ; CHECK-P8-NEXT: std r29, -24(r1) # 8-byte Folded Spill
1726 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1727 ; CHECK-P8-NEXT: std r0, 16(r1)
1728 ; CHECK-P8-NEXT: stdu r1, -64(r1)
1729 ; CHECK-P8-NEXT: mr r30, r4
1730 ; CHECK-P8-NEXT: mr r29, r3
1731 ; CHECK-P8-NEXT: bl __extendsfkf2
1732 ; CHECK-P8-NEXT: nop
1733 ; CHECK-P8-NEXT: sldi r3, r30, 4
1734 ; CHECK-P8-NEXT: stvx v2, r29, r3
1735 ; CHECK-P8-NEXT: addi r1, r1, 64
1736 ; CHECK-P8-NEXT: ld r0, 16(r1)
1737 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1738 ; CHECK-P8-NEXT: ld r29, -24(r1) # 8-byte Folded Reload
1739 ; CHECK-P8-NEXT: mtlr r0
1740 ; CHECK-P8-NEXT: blr
1742 %conv = fpext float %a to fp128
1743 %idxprom = sext i32 %idx to i64
1744 %arrayidx = getelementptr inbounds fp128, fp128* %res, i64 %idxprom
1745 store fp128 %conv, fp128* %arrayidx, align 16
1749 ; Function Attrs: norecurse nounwind
1750 define void @spConv2qp_04(float %a, fp128* nocapture %res) {
1751 ; CHECK-LABEL: spConv2qp_04:
1752 ; CHECK: # %bb.0: # %entry
1753 ; CHECK-NEXT: xscpsgndp v2, f1, f1
1754 ; CHECK-NEXT: xscvdpqp v2, v2
1755 ; CHECK-NEXT: stxv v2, 0(r4)
1758 ; CHECK-P8-LABEL: spConv2qp_04:
1759 ; CHECK-P8: # %bb.0: # %entry
1760 ; CHECK-P8-NEXT: mflr r0
1761 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1762 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1763 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1764 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1765 ; CHECK-P8-NEXT: std r0, 16(r1)
1766 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1767 ; CHECK-P8-NEXT: mr r30, r4
1768 ; CHECK-P8-NEXT: bl __extendsfkf2
1769 ; CHECK-P8-NEXT: nop
1770 ; CHECK-P8-NEXT: stvx v2, 0, r30
1771 ; CHECK-P8-NEXT: addi r1, r1, 48
1772 ; CHECK-P8-NEXT: ld r0, 16(r1)
1773 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1774 ; CHECK-P8-NEXT: mtlr r0
1775 ; CHECK-P8-NEXT: blr
1777 %conv = fpext float %a to fp128
1778 store fp128 %conv, fp128* %res, align 16
1783 ; Function Attrs: norecurse nounwind
1784 define void @cvdp2sw2qp(double %val, fp128* nocapture %res) {
1785 ; CHECK-LABEL: cvdp2sw2qp:
1786 ; CHECK: # %bb.0: # %entry
1787 ; CHECK-NEXT: xscvdpsxws v2, f1
1788 ; CHECK-NEXT: vextsw2d v2, v2
1789 ; CHECK-NEXT: xscvsdqp v2, v2
1790 ; CHECK-NEXT: stxv v2, 0(r4)
1793 ; CHECK-P8-LABEL: cvdp2sw2qp:
1794 ; CHECK-P8: # %bb.0: # %entry
1795 ; CHECK-P8-NEXT: mflr r0
1796 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1797 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1798 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1799 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1800 ; CHECK-P8-NEXT: std r0, 16(r1)
1801 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1802 ; CHECK-P8-NEXT: xscvdpsxws f0, f1
1803 ; CHECK-P8-NEXT: mr r30, r4
1804 ; CHECK-P8-NEXT: mffprwz r3, f0
1805 ; CHECK-P8-NEXT: extsw r3, r3
1806 ; CHECK-P8-NEXT: bl __floatsikf
1807 ; CHECK-P8-NEXT: nop
1808 ; CHECK-P8-NEXT: stvx v2, 0, r30
1809 ; CHECK-P8-NEXT: addi r1, r1, 48
1810 ; CHECK-P8-NEXT: ld r0, 16(r1)
1811 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1812 ; CHECK-P8-NEXT: mtlr r0
1813 ; CHECK-P8-NEXT: blr
1815 %conv = fptosi double %val to i32
1816 %conv1 = sitofp i32 %conv to fp128
1817 store fp128 %conv1, fp128* %res, align 16
1821 ; Function Attrs: norecurse nounwind
1822 define void @cvdp2sdw2qp(double %val, fp128* nocapture %res) {
1823 ; CHECK-LABEL: cvdp2sdw2qp:
1824 ; CHECK: # %bb.0: # %entry
1825 ; CHECK-NEXT: xscvdpsxds v2, f1
1826 ; CHECK-NEXT: xscvsdqp v2, v2
1827 ; CHECK-NEXT: stxv v2, 0(r4)
1830 ; CHECK-P8-LABEL: cvdp2sdw2qp:
1831 ; CHECK-P8: # %bb.0: # %entry
1832 ; CHECK-P8-NEXT: mflr r0
1833 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1834 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1835 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1836 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1837 ; CHECK-P8-NEXT: std r0, 16(r1)
1838 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1839 ; CHECK-P8-NEXT: xscvdpsxds f0, f1
1840 ; CHECK-P8-NEXT: mr r30, r4
1841 ; CHECK-P8-NEXT: mffprd r3, f0
1842 ; CHECK-P8-NEXT: bl __floatdikf
1843 ; CHECK-P8-NEXT: nop
1844 ; CHECK-P8-NEXT: stvx v2, 0, r30
1845 ; CHECK-P8-NEXT: addi r1, r1, 48
1846 ; CHECK-P8-NEXT: ld r0, 16(r1)
1847 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1848 ; CHECK-P8-NEXT: mtlr r0
1849 ; CHECK-P8-NEXT: blr
1851 %conv = fptosi double %val to i64
1852 %conv1 = sitofp i64 %conv to fp128
1853 store fp128 %conv1, fp128* %res, align 16
1857 ; Function Attrs: norecurse nounwind
1858 define void @cvsp2sw2qp(float %val, fp128* nocapture %res) {
1859 ; CHECK-LABEL: cvsp2sw2qp:
1860 ; CHECK: # %bb.0: # %entry
1861 ; CHECK-NEXT: xscvdpsxws v2, f1
1862 ; CHECK-NEXT: vextsw2d v2, v2
1863 ; CHECK-NEXT: xscvsdqp v2, v2
1864 ; CHECK-NEXT: stxv v2, 0(r4)
1867 ; CHECK-P8-LABEL: cvsp2sw2qp:
1868 ; CHECK-P8: # %bb.0: # %entry
1869 ; CHECK-P8-NEXT: mflr r0
1870 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1871 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1872 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1873 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1874 ; CHECK-P8-NEXT: std r0, 16(r1)
1875 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1876 ; CHECK-P8-NEXT: xscvdpsxws f0, f1
1877 ; CHECK-P8-NEXT: mr r30, r4
1878 ; CHECK-P8-NEXT: mffprwz r3, f0
1879 ; CHECK-P8-NEXT: extsw r3, r3
1880 ; CHECK-P8-NEXT: bl __floatsikf
1881 ; CHECK-P8-NEXT: nop
1882 ; CHECK-P8-NEXT: stvx v2, 0, r30
1883 ; CHECK-P8-NEXT: addi r1, r1, 48
1884 ; CHECK-P8-NEXT: ld r0, 16(r1)
1885 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1886 ; CHECK-P8-NEXT: mtlr r0
1887 ; CHECK-P8-NEXT: blr
1889 %conv = fptosi float %val to i32
1890 %conv1 = sitofp i32 %conv to fp128
1891 store fp128 %conv1, fp128* %res, align 16
1895 ; Function Attrs: norecurse nounwind
1896 define void @cvsp2sdw2qp(float %val, fp128* nocapture %res) {
1897 ; CHECK-LABEL: cvsp2sdw2qp:
1898 ; CHECK: # %bb.0: # %entry
1899 ; CHECK-NEXT: xscvdpsxds v2, f1
1900 ; CHECK-NEXT: xscvsdqp v2, v2
1901 ; CHECK-NEXT: stxv v2, 0(r4)
1904 ; CHECK-P8-LABEL: cvsp2sdw2qp:
1905 ; CHECK-P8: # %bb.0: # %entry
1906 ; CHECK-P8-NEXT: mflr r0
1907 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1908 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1909 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1910 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1911 ; CHECK-P8-NEXT: std r0, 16(r1)
1912 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1913 ; CHECK-P8-NEXT: xscvdpsxds f0, f1
1914 ; CHECK-P8-NEXT: mr r30, r4
1915 ; CHECK-P8-NEXT: mffprd r3, f0
1916 ; CHECK-P8-NEXT: bl __floatdikf
1917 ; CHECK-P8-NEXT: nop
1918 ; CHECK-P8-NEXT: stvx v2, 0, r30
1919 ; CHECK-P8-NEXT: addi r1, r1, 48
1920 ; CHECK-P8-NEXT: ld r0, 16(r1)
1921 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1922 ; CHECK-P8-NEXT: mtlr r0
1923 ; CHECK-P8-NEXT: blr
1925 %conv = fptosi float %val to i64
1926 %conv1 = sitofp i64 %conv to fp128
1927 store fp128 %conv1, fp128* %res, align 16
1931 ; Function Attrs: norecurse nounwind
1932 define void @cvdp2uw2qp(double %val, fp128* nocapture %res) {
1933 ; CHECK-LABEL: cvdp2uw2qp:
1934 ; CHECK: # %bb.0: # %entry
1935 ; CHECK-NEXT: xscvdpuxws f0, f1
1936 ; CHECK-NEXT: xxextractuw v2, vs0, 8
1937 ; CHECK-NEXT: xscvudqp v2, v2
1938 ; CHECK-NEXT: stxv v2, 0(r4)
1941 ; CHECK-P8-LABEL: cvdp2uw2qp:
1942 ; CHECK-P8: # %bb.0: # %entry
1943 ; CHECK-P8-NEXT: mflr r0
1944 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1945 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1946 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1947 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1948 ; CHECK-P8-NEXT: std r0, 16(r1)
1949 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1950 ; CHECK-P8-NEXT: xscvdpuxws f0, f1
1951 ; CHECK-P8-NEXT: mr r30, r4
1952 ; CHECK-P8-NEXT: mffprwz r3, f0
1953 ; CHECK-P8-NEXT: clrldi r3, r3, 32
1954 ; CHECK-P8-NEXT: bl __floatunsikf
1955 ; CHECK-P8-NEXT: nop
1956 ; CHECK-P8-NEXT: stvx v2, 0, r30
1957 ; CHECK-P8-NEXT: addi r1, r1, 48
1958 ; CHECK-P8-NEXT: ld r0, 16(r1)
1959 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1960 ; CHECK-P8-NEXT: mtlr r0
1961 ; CHECK-P8-NEXT: blr
1963 %conv = fptoui double %val to i32
1964 %conv1 = uitofp i32 %conv to fp128
1965 store fp128 %conv1, fp128* %res, align 16
1969 ; Function Attrs: norecurse nounwind
1970 define void @cvdp2udw2qp(double %val, fp128* nocapture %res) {
1971 ; CHECK-LABEL: cvdp2udw2qp:
1972 ; CHECK: # %bb.0: # %entry
1973 ; CHECK-NEXT: xscvdpuxds v2, f1
1974 ; CHECK-NEXT: xscvudqp v2, v2
1975 ; CHECK-NEXT: stxv v2, 0(r4)
1978 ; CHECK-P8-LABEL: cvdp2udw2qp:
1979 ; CHECK-P8: # %bb.0: # %entry
1980 ; CHECK-P8-NEXT: mflr r0
1981 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
1982 ; CHECK-P8-NEXT: .cfi_offset lr, 16
1983 ; CHECK-P8-NEXT: .cfi_offset r30, -16
1984 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
1985 ; CHECK-P8-NEXT: std r0, 16(r1)
1986 ; CHECK-P8-NEXT: stdu r1, -48(r1)
1987 ; CHECK-P8-NEXT: xscvdpuxds f0, f1
1988 ; CHECK-P8-NEXT: mr r30, r4
1989 ; CHECK-P8-NEXT: mffprd r3, f0
1990 ; CHECK-P8-NEXT: bl __floatundikf
1991 ; CHECK-P8-NEXT: nop
1992 ; CHECK-P8-NEXT: stvx v2, 0, r30
1993 ; CHECK-P8-NEXT: addi r1, r1, 48
1994 ; CHECK-P8-NEXT: ld r0, 16(r1)
1995 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
1996 ; CHECK-P8-NEXT: mtlr r0
1997 ; CHECK-P8-NEXT: blr
1999 %conv = fptoui double %val to i64
2000 %conv1 = uitofp i64 %conv to fp128
2001 store fp128 %conv1, fp128* %res, align 16
2005 ; Function Attrs: norecurse nounwind
2006 define void @cvsp2uw2qp(float %val, fp128* nocapture %res) {
2007 ; CHECK-LABEL: cvsp2uw2qp:
2008 ; CHECK: # %bb.0: # %entry
2009 ; CHECK-NEXT: xscvdpuxws f0, f1
2010 ; CHECK-NEXT: xxextractuw v2, vs0, 8
2011 ; CHECK-NEXT: xscvudqp v2, v2
2012 ; CHECK-NEXT: stxv v2, 0(r4)
2015 ; CHECK-P8-LABEL: cvsp2uw2qp:
2016 ; CHECK-P8: # %bb.0: # %entry
2017 ; CHECK-P8-NEXT: mflr r0
2018 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
2019 ; CHECK-P8-NEXT: .cfi_offset lr, 16
2020 ; CHECK-P8-NEXT: .cfi_offset r30, -16
2021 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
2022 ; CHECK-P8-NEXT: std r0, 16(r1)
2023 ; CHECK-P8-NEXT: stdu r1, -48(r1)
2024 ; CHECK-P8-NEXT: xscvdpuxws f0, f1
2025 ; CHECK-P8-NEXT: mr r30, r4
2026 ; CHECK-P8-NEXT: mffprwz r3, f0
2027 ; CHECK-P8-NEXT: clrldi r3, r3, 32
2028 ; CHECK-P8-NEXT: bl __floatunsikf
2029 ; CHECK-P8-NEXT: nop
2030 ; CHECK-P8-NEXT: stvx v2, 0, r30
2031 ; CHECK-P8-NEXT: addi r1, r1, 48
2032 ; CHECK-P8-NEXT: ld r0, 16(r1)
2033 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
2034 ; CHECK-P8-NEXT: mtlr r0
2035 ; CHECK-P8-NEXT: blr
2037 %conv = fptoui float %val to i32
2038 %conv1 = uitofp i32 %conv to fp128
2039 store fp128 %conv1, fp128* %res, align 16
2043 ; Function Attrs: norecurse nounwind
2044 define void @cvsp2udw2qp(float %val, fp128* nocapture %res) {
2045 ; CHECK-LABEL: cvsp2udw2qp:
2046 ; CHECK: # %bb.0: # %entry
2047 ; CHECK-NEXT: xscvdpuxds v2, f1
2048 ; CHECK-NEXT: xscvudqp v2, v2
2049 ; CHECK-NEXT: stxv v2, 0(r4)
2052 ; CHECK-P8-LABEL: cvsp2udw2qp:
2053 ; CHECK-P8: # %bb.0: # %entry
2054 ; CHECK-P8-NEXT: mflr r0
2055 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 48
2056 ; CHECK-P8-NEXT: .cfi_offset lr, 16
2057 ; CHECK-P8-NEXT: .cfi_offset r30, -16
2058 ; CHECK-P8-NEXT: std r30, -16(r1) # 8-byte Folded Spill
2059 ; CHECK-P8-NEXT: std r0, 16(r1)
2060 ; CHECK-P8-NEXT: stdu r1, -48(r1)
2061 ; CHECK-P8-NEXT: xscvdpuxds f0, f1
2062 ; CHECK-P8-NEXT: mr r30, r4
2063 ; CHECK-P8-NEXT: mffprd r3, f0
2064 ; CHECK-P8-NEXT: bl __floatundikf
2065 ; CHECK-P8-NEXT: nop
2066 ; CHECK-P8-NEXT: stvx v2, 0, r30
2067 ; CHECK-P8-NEXT: addi r1, r1, 48
2068 ; CHECK-P8-NEXT: ld r0, 16(r1)
2069 ; CHECK-P8-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
2070 ; CHECK-P8-NEXT: mtlr r0
2071 ; CHECK-P8-NEXT: blr
2073 %conv = fptoui float %val to i64
2074 %conv1 = uitofp i64 %conv to fp128
2075 store fp128 %conv1, fp128* %res, align 16
2079 ; Function Attrs: norecurse nounwind readonly
2080 define i128 @qpConv2i128(fp128* nocapture readonly %a) {
2081 ; CHECK-LABEL: qpConv2i128:
2082 ; CHECK: # %bb.0: # %entry
2083 ; CHECK-NEXT: mflr r0
2084 ; CHECK-NEXT: std r0, 16(r1)
2085 ; CHECK-NEXT: stdu r1, -32(r1)
2086 ; CHECK-NEXT: .cfi_def_cfa_offset 32
2087 ; CHECK-NEXT: .cfi_offset lr, 16
2088 ; CHECK-NEXT: lxv v2, 0(r3)
2089 ; CHECK-NEXT: bl __fixkfti
2091 ; CHECK-NEXT: addi r1, r1, 32
2092 ; CHECK-NEXT: ld r0, 16(r1)
2093 ; CHECK-NEXT: mtlr r0
2096 ; CHECK-P8-LABEL: qpConv2i128:
2097 ; CHECK-P8: # %bb.0: # %entry
2098 ; CHECK-P8-NEXT: mflr r0
2099 ; CHECK-P8-NEXT: std r0, 16(r1)
2100 ; CHECK-P8-NEXT: stdu r1, -32(r1)
2101 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
2102 ; CHECK-P8-NEXT: .cfi_offset lr, 16
2103 ; CHECK-P8-NEXT: lvx v2, 0, r3
2104 ; CHECK-P8-NEXT: bl __fixkfti
2105 ; CHECK-P8-NEXT: nop
2106 ; CHECK-P8-NEXT: addi r1, r1, 32
2107 ; CHECK-P8-NEXT: ld r0, 16(r1)
2108 ; CHECK-P8-NEXT: mtlr r0
2109 ; CHECK-P8-NEXT: blr
2111 %0 = load fp128, fp128* %a, align 16
2112 %conv = fptosi fp128 %0 to i128
2116 ; Function Attrs: norecurse nounwind readonly
2117 define i128 @qpConv2ui128(fp128* nocapture readonly %a) {
2118 ; CHECK-LABEL: qpConv2ui128:
2119 ; CHECK: # %bb.0: # %entry
2120 ; CHECK-NEXT: mflr r0
2121 ; CHECK-NEXT: std r0, 16(r1)
2122 ; CHECK-NEXT: stdu r1, -32(r1)
2123 ; CHECK-NEXT: .cfi_def_cfa_offset 32
2124 ; CHECK-NEXT: .cfi_offset lr, 16
2125 ; CHECK-NEXT: lxv v2, 0(r3)
2126 ; CHECK-NEXT: bl __fixunskfti
2128 ; CHECK-NEXT: addi r1, r1, 32
2129 ; CHECK-NEXT: ld r0, 16(r1)
2130 ; CHECK-NEXT: mtlr r0
2133 ; CHECK-P8-LABEL: qpConv2ui128:
2134 ; CHECK-P8: # %bb.0: # %entry
2135 ; CHECK-P8-NEXT: mflr r0
2136 ; CHECK-P8-NEXT: std r0, 16(r1)
2137 ; CHECK-P8-NEXT: stdu r1, -32(r1)
2138 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
2139 ; CHECK-P8-NEXT: .cfi_offset lr, 16
2140 ; CHECK-P8-NEXT: lvx v2, 0, r3
2141 ; CHECK-P8-NEXT: bl __fixunskfti
2142 ; CHECK-P8-NEXT: nop
2143 ; CHECK-P8-NEXT: addi r1, r1, 32
2144 ; CHECK-P8-NEXT: ld r0, 16(r1)
2145 ; CHECK-P8-NEXT: mtlr r0
2146 ; CHECK-P8-NEXT: blr
2148 %0 = load fp128, fp128* %a, align 16
2149 %conv = fptoui fp128 %0 to i128
2153 ; Function Attrs: norecurse nounwind readonly
2154 define i1 @qpConv2ui1(fp128* nocapture readonly %a) {
2155 ; CHECK-LABEL: qpConv2ui1:
2156 ; CHECK: # %bb.0: # %entry
2157 ; CHECK-NEXT: lxv v2, 0(r3)
2158 ; CHECK-NEXT: xscvqpswz v2, v2
2159 ; CHECK-NEXT: mfvsrwz r3, v2
2162 ; CHECK-P8-LABEL: qpConv2ui1:
2163 ; CHECK-P8: # %bb.0: # %entry
2164 ; CHECK-P8-NEXT: mflr r0
2165 ; CHECK-P8-NEXT: std r0, 16(r1)
2166 ; CHECK-P8-NEXT: stdu r1, -32(r1)
2167 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
2168 ; CHECK-P8-NEXT: .cfi_offset lr, 16
2169 ; CHECK-P8-NEXT: lvx v2, 0, r3
2170 ; CHECK-P8-NEXT: bl __fixkfsi
2171 ; CHECK-P8-NEXT: nop
2172 ; CHECK-P8-NEXT: addi r1, r1, 32
2173 ; CHECK-P8-NEXT: ld r0, 16(r1)
2174 ; CHECK-P8-NEXT: mtlr r0
2175 ; CHECK-P8-NEXT: blr
2177 %0 = load fp128, fp128* %a, align 16
2178 %conv = fptoui fp128 %0 to i1
2182 ; Function Attrs: norecurse nounwind readonly
2183 define i1 @qpConv2si1(fp128* nocapture readonly %a) {
2184 ; CHECK-LABEL: qpConv2si1:
2185 ; CHECK: # %bb.0: # %entry
2186 ; CHECK-NEXT: lxv v2, 0(r3)
2187 ; CHECK-NEXT: xscvqpswz v2, v2
2188 ; CHECK-NEXT: mfvsrwz r3, v2
2191 ; CHECK-P8-LABEL: qpConv2si1:
2192 ; CHECK-P8: # %bb.0: # %entry
2193 ; CHECK-P8-NEXT: mflr r0
2194 ; CHECK-P8-NEXT: std r0, 16(r1)
2195 ; CHECK-P8-NEXT: stdu r1, -32(r1)
2196 ; CHECK-P8-NEXT: .cfi_def_cfa_offset 32
2197 ; CHECK-P8-NEXT: .cfi_offset lr, 16
2198 ; CHECK-P8-NEXT: lvx v2, 0, r3
2199 ; CHECK-P8-NEXT: bl __fixkfsi
2200 ; CHECK-P8-NEXT: nop
2201 ; CHECK-P8-NEXT: addi r1, r1, 32
2202 ; CHECK-P8-NEXT: ld r0, 16(r1)
2203 ; CHECK-P8-NEXT: mtlr r0
2204 ; CHECK-P8-NEXT: blr
2206 %0 = load fp128, fp128* %a, align 16
2207 %conv = fptosi fp128 %0 to i1