1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
3 ; RUN: < %s -mtriple=powerpc64-unknown-linux -mcpu=pwr8 | FileCheck %s\
4 ; RUN: -check-prefix=P8
5 ; RUN: llc -verify-machineinstrs -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
6 ; RUN: < %s -mtriple=powerpc64le-unknown-linux -mcpu=pwr9 | FileCheck %s \
7 ; RUN: -check-prefix=P9
8 ; RUN: llc -verify-machineinstrs -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
9 ; RUN: < %s -mtriple=powerpc64le-unknown-linux -mcpu=pwr8 -mattr=-vsx \
10 ; RUN: | FileCheck %s -check-prefix=NOVSX
12 declare i1 @llvm.experimental.constrained.fptosi.i1.f128(fp128, metadata)
13 declare i32 @llvm.experimental.constrained.fptosi.i32.f128(fp128, metadata)
14 declare i64 @llvm.experimental.constrained.fptosi.i64.f128(fp128, metadata)
15 declare i64 @llvm.experimental.constrained.fptoui.i64.f128(fp128, metadata)
16 declare i32 @llvm.experimental.constrained.fptoui.i32.f128(fp128, metadata)
17 declare i1 @llvm.experimental.constrained.fptoui.i1.f128(fp128, metadata)
19 declare i1 @llvm.experimental.constrained.fptosi.i1.ppcf128(ppc_fp128, metadata)
20 declare i32 @llvm.experimental.constrained.fptosi.i32.ppcf128(ppc_fp128, metadata)
21 declare i64 @llvm.experimental.constrained.fptosi.i64.ppcf128(ppc_fp128, metadata)
22 declare i64 @llvm.experimental.constrained.fptoui.i64.ppcf128(ppc_fp128, metadata)
23 declare i32 @llvm.experimental.constrained.fptoui.i32.ppcf128(ppc_fp128, metadata)
24 declare i1 @llvm.experimental.constrained.fptoui.i1.ppcf128(ppc_fp128, metadata)
26 declare i128 @llvm.experimental.constrained.fptosi.i128.ppcf128(ppc_fp128, metadata)
27 declare i128 @llvm.experimental.constrained.fptoui.i128.ppcf128(ppc_fp128, metadata)
28 declare i128 @llvm.experimental.constrained.fptosi.i128.f128(fp128, metadata)
29 declare i128 @llvm.experimental.constrained.fptoui.i128.f128(fp128, metadata)
31 declare fp128 @llvm.experimental.constrained.sitofp.f128.i1(i1, metadata, metadata)
32 declare fp128 @llvm.experimental.constrained.sitofp.f128.i32(i32, metadata, metadata)
33 declare fp128 @llvm.experimental.constrained.sitofp.f128.i64(i64, metadata, metadata)
34 declare fp128 @llvm.experimental.constrained.uitofp.f128.i1(i1, metadata, metadata)
35 declare fp128 @llvm.experimental.constrained.uitofp.f128.i32(i32, metadata, metadata)
36 declare fp128 @llvm.experimental.constrained.uitofp.f128.i64(i64, metadata, metadata)
38 declare ppc_fp128 @llvm.experimental.constrained.sitofp.ppcf128.i1(i1, metadata, metadata)
39 declare ppc_fp128 @llvm.experimental.constrained.sitofp.ppcf128.i32(i32, metadata, metadata)
40 declare ppc_fp128 @llvm.experimental.constrained.sitofp.ppcf128.i64(i64, metadata, metadata)
41 declare ppc_fp128 @llvm.experimental.constrained.uitofp.ppcf128.i1(i1, metadata, metadata)
42 declare ppc_fp128 @llvm.experimental.constrained.uitofp.ppcf128.i32(i32, metadata, metadata)
43 declare ppc_fp128 @llvm.experimental.constrained.uitofp.ppcf128.i64(i64, metadata, metadata)
45 define i128 @q_to_i128(fp128 %m) #0 {
46 ; P8-LABEL: q_to_i128:
47 ; P8: # %bb.0: # %entry
49 ; P8-NEXT: stdu r1, -112(r1)
50 ; P8-NEXT: std r0, 128(r1)
51 ; P8-NEXT: .cfi_def_cfa_offset 112
52 ; P8-NEXT: .cfi_offset lr, 16
53 ; P8-NEXT: bl __fixkfti
55 ; P8-NEXT: addi r1, r1, 112
56 ; P8-NEXT: ld r0, 16(r1)
60 ; P9-LABEL: q_to_i128:
61 ; P9: # %bb.0: # %entry
63 ; P9-NEXT: stdu r1, -32(r1)
64 ; P9-NEXT: std r0, 48(r1)
65 ; P9-NEXT: .cfi_def_cfa_offset 32
66 ; P9-NEXT: .cfi_offset lr, 16
67 ; P9-NEXT: bl __fixkfti
69 ; P9-NEXT: addi r1, r1, 32
70 ; P9-NEXT: ld r0, 16(r1)
74 ; NOVSX-LABEL: q_to_i128:
75 ; NOVSX: # %bb.0: # %entry
77 ; NOVSX-NEXT: stdu r1, -32(r1)
78 ; NOVSX-NEXT: std r0, 48(r1)
79 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
80 ; NOVSX-NEXT: .cfi_offset lr, 16
81 ; NOVSX-NEXT: bl __fixkfti
83 ; NOVSX-NEXT: addi r1, r1, 32
84 ; NOVSX-NEXT: ld r0, 16(r1)
88 %conv = tail call i128 @llvm.experimental.constrained.fptosi.i128.f128(fp128 %m, metadata !"fpexcept.strict") #0
92 define i128 @q_to_u128(fp128 %m) #0 {
93 ; P8-LABEL: q_to_u128:
94 ; P8: # %bb.0: # %entry
96 ; P8-NEXT: stdu r1, -112(r1)
97 ; P8-NEXT: std r0, 128(r1)
98 ; P8-NEXT: .cfi_def_cfa_offset 112
99 ; P8-NEXT: .cfi_offset lr, 16
100 ; P8-NEXT: bl __fixunskfti
102 ; P8-NEXT: addi r1, r1, 112
103 ; P8-NEXT: ld r0, 16(r1)
107 ; P9-LABEL: q_to_u128:
108 ; P9: # %bb.0: # %entry
110 ; P9-NEXT: stdu r1, -32(r1)
111 ; P9-NEXT: std r0, 48(r1)
112 ; P9-NEXT: .cfi_def_cfa_offset 32
113 ; P9-NEXT: .cfi_offset lr, 16
114 ; P9-NEXT: bl __fixunskfti
116 ; P9-NEXT: addi r1, r1, 32
117 ; P9-NEXT: ld r0, 16(r1)
121 ; NOVSX-LABEL: q_to_u128:
122 ; NOVSX: # %bb.0: # %entry
123 ; NOVSX-NEXT: mflr r0
124 ; NOVSX-NEXT: stdu r1, -32(r1)
125 ; NOVSX-NEXT: std r0, 48(r1)
126 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
127 ; NOVSX-NEXT: .cfi_offset lr, 16
128 ; NOVSX-NEXT: bl __fixunskfti
130 ; NOVSX-NEXT: addi r1, r1, 32
131 ; NOVSX-NEXT: ld r0, 16(r1)
132 ; NOVSX-NEXT: mtlr r0
135 %conv = tail call i128 @llvm.experimental.constrained.fptoui.i128.f128(fp128 %m, metadata !"fpexcept.strict") #0
139 define i1 @q_to_s1(fp128 %m) #0 {
141 ; P8: # %bb.0: # %entry
143 ; P8-NEXT: stdu r1, -112(r1)
144 ; P8-NEXT: std r0, 128(r1)
145 ; P8-NEXT: .cfi_def_cfa_offset 112
146 ; P8-NEXT: .cfi_offset lr, 16
147 ; P8-NEXT: bl __fixkfsi
149 ; P8-NEXT: addi r1, r1, 112
150 ; P8-NEXT: ld r0, 16(r1)
155 ; P9: # %bb.0: # %entry
156 ; P9-NEXT: xscvqpswz v2, v2
157 ; P9-NEXT: mfvsrwz r3, v2
160 ; NOVSX-LABEL: q_to_s1:
161 ; NOVSX: # %bb.0: # %entry
162 ; NOVSX-NEXT: mflr r0
163 ; NOVSX-NEXT: stdu r1, -32(r1)
164 ; NOVSX-NEXT: std r0, 48(r1)
165 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
166 ; NOVSX-NEXT: .cfi_offset lr, 16
167 ; NOVSX-NEXT: bl __fixkfsi
169 ; NOVSX-NEXT: addi r1, r1, 32
170 ; NOVSX-NEXT: ld r0, 16(r1)
171 ; NOVSX-NEXT: mtlr r0
174 %conv = tail call i1 @llvm.experimental.constrained.fptosi.i1.f128(fp128 %m, metadata !"fpexcept.strict") #0
178 define i1 @q_to_u1(fp128 %m) #0 {
180 ; P8: # %bb.0: # %entry
182 ; P8-NEXT: stdu r1, -112(r1)
183 ; P8-NEXT: std r0, 128(r1)
184 ; P8-NEXT: .cfi_def_cfa_offset 112
185 ; P8-NEXT: .cfi_offset lr, 16
186 ; P8-NEXT: bl __fixkfsi
188 ; P8-NEXT: addi r1, r1, 112
189 ; P8-NEXT: ld r0, 16(r1)
194 ; P9: # %bb.0: # %entry
195 ; P9-NEXT: xscvqpswz v2, v2
196 ; P9-NEXT: mfvsrwz r3, v2
199 ; NOVSX-LABEL: q_to_u1:
200 ; NOVSX: # %bb.0: # %entry
201 ; NOVSX-NEXT: mflr r0
202 ; NOVSX-NEXT: stdu r1, -32(r1)
203 ; NOVSX-NEXT: std r0, 48(r1)
204 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
205 ; NOVSX-NEXT: .cfi_offset lr, 16
206 ; NOVSX-NEXT: bl __fixunskfsi
208 ; NOVSX-NEXT: addi r1, r1, 32
209 ; NOVSX-NEXT: ld r0, 16(r1)
210 ; NOVSX-NEXT: mtlr r0
213 %conv = tail call i1 @llvm.experimental.constrained.fptoui.i1.f128(fp128 %m, metadata !"fpexcept.strict") #0
217 define i128 @ppcq_to_i128(ppc_fp128 %m) #0 {
218 ; P8-LABEL: ppcq_to_i128:
219 ; P8: # %bb.0: # %entry
221 ; P8-NEXT: stdu r1, -112(r1)
222 ; P8-NEXT: std r0, 128(r1)
223 ; P8-NEXT: .cfi_def_cfa_offset 112
224 ; P8-NEXT: .cfi_offset lr, 16
225 ; P8-NEXT: bl __fixtfti
227 ; P8-NEXT: addi r1, r1, 112
228 ; P8-NEXT: ld r0, 16(r1)
232 ; P9-LABEL: ppcq_to_i128:
233 ; P9: # %bb.0: # %entry
235 ; P9-NEXT: stdu r1, -32(r1)
236 ; P9-NEXT: std r0, 48(r1)
237 ; P9-NEXT: .cfi_def_cfa_offset 32
238 ; P9-NEXT: .cfi_offset lr, 16
239 ; P9-NEXT: bl __fixtfti
241 ; P9-NEXT: addi r1, r1, 32
242 ; P9-NEXT: ld r0, 16(r1)
246 ; NOVSX-LABEL: ppcq_to_i128:
247 ; NOVSX: # %bb.0: # %entry
248 ; NOVSX-NEXT: mflr r0
249 ; NOVSX-NEXT: stdu r1, -32(r1)
250 ; NOVSX-NEXT: std r0, 48(r1)
251 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
252 ; NOVSX-NEXT: .cfi_offset lr, 16
253 ; NOVSX-NEXT: bl __fixtfti
255 ; NOVSX-NEXT: addi r1, r1, 32
256 ; NOVSX-NEXT: ld r0, 16(r1)
257 ; NOVSX-NEXT: mtlr r0
260 %conv = tail call i128 @llvm.experimental.constrained.fptosi.i128.ppcf128(ppc_fp128 %m, metadata !"fpexcept.strict") #0
264 define i128 @ppcq_to_u128(ppc_fp128 %m) #0 {
265 ; P8-LABEL: ppcq_to_u128:
266 ; P8: # %bb.0: # %entry
268 ; P8-NEXT: stdu r1, -112(r1)
269 ; P8-NEXT: std r0, 128(r1)
270 ; P8-NEXT: .cfi_def_cfa_offset 112
271 ; P8-NEXT: .cfi_offset lr, 16
272 ; P8-NEXT: bl __fixtfti
274 ; P8-NEXT: addi r1, r1, 112
275 ; P8-NEXT: ld r0, 16(r1)
279 ; P9-LABEL: ppcq_to_u128:
280 ; P9: # %bb.0: # %entry
282 ; P9-NEXT: stdu r1, -32(r1)
283 ; P9-NEXT: std r0, 48(r1)
284 ; P9-NEXT: .cfi_def_cfa_offset 32
285 ; P9-NEXT: .cfi_offset lr, 16
286 ; P9-NEXT: bl __fixtfti
288 ; P9-NEXT: addi r1, r1, 32
289 ; P9-NEXT: ld r0, 16(r1)
293 ; NOVSX-LABEL: ppcq_to_u128:
294 ; NOVSX: # %bb.0: # %entry
295 ; NOVSX-NEXT: mflr r0
296 ; NOVSX-NEXT: stdu r1, -32(r1)
297 ; NOVSX-NEXT: std r0, 48(r1)
298 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
299 ; NOVSX-NEXT: .cfi_offset lr, 16
300 ; NOVSX-NEXT: bl __fixtfti
302 ; NOVSX-NEXT: addi r1, r1, 32
303 ; NOVSX-NEXT: ld r0, 16(r1)
304 ; NOVSX-NEXT: mtlr r0
307 %conv = tail call i128 @llvm.experimental.constrained.fptosi.i128.ppcf128(ppc_fp128 %m, metadata !"fpexcept.strict") #0
311 define signext i32 @q_to_i32(fp128 %m) #0 {
312 ; P8-LABEL: q_to_i32:
313 ; P8: # %bb.0: # %entry
315 ; P8-NEXT: stdu r1, -112(r1)
316 ; P8-NEXT: std r0, 128(r1)
317 ; P8-NEXT: .cfi_def_cfa_offset 112
318 ; P8-NEXT: .cfi_offset lr, 16
319 ; P8-NEXT: bl __fixkfsi
321 ; P8-NEXT: extsw r3, r3
322 ; P8-NEXT: addi r1, r1, 112
323 ; P8-NEXT: ld r0, 16(r1)
327 ; P9-LABEL: q_to_i32:
328 ; P9: # %bb.0: # %entry
329 ; P9-NEXT: xscvqpswz v2, v2
330 ; P9-NEXT: mfvsrwz r3, v2
331 ; P9-NEXT: extsw r3, r3
334 ; NOVSX-LABEL: q_to_i32:
335 ; NOVSX: # %bb.0: # %entry
336 ; NOVSX-NEXT: mflr r0
337 ; NOVSX-NEXT: stdu r1, -32(r1)
338 ; NOVSX-NEXT: std r0, 48(r1)
339 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
340 ; NOVSX-NEXT: .cfi_offset lr, 16
341 ; NOVSX-NEXT: bl __fixkfsi
343 ; NOVSX-NEXT: extsw r3, r3
344 ; NOVSX-NEXT: addi r1, r1, 32
345 ; NOVSX-NEXT: ld r0, 16(r1)
346 ; NOVSX-NEXT: mtlr r0
349 %conv = tail call i32 @llvm.experimental.constrained.fptosi.i32.f128(fp128 %m, metadata !"fpexcept.strict") #0
353 define i64 @q_to_i64(fp128 %m) #0 {
354 ; P8-LABEL: q_to_i64:
355 ; P8: # %bb.0: # %entry
357 ; P8-NEXT: stdu r1, -112(r1)
358 ; P8-NEXT: std r0, 128(r1)
359 ; P8-NEXT: .cfi_def_cfa_offset 112
360 ; P8-NEXT: .cfi_offset lr, 16
361 ; P8-NEXT: bl __fixkfdi
363 ; P8-NEXT: addi r1, r1, 112
364 ; P8-NEXT: ld r0, 16(r1)
368 ; P9-LABEL: q_to_i64:
369 ; P9: # %bb.0: # %entry
370 ; P9-NEXT: xscvqpsdz v2, v2
371 ; P9-NEXT: mfvsrd r3, v2
374 ; NOVSX-LABEL: q_to_i64:
375 ; NOVSX: # %bb.0: # %entry
376 ; NOVSX-NEXT: mflr r0
377 ; NOVSX-NEXT: stdu r1, -32(r1)
378 ; NOVSX-NEXT: std r0, 48(r1)
379 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
380 ; NOVSX-NEXT: .cfi_offset lr, 16
381 ; NOVSX-NEXT: bl __fixkfdi
383 ; NOVSX-NEXT: addi r1, r1, 32
384 ; NOVSX-NEXT: ld r0, 16(r1)
385 ; NOVSX-NEXT: mtlr r0
388 %conv = tail call i64 @llvm.experimental.constrained.fptosi.i64.f128(fp128 %m, metadata !"fpexcept.strict") #0
392 define i64 @q_to_u64(fp128 %m) #0 {
393 ; P8-LABEL: q_to_u64:
394 ; P8: # %bb.0: # %entry
396 ; P8-NEXT: stdu r1, -112(r1)
397 ; P8-NEXT: std r0, 128(r1)
398 ; P8-NEXT: .cfi_def_cfa_offset 112
399 ; P8-NEXT: .cfi_offset lr, 16
400 ; P8-NEXT: bl __fixunskfdi
402 ; P8-NEXT: addi r1, r1, 112
403 ; P8-NEXT: ld r0, 16(r1)
407 ; P9-LABEL: q_to_u64:
408 ; P9: # %bb.0: # %entry
409 ; P9-NEXT: xscvqpudz v2, v2
410 ; P9-NEXT: mfvsrd r3, v2
413 ; NOVSX-LABEL: q_to_u64:
414 ; NOVSX: # %bb.0: # %entry
415 ; NOVSX-NEXT: mflr r0
416 ; NOVSX-NEXT: stdu r1, -32(r1)
417 ; NOVSX-NEXT: std r0, 48(r1)
418 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
419 ; NOVSX-NEXT: .cfi_offset lr, 16
420 ; NOVSX-NEXT: bl __fixunskfdi
422 ; NOVSX-NEXT: addi r1, r1, 32
423 ; NOVSX-NEXT: ld r0, 16(r1)
424 ; NOVSX-NEXT: mtlr r0
427 %conv = tail call i64 @llvm.experimental.constrained.fptoui.i64.f128(fp128 %m, metadata !"fpexcept.strict") #0
431 define zeroext i32 @q_to_u32(fp128 %m) #0 {
432 ; P8-LABEL: q_to_u32:
433 ; P8: # %bb.0: # %entry
435 ; P8-NEXT: stdu r1, -112(r1)
436 ; P8-NEXT: std r0, 128(r1)
437 ; P8-NEXT: .cfi_def_cfa_offset 112
438 ; P8-NEXT: .cfi_offset lr, 16
439 ; P8-NEXT: bl __fixunskfsi
441 ; P8-NEXT: addi r1, r1, 112
442 ; P8-NEXT: ld r0, 16(r1)
446 ; P9-LABEL: q_to_u32:
447 ; P9: # %bb.0: # %entry
448 ; P9-NEXT: xscvqpuwz v2, v2
449 ; P9-NEXT: mfvsrwz r3, v2
452 ; NOVSX-LABEL: q_to_u32:
453 ; NOVSX: # %bb.0: # %entry
454 ; NOVSX-NEXT: mflr r0
455 ; NOVSX-NEXT: stdu r1, -32(r1)
456 ; NOVSX-NEXT: std r0, 48(r1)
457 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
458 ; NOVSX-NEXT: .cfi_offset lr, 16
459 ; NOVSX-NEXT: bl __fixunskfsi
461 ; NOVSX-NEXT: addi r1, r1, 32
462 ; NOVSX-NEXT: ld r0, 16(r1)
463 ; NOVSX-NEXT: mtlr r0
466 %conv = tail call i32 @llvm.experimental.constrained.fptoui.i32.f128(fp128 %m, metadata !"fpexcept.strict") #0
470 define signext i32 @ppcq_to_i32(ppc_fp128 %m) #0 {
471 ; P8-LABEL: ppcq_to_i32:
472 ; P8: # %bb.0: # %entry
476 ; P8-NEXT: fadd f1, f2, f1
477 ; P8-NEXT: mtfsf 1, f0
478 ; P8-NEXT: xscvdpsxws f0, f1
479 ; P8-NEXT: mffprwz r3, f0
480 ; P8-NEXT: extsw r3, r3
483 ; P9-LABEL: ppcq_to_i32:
484 ; P9: # %bb.0: # %entry
488 ; P9-NEXT: fadd f1, f2, f1
489 ; P9-NEXT: mtfsf 1, f0
490 ; P9-NEXT: xscvdpsxws f0, f1
491 ; P9-NEXT: mffprwz r3, f0
492 ; P9-NEXT: extsw r3, r3
495 ; NOVSX-LABEL: ppcq_to_i32:
496 ; NOVSX: # %bb.0: # %entry
497 ; NOVSX-NEXT: mffs f0
498 ; NOVSX-NEXT: mtfsb1 31
499 ; NOVSX-NEXT: mtfsb0 30
500 ; NOVSX-NEXT: addi r3, r1, -4
501 ; NOVSX-NEXT: fadd f1, f2, f1
502 ; NOVSX-NEXT: mtfsf 1, f0
503 ; NOVSX-NEXT: fctiwz f0, f1
504 ; NOVSX-NEXT: stfiwx f0, 0, r3
505 ; NOVSX-NEXT: lwa r3, -4(r1)
508 %conv = tail call i32 @llvm.experimental.constrained.fptosi.i32.ppcf128(ppc_fp128 %m, metadata !"fpexcept.strict") #0
512 define i64 @ppcq_to_i64(ppc_fp128 %m) #0 {
513 ; P8-LABEL: ppcq_to_i64:
514 ; P8: # %bb.0: # %entry
516 ; P8-NEXT: stdu r1, -112(r1)
517 ; P8-NEXT: std r0, 128(r1)
518 ; P8-NEXT: .cfi_def_cfa_offset 112
519 ; P8-NEXT: .cfi_offset lr, 16
520 ; P8-NEXT: bl __fixtfdi
522 ; P8-NEXT: addi r1, r1, 112
523 ; P8-NEXT: ld r0, 16(r1)
527 ; P9-LABEL: ppcq_to_i64:
528 ; P9: # %bb.0: # %entry
530 ; P9-NEXT: stdu r1, -32(r1)
531 ; P9-NEXT: std r0, 48(r1)
532 ; P9-NEXT: .cfi_def_cfa_offset 32
533 ; P9-NEXT: .cfi_offset lr, 16
534 ; P9-NEXT: bl __fixtfdi
536 ; P9-NEXT: addi r1, r1, 32
537 ; P9-NEXT: ld r0, 16(r1)
541 ; NOVSX-LABEL: ppcq_to_i64:
542 ; NOVSX: # %bb.0: # %entry
543 ; NOVSX-NEXT: mflr r0
544 ; NOVSX-NEXT: stdu r1, -32(r1)
545 ; NOVSX-NEXT: std r0, 48(r1)
546 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
547 ; NOVSX-NEXT: .cfi_offset lr, 16
548 ; NOVSX-NEXT: bl __fixtfdi
550 ; NOVSX-NEXT: addi r1, r1, 32
551 ; NOVSX-NEXT: ld r0, 16(r1)
552 ; NOVSX-NEXT: mtlr r0
555 %conv = tail call i64 @llvm.experimental.constrained.fptosi.i64.ppcf128(ppc_fp128 %m, metadata !"fpexcept.strict") #0
559 define i64 @ppcq_to_u64(ppc_fp128 %m) #0 {
560 ; P8-LABEL: ppcq_to_u64:
561 ; P8: # %bb.0: # %entry
563 ; P8-NEXT: stdu r1, -112(r1)
564 ; P8-NEXT: std r0, 128(r1)
565 ; P8-NEXT: .cfi_def_cfa_offset 112
566 ; P8-NEXT: .cfi_offset lr, 16
567 ; P8-NEXT: bl __fixunstfdi
569 ; P8-NEXT: addi r1, r1, 112
570 ; P8-NEXT: ld r0, 16(r1)
574 ; P9-LABEL: ppcq_to_u64:
575 ; P9: # %bb.0: # %entry
577 ; P9-NEXT: stdu r1, -32(r1)
578 ; P9-NEXT: std r0, 48(r1)
579 ; P9-NEXT: .cfi_def_cfa_offset 32
580 ; P9-NEXT: .cfi_offset lr, 16
581 ; P9-NEXT: bl __fixunstfdi
583 ; P9-NEXT: addi r1, r1, 32
584 ; P9-NEXT: ld r0, 16(r1)
588 ; NOVSX-LABEL: ppcq_to_u64:
589 ; NOVSX: # %bb.0: # %entry
590 ; NOVSX-NEXT: mflr r0
591 ; NOVSX-NEXT: stdu r1, -32(r1)
592 ; NOVSX-NEXT: std r0, 48(r1)
593 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
594 ; NOVSX-NEXT: .cfi_offset lr, 16
595 ; NOVSX-NEXT: bl __fixunstfdi
597 ; NOVSX-NEXT: addi r1, r1, 32
598 ; NOVSX-NEXT: ld r0, 16(r1)
599 ; NOVSX-NEXT: mtlr r0
602 %conv = tail call i64 @llvm.experimental.constrained.fptoui.i64.ppcf128(ppc_fp128 %m, metadata !"fpexcept.strict") #0
606 define zeroext i32 @ppcq_to_u32(ppc_fp128 %m) #0 {
607 ; P8-LABEL: ppcq_to_u32:
608 ; P8: # %bb.0: # %entry
610 ; P8-NEXT: stdu r1, -128(r1)
611 ; P8-NEXT: std r0, 144(r1)
612 ; P8-NEXT: .cfi_def_cfa_offset 128
613 ; P8-NEXT: .cfi_offset lr, 16
614 ; P8-NEXT: .cfi_offset r30, -16
615 ; P8-NEXT: addis r3, r2, .LCPI13_0@toc@ha
616 ; P8-NEXT: xxlxor f3, f3, f3
617 ; P8-NEXT: std r30, 112(r1) # 8-byte Folded Spill
618 ; P8-NEXT: lfs f0, .LCPI13_0@toc@l(r3)
619 ; P8-NEXT: fcmpo cr1, f2, f3
620 ; P8-NEXT: lis r3, -32768
621 ; P8-NEXT: fcmpo cr0, f1, f0
622 ; P8-NEXT: crand 4*cr5+lt, eq, 4*cr1+lt
623 ; P8-NEXT: crandc 4*cr5+gt, lt, eq
624 ; P8-NEXT: cror 4*cr5+lt, 4*cr5+gt, 4*cr5+lt
625 ; P8-NEXT: isel r30, 0, r3, 4*cr5+lt
626 ; P8-NEXT: bc 12, 4*cr5+lt, .LBB13_2
627 ; P8-NEXT: # %bb.1: # %entry
628 ; P8-NEXT: fmr f3, f0
629 ; P8-NEXT: .LBB13_2: # %entry
630 ; P8-NEXT: xxlxor f4, f4, f4
631 ; P8-NEXT: bl __gcc_qsub
636 ; P8-NEXT: fadd f1, f2, f1
637 ; P8-NEXT: mtfsf 1, f0
638 ; P8-NEXT: xscvdpsxws f0, f1
639 ; P8-NEXT: mffprwz r3, f0
640 ; P8-NEXT: xor r3, r3, r30
641 ; P8-NEXT: ld r30, 112(r1) # 8-byte Folded Reload
642 ; P8-NEXT: clrldi r3, r3, 32
643 ; P8-NEXT: addi r1, r1, 128
644 ; P8-NEXT: ld r0, 16(r1)
648 ; P9-LABEL: ppcq_to_u32:
649 ; P9: # %bb.0: # %entry
651 ; P9-NEXT: .cfi_def_cfa_offset 48
652 ; P9-NEXT: .cfi_offset lr, 16
653 ; P9-NEXT: .cfi_offset r30, -16
654 ; P9-NEXT: std r30, -16(r1) # 8-byte Folded Spill
655 ; P9-NEXT: stdu r1, -48(r1)
656 ; P9-NEXT: addis r3, r2, .LCPI13_0@toc@ha
657 ; P9-NEXT: xxlxor f3, f3, f3
658 ; P9-NEXT: std r0, 64(r1)
659 ; P9-NEXT: lfs f0, .LCPI13_0@toc@l(r3)
660 ; P9-NEXT: fcmpo cr1, f2, f3
661 ; P9-NEXT: lis r3, -32768
662 ; P9-NEXT: fcmpo cr0, f1, f0
663 ; P9-NEXT: crand 4*cr5+lt, eq, 4*cr1+lt
664 ; P9-NEXT: crandc 4*cr5+gt, lt, eq
665 ; P9-NEXT: cror 4*cr5+lt, 4*cr5+gt, 4*cr5+lt
666 ; P9-NEXT: isel r30, 0, r3, 4*cr5+lt
667 ; P9-NEXT: bc 12, 4*cr5+lt, .LBB13_2
668 ; P9-NEXT: # %bb.1: # %entry
669 ; P9-NEXT: fmr f3, f0
670 ; P9-NEXT: .LBB13_2: # %entry
671 ; P9-NEXT: xxlxor f4, f4, f4
672 ; P9-NEXT: bl __gcc_qsub
677 ; P9-NEXT: fadd f1, f2, f1
678 ; P9-NEXT: mtfsf 1, f0
679 ; P9-NEXT: xscvdpsxws f0, f1
680 ; P9-NEXT: mffprwz r3, f0
681 ; P9-NEXT: xor r3, r3, r30
682 ; P9-NEXT: clrldi r3, r3, 32
683 ; P9-NEXT: addi r1, r1, 48
684 ; P9-NEXT: ld r0, 16(r1)
685 ; P9-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
689 ; NOVSX-LABEL: ppcq_to_u32:
690 ; NOVSX: # %bb.0: # %entry
691 ; NOVSX-NEXT: mfocrf r12, 32
692 ; NOVSX-NEXT: stw r12, 8(r1)
693 ; NOVSX-NEXT: mflr r0
694 ; NOVSX-NEXT: stdu r1, -48(r1)
695 ; NOVSX-NEXT: std r0, 64(r1)
696 ; NOVSX-NEXT: .cfi_def_cfa_offset 48
697 ; NOVSX-NEXT: .cfi_offset lr, 16
698 ; NOVSX-NEXT: .cfi_offset cr2, 8
699 ; NOVSX-NEXT: addis r3, r2, .LCPI13_0@toc@ha
700 ; NOVSX-NEXT: lfs f0, .LCPI13_0@toc@l(r3)
701 ; NOVSX-NEXT: addis r3, r2, .LCPI13_1@toc@ha
702 ; NOVSX-NEXT: lfs f4, .LCPI13_1@toc@l(r3)
703 ; NOVSX-NEXT: fcmpo cr0, f1, f0
704 ; NOVSX-NEXT: fcmpo cr1, f2, f4
705 ; NOVSX-NEXT: fmr f3, f4
706 ; NOVSX-NEXT: crandc 4*cr5+gt, lt, eq
707 ; NOVSX-NEXT: crand 4*cr5+lt, eq, 4*cr1+lt
708 ; NOVSX-NEXT: cror 4*cr2+lt, 4*cr5+gt, 4*cr5+lt
709 ; NOVSX-NEXT: bc 12, 4*cr2+lt, .LBB13_2
710 ; NOVSX-NEXT: # %bb.1: # %entry
711 ; NOVSX-NEXT: fmr f3, f0
712 ; NOVSX-NEXT: .LBB13_2: # %entry
713 ; NOVSX-NEXT: bl __gcc_qsub
715 ; NOVSX-NEXT: mffs f0
716 ; NOVSX-NEXT: mtfsb1 31
717 ; NOVSX-NEXT: mtfsb0 30
718 ; NOVSX-NEXT: addi r3, r1, 44
719 ; NOVSX-NEXT: fadd f1, f2, f1
720 ; NOVSX-NEXT: mtfsf 1, f0
721 ; NOVSX-NEXT: fctiwz f0, f1
722 ; NOVSX-NEXT: stfiwx f0, 0, r3
723 ; NOVSX-NEXT: lis r3, -32768
724 ; NOVSX-NEXT: lwz r4, 44(r1)
725 ; NOVSX-NEXT: isel r3, 0, r3, 4*cr2+lt
726 ; NOVSX-NEXT: xor r3, r4, r3
727 ; NOVSX-NEXT: clrldi r3, r3, 32
728 ; NOVSX-NEXT: addi r1, r1, 48
729 ; NOVSX-NEXT: ld r0, 16(r1)
730 ; NOVSX-NEXT: lwz r12, 8(r1)
731 ; NOVSX-NEXT: mtlr r0
732 ; NOVSX-NEXT: mtocrf 32, r12
735 %conv = tail call i32 @llvm.experimental.constrained.fptoui.i32.ppcf128(ppc_fp128 %m, metadata !"fpexcept.strict") #0
739 define fp128 @i1_to_q(i1 signext %m) #0 {
741 ; P8: # %bb.0: # %entry
743 ; P8-NEXT: stdu r1, -112(r1)
744 ; P8-NEXT: std r0, 128(r1)
745 ; P8-NEXT: .cfi_def_cfa_offset 112
746 ; P8-NEXT: .cfi_offset lr, 16
747 ; P8-NEXT: bl __floatsikf
749 ; P8-NEXT: addi r1, r1, 112
750 ; P8-NEXT: ld r0, 16(r1)
755 ; P9: # %bb.0: # %entry
756 ; P9-NEXT: mtvsrwa v2, r3
757 ; P9-NEXT: xscvsdqp v2, v2
760 ; NOVSX-LABEL: i1_to_q:
761 ; NOVSX: # %bb.0: # %entry
762 ; NOVSX-NEXT: mflr r0
763 ; NOVSX-NEXT: stdu r1, -32(r1)
764 ; NOVSX-NEXT: std r0, 48(r1)
765 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
766 ; NOVSX-NEXT: .cfi_offset lr, 16
767 ; NOVSX-NEXT: bl __floatsikf
769 ; NOVSX-NEXT: addi r1, r1, 32
770 ; NOVSX-NEXT: ld r0, 16(r1)
771 ; NOVSX-NEXT: mtlr r0
774 %conv = tail call fp128 @llvm.experimental.constrained.sitofp.f128.i1(i1 %m, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
778 define fp128 @u1_to_q(i1 zeroext %m) #0 {
780 ; P8: # %bb.0: # %entry
782 ; P8-NEXT: stdu r1, -112(r1)
783 ; P8-NEXT: std r0, 128(r1)
784 ; P8-NEXT: .cfi_def_cfa_offset 112
785 ; P8-NEXT: .cfi_offset lr, 16
786 ; P8-NEXT: bl __floatsikf
788 ; P8-NEXT: addi r1, r1, 112
789 ; P8-NEXT: ld r0, 16(r1)
794 ; P9: # %bb.0: # %entry
795 ; P9-NEXT: mtvsrwa v2, r3
796 ; P9-NEXT: xscvsdqp v2, v2
799 ; NOVSX-LABEL: u1_to_q:
800 ; NOVSX: # %bb.0: # %entry
801 ; NOVSX-NEXT: mflr r0
802 ; NOVSX-NEXT: stdu r1, -32(r1)
803 ; NOVSX-NEXT: std r0, 48(r1)
804 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
805 ; NOVSX-NEXT: .cfi_offset lr, 16
806 ; NOVSX-NEXT: bl __floatunsikf
808 ; NOVSX-NEXT: addi r1, r1, 32
809 ; NOVSX-NEXT: ld r0, 16(r1)
810 ; NOVSX-NEXT: mtlr r0
813 %conv = tail call fp128 @llvm.experimental.constrained.uitofp.f128.i1(i1 %m, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
817 define ppc_fp128 @i1_to_ppcq(i1 signext %m) #0 {
818 ; P8-LABEL: i1_to_ppcq:
819 ; P8: # %bb.0: # %entry
820 ; P8-NEXT: mtfprwa f0, r3
821 ; P8-NEXT: xxlxor f2, f2, f2
822 ; P8-NEXT: xscvsxddp f1, f0
825 ; P9-LABEL: i1_to_ppcq:
826 ; P9: # %bb.0: # %entry
827 ; P9-NEXT: mtfprwa f0, r3
828 ; P9-NEXT: xxlxor f2, f2, f2
829 ; P9-NEXT: xscvsxddp f1, f0
832 ; NOVSX-LABEL: i1_to_ppcq:
833 ; NOVSX: # %bb.0: # %entry
834 ; NOVSX-NEXT: stw r3, -4(r1)
835 ; NOVSX-NEXT: addi r3, r1, -4
836 ; NOVSX-NEXT: lfiwax f0, 0, r3
837 ; NOVSX-NEXT: addis r3, r2, .LCPI16_0@toc@ha
838 ; NOVSX-NEXT: lfs f2, .LCPI16_0@toc@l(r3)
839 ; NOVSX-NEXT: fcfid f1, f0
842 %conv = tail call ppc_fp128 @llvm.experimental.constrained.sitofp.ppcf128.i1(i1 %m, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
846 define ppc_fp128 @u1_to_ppcq(i1 zeroext %m) #0 {
847 ; P8-LABEL: u1_to_ppcq:
848 ; P8: # %bb.0: # %entry
849 ; P8-NEXT: mtfprwa f0, r3
850 ; P8-NEXT: xxlxor f2, f2, f2
851 ; P8-NEXT: xscvsxddp f1, f0
854 ; P9-LABEL: u1_to_ppcq:
855 ; P9: # %bb.0: # %entry
856 ; P9-NEXT: mtfprwa f0, r3
857 ; P9-NEXT: xxlxor f2, f2, f2
858 ; P9-NEXT: xscvsxddp f1, f0
861 ; NOVSX-LABEL: u1_to_ppcq:
862 ; NOVSX: # %bb.0: # %entry
863 ; NOVSX-NEXT: stw r3, -4(r1)
864 ; NOVSX-NEXT: addi r3, r1, -4
865 ; NOVSX-NEXT: lfiwax f0, 0, r3
866 ; NOVSX-NEXT: addis r3, r2, .LCPI17_0@toc@ha
867 ; NOVSX-NEXT: lfs f2, .LCPI17_0@toc@l(r3)
868 ; NOVSX-NEXT: fcfid f1, f0
871 %conv = tail call ppc_fp128 @llvm.experimental.constrained.uitofp.ppcf128.i1(i1 %m, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
875 define fp128 @i32_to_q(i32 signext %m) #0 {
876 ; P8-LABEL: i32_to_q:
877 ; P8: # %bb.0: # %entry
879 ; P8-NEXT: stdu r1, -112(r1)
880 ; P8-NEXT: std r0, 128(r1)
881 ; P8-NEXT: .cfi_def_cfa_offset 112
882 ; P8-NEXT: .cfi_offset lr, 16
883 ; P8-NEXT: bl __floatsikf
885 ; P8-NEXT: addi r1, r1, 112
886 ; P8-NEXT: ld r0, 16(r1)
890 ; P9-LABEL: i32_to_q:
891 ; P9: # %bb.0: # %entry
892 ; P9-NEXT: mtvsrwa v2, r3
893 ; P9-NEXT: xscvsdqp v2, v2
896 ; NOVSX-LABEL: i32_to_q:
897 ; NOVSX: # %bb.0: # %entry
898 ; NOVSX-NEXT: mflr r0
899 ; NOVSX-NEXT: stdu r1, -32(r1)
900 ; NOVSX-NEXT: std r0, 48(r1)
901 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
902 ; NOVSX-NEXT: .cfi_offset lr, 16
903 ; NOVSX-NEXT: bl __floatsikf
905 ; NOVSX-NEXT: addi r1, r1, 32
906 ; NOVSX-NEXT: ld r0, 16(r1)
907 ; NOVSX-NEXT: mtlr r0
910 %conv = tail call fp128 @llvm.experimental.constrained.sitofp.f128.i32(i32 %m, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
914 define fp128 @i64_to_q(i64 %m) #0 {
915 ; P8-LABEL: i64_to_q:
916 ; P8: # %bb.0: # %entry
918 ; P8-NEXT: stdu r1, -112(r1)
919 ; P8-NEXT: std r0, 128(r1)
920 ; P8-NEXT: .cfi_def_cfa_offset 112
921 ; P8-NEXT: .cfi_offset lr, 16
922 ; P8-NEXT: bl __floatdikf
924 ; P8-NEXT: addi r1, r1, 112
925 ; P8-NEXT: ld r0, 16(r1)
929 ; P9-LABEL: i64_to_q:
930 ; P9: # %bb.0: # %entry
931 ; P9-NEXT: mtvsrd v2, r3
932 ; P9-NEXT: xscvsdqp v2, v2
935 ; NOVSX-LABEL: i64_to_q:
936 ; NOVSX: # %bb.0: # %entry
937 ; NOVSX-NEXT: mflr r0
938 ; NOVSX-NEXT: stdu r1, -32(r1)
939 ; NOVSX-NEXT: std r0, 48(r1)
940 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
941 ; NOVSX-NEXT: .cfi_offset lr, 16
942 ; NOVSX-NEXT: bl __floatdikf
944 ; NOVSX-NEXT: addi r1, r1, 32
945 ; NOVSX-NEXT: ld r0, 16(r1)
946 ; NOVSX-NEXT: mtlr r0
949 %conv = tail call fp128 @llvm.experimental.constrained.sitofp.f128.i64(i64 %m, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
953 define fp128 @u32_to_q(i32 zeroext %m) #0 {
954 ; P8-LABEL: u32_to_q:
955 ; P8: # %bb.0: # %entry
957 ; P8-NEXT: stdu r1, -112(r1)
958 ; P8-NEXT: std r0, 128(r1)
959 ; P8-NEXT: .cfi_def_cfa_offset 112
960 ; P8-NEXT: .cfi_offset lr, 16
961 ; P8-NEXT: bl __floatunsikf
963 ; P8-NEXT: addi r1, r1, 112
964 ; P8-NEXT: ld r0, 16(r1)
968 ; P9-LABEL: u32_to_q:
969 ; P9: # %bb.0: # %entry
970 ; P9-NEXT: mtvsrwz v2, r3
971 ; P9-NEXT: xscvudqp v2, v2
974 ; NOVSX-LABEL: u32_to_q:
975 ; NOVSX: # %bb.0: # %entry
976 ; NOVSX-NEXT: mflr r0
977 ; NOVSX-NEXT: stdu r1, -32(r1)
978 ; NOVSX-NEXT: std r0, 48(r1)
979 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
980 ; NOVSX-NEXT: .cfi_offset lr, 16
981 ; NOVSX-NEXT: bl __floatunsikf
983 ; NOVSX-NEXT: addi r1, r1, 32
984 ; NOVSX-NEXT: ld r0, 16(r1)
985 ; NOVSX-NEXT: mtlr r0
988 %conv = tail call fp128 @llvm.experimental.constrained.uitofp.f128.i32(i32 %m, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
992 define fp128 @u64_to_q(i64 %m) #0 {
993 ; P8-LABEL: u64_to_q:
994 ; P8: # %bb.0: # %entry
996 ; P8-NEXT: stdu r1, -112(r1)
997 ; P8-NEXT: std r0, 128(r1)
998 ; P8-NEXT: .cfi_def_cfa_offset 112
999 ; P8-NEXT: .cfi_offset lr, 16
1000 ; P8-NEXT: bl __floatundikf
1002 ; P8-NEXT: addi r1, r1, 112
1003 ; P8-NEXT: ld r0, 16(r1)
1007 ; P9-LABEL: u64_to_q:
1008 ; P9: # %bb.0: # %entry
1009 ; P9-NEXT: mtvsrd v2, r3
1010 ; P9-NEXT: xscvudqp v2, v2
1013 ; NOVSX-LABEL: u64_to_q:
1014 ; NOVSX: # %bb.0: # %entry
1015 ; NOVSX-NEXT: mflr r0
1016 ; NOVSX-NEXT: stdu r1, -32(r1)
1017 ; NOVSX-NEXT: std r0, 48(r1)
1018 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
1019 ; NOVSX-NEXT: .cfi_offset lr, 16
1020 ; NOVSX-NEXT: bl __floatundikf
1022 ; NOVSX-NEXT: addi r1, r1, 32
1023 ; NOVSX-NEXT: ld r0, 16(r1)
1024 ; NOVSX-NEXT: mtlr r0
1027 %conv = tail call fp128 @llvm.experimental.constrained.uitofp.f128.i64(i64 %m, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
1031 attributes #0 = { strictfp }