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: std r0, 16(r1)
50 ; P8-NEXT: stdu r1, -112(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: std r0, 16(r1)
64 ; P9-NEXT: stdu r1, -32(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: std r0, 16(r1)
78 ; NOVSX-NEXT: stdu r1, -32(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: std r0, 16(r1)
97 ; P8-NEXT: stdu r1, -112(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: std r0, 16(r1)
111 ; P9-NEXT: stdu r1, -32(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: std r0, 16(r1)
125 ; NOVSX-NEXT: stdu r1, -32(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: std r0, 16(r1)
144 ; P8-NEXT: stdu r1, -112(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: std r0, 16(r1)
164 ; NOVSX-NEXT: stdu r1, -32(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: std r0, 16(r1)
183 ; P8-NEXT: stdu r1, -112(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: std r0, 16(r1)
203 ; NOVSX-NEXT: stdu r1, -32(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: std r0, 16(r1)
222 ; P8-NEXT: stdu r1, -112(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: std r0, 16(r1)
236 ; P9-NEXT: stdu r1, -32(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: std r0, 16(r1)
250 ; NOVSX-NEXT: stdu r1, -32(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: std r0, 16(r1)
269 ; P8-NEXT: stdu r1, -112(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: std r0, 16(r1)
283 ; P9-NEXT: stdu r1, -32(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: std r0, 16(r1)
297 ; NOVSX-NEXT: stdu r1, -32(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: std r0, 16(r1)
316 ; P8-NEXT: stdu r1, -112(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: std r0, 16(r1)
338 ; NOVSX-NEXT: stdu r1, -32(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: std r0, 16(r1)
358 ; P8-NEXT: stdu r1, -112(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: std r0, 16(r1)
378 ; NOVSX-NEXT: stdu r1, -32(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: std r0, 16(r1)
397 ; P8-NEXT: stdu r1, -112(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: std r0, 16(r1)
417 ; NOVSX-NEXT: stdu r1, -32(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: std r0, 16(r1)
436 ; P8-NEXT: stdu r1, -112(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
450 ; P9-NEXT: clrldi r3, r3, 32
453 ; NOVSX-LABEL: q_to_u32:
454 ; NOVSX: # %bb.0: # %entry
455 ; NOVSX-NEXT: mflr r0
456 ; NOVSX-NEXT: std r0, 16(r1)
457 ; NOVSX-NEXT: stdu r1, -32(r1)
458 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
459 ; NOVSX-NEXT: .cfi_offset lr, 16
460 ; NOVSX-NEXT: bl __fixunskfsi
462 ; NOVSX-NEXT: addi r1, r1, 32
463 ; NOVSX-NEXT: ld r0, 16(r1)
464 ; NOVSX-NEXT: mtlr r0
467 %conv = tail call i32 @llvm.experimental.constrained.fptoui.i32.f128(fp128 %m, metadata !"fpexcept.strict") #0
471 define signext i32 @ppcq_to_i32(ppc_fp128 %m) #0 {
472 ; P8-LABEL: ppcq_to_i32:
473 ; P8: # %bb.0: # %entry
477 ; P8-NEXT: fadd f1, f2, f1
478 ; P8-NEXT: mtfsf 1, f0
479 ; P8-NEXT: xscvdpsxws f0, f1
480 ; P8-NEXT: mffprwz r3, f0
481 ; P8-NEXT: extsw r3, r3
484 ; P9-LABEL: ppcq_to_i32:
485 ; P9: # %bb.0: # %entry
489 ; P9-NEXT: fadd f1, f2, f1
490 ; P9-NEXT: mtfsf 1, f0
491 ; P9-NEXT: xscvdpsxws f0, f1
492 ; P9-NEXT: mffprwz r3, f0
493 ; P9-NEXT: extsw r3, r3
496 ; NOVSX-LABEL: ppcq_to_i32:
497 ; NOVSX: # %bb.0: # %entry
498 ; NOVSX-NEXT: mffs f0
499 ; NOVSX-NEXT: mtfsb1 31
500 ; NOVSX-NEXT: addi r3, r1, -4
501 ; NOVSX-NEXT: mtfsb0 30
502 ; NOVSX-NEXT: fadd f1, f2, f1
503 ; NOVSX-NEXT: mtfsf 1, f0
504 ; NOVSX-NEXT: fctiwz f0, f1
505 ; NOVSX-NEXT: stfiwx f0, 0, r3
506 ; NOVSX-NEXT: lwa r3, -4(r1)
509 %conv = tail call i32 @llvm.experimental.constrained.fptosi.i32.ppcf128(ppc_fp128 %m, metadata !"fpexcept.strict") #0
513 define i64 @ppcq_to_i64(ppc_fp128 %m) #0 {
514 ; P8-LABEL: ppcq_to_i64:
515 ; P8: # %bb.0: # %entry
517 ; P8-NEXT: std r0, 16(r1)
518 ; P8-NEXT: stdu r1, -112(r1)
519 ; P8-NEXT: .cfi_def_cfa_offset 112
520 ; P8-NEXT: .cfi_offset lr, 16
521 ; P8-NEXT: bl __fixtfdi
523 ; P8-NEXT: addi r1, r1, 112
524 ; P8-NEXT: ld r0, 16(r1)
528 ; P9-LABEL: ppcq_to_i64:
529 ; P9: # %bb.0: # %entry
531 ; P9-NEXT: std r0, 16(r1)
532 ; P9-NEXT: stdu r1, -32(r1)
533 ; P9-NEXT: .cfi_def_cfa_offset 32
534 ; P9-NEXT: .cfi_offset lr, 16
535 ; P9-NEXT: bl __fixtfdi
537 ; P9-NEXT: addi r1, r1, 32
538 ; P9-NEXT: ld r0, 16(r1)
542 ; NOVSX-LABEL: ppcq_to_i64:
543 ; NOVSX: # %bb.0: # %entry
544 ; NOVSX-NEXT: mflr r0
545 ; NOVSX-NEXT: std r0, 16(r1)
546 ; NOVSX-NEXT: stdu r1, -32(r1)
547 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
548 ; NOVSX-NEXT: .cfi_offset lr, 16
549 ; NOVSX-NEXT: bl __fixtfdi
551 ; NOVSX-NEXT: addi r1, r1, 32
552 ; NOVSX-NEXT: ld r0, 16(r1)
553 ; NOVSX-NEXT: mtlr r0
556 %conv = tail call i64 @llvm.experimental.constrained.fptosi.i64.ppcf128(ppc_fp128 %m, metadata !"fpexcept.strict") #0
560 define i64 @ppcq_to_u64(ppc_fp128 %m) #0 {
561 ; P8-LABEL: ppcq_to_u64:
562 ; P8: # %bb.0: # %entry
564 ; P8-NEXT: std r0, 16(r1)
565 ; P8-NEXT: stdu r1, -112(r1)
566 ; P8-NEXT: .cfi_def_cfa_offset 112
567 ; P8-NEXT: .cfi_offset lr, 16
568 ; P8-NEXT: bl __fixunstfdi
570 ; P8-NEXT: addi r1, r1, 112
571 ; P8-NEXT: ld r0, 16(r1)
575 ; P9-LABEL: ppcq_to_u64:
576 ; P9: # %bb.0: # %entry
578 ; P9-NEXT: std r0, 16(r1)
579 ; P9-NEXT: stdu r1, -32(r1)
580 ; P9-NEXT: .cfi_def_cfa_offset 32
581 ; P9-NEXT: .cfi_offset lr, 16
582 ; P9-NEXT: bl __fixunstfdi
584 ; P9-NEXT: addi r1, r1, 32
585 ; P9-NEXT: ld r0, 16(r1)
589 ; NOVSX-LABEL: ppcq_to_u64:
590 ; NOVSX: # %bb.0: # %entry
591 ; NOVSX-NEXT: mflr r0
592 ; NOVSX-NEXT: std r0, 16(r1)
593 ; NOVSX-NEXT: stdu r1, -32(r1)
594 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
595 ; NOVSX-NEXT: .cfi_offset lr, 16
596 ; NOVSX-NEXT: bl __fixunstfdi
598 ; NOVSX-NEXT: addi r1, r1, 32
599 ; NOVSX-NEXT: ld r0, 16(r1)
600 ; NOVSX-NEXT: mtlr r0
603 %conv = tail call i64 @llvm.experimental.constrained.fptoui.i64.ppcf128(ppc_fp128 %m, metadata !"fpexcept.strict") #0
607 define zeroext i32 @ppcq_to_u32(ppc_fp128 %m) #0 {
608 ; P8-LABEL: ppcq_to_u32:
609 ; P8: # %bb.0: # %entry
611 ; P8-NEXT: std r0, 16(r1)
612 ; P8-NEXT: stdu r1, -128(r1)
613 ; P8-NEXT: .cfi_def_cfa_offset 128
614 ; P8-NEXT: .cfi_offset lr, 16
615 ; P8-NEXT: .cfi_offset r30, -16
616 ; P8-NEXT: addis r3, r2, .LCPI13_0@toc@ha
617 ; P8-NEXT: xxlxor f3, f3, f3
618 ; P8-NEXT: std r30, 112(r1) # 8-byte Folded Spill
619 ; P8-NEXT: lfs f0, .LCPI13_0@toc@l(r3)
620 ; P8-NEXT: lis r3, -32768
621 ; P8-NEXT: fcmpo cr0, f2, f3
622 ; P8-NEXT: xxlxor f3, f3, f3
623 ; P8-NEXT: fcmpo cr1, f1, f0
624 ; P8-NEXT: crand 4*cr5+lt, 4*cr1+eq, lt
625 ; P8-NEXT: crandc 4*cr5+gt, 4*cr1+lt, 4*cr1+eq
626 ; P8-NEXT: cror 4*cr5+lt, 4*cr5+gt, 4*cr5+lt
627 ; P8-NEXT: isel r30, 0, r3, 4*cr5+lt
628 ; P8-NEXT: bc 12, 4*cr5+lt, .LBB13_2
629 ; P8-NEXT: # %bb.1: # %entry
630 ; P8-NEXT: fmr f3, f0
631 ; P8-NEXT: .LBB13_2: # %entry
632 ; P8-NEXT: xxlxor f4, f4, f4
633 ; P8-NEXT: bl __gcc_qsub
638 ; P8-NEXT: fadd f1, f2, f1
639 ; P8-NEXT: mtfsf 1, f0
640 ; P8-NEXT: xscvdpsxws f0, f1
641 ; P8-NEXT: mffprwz r3, f0
642 ; P8-NEXT: xor r3, r3, r30
643 ; P8-NEXT: ld r30, 112(r1) # 8-byte Folded Reload
644 ; P8-NEXT: clrldi r3, r3, 32
645 ; P8-NEXT: addi r1, r1, 128
646 ; P8-NEXT: ld r0, 16(r1)
650 ; P9-LABEL: ppcq_to_u32:
651 ; P9: # %bb.0: # %entry
653 ; P9-NEXT: .cfi_def_cfa_offset 48
654 ; P9-NEXT: .cfi_offset lr, 16
655 ; P9-NEXT: .cfi_offset r30, -16
656 ; P9-NEXT: std r30, -16(r1) # 8-byte Folded Spill
657 ; P9-NEXT: std r0, 16(r1)
658 ; P9-NEXT: stdu r1, -48(r1)
659 ; P9-NEXT: addis r3, r2, .LCPI13_0@toc@ha
660 ; P9-NEXT: xxlxor f3, f3, f3
661 ; P9-NEXT: lfs f0, .LCPI13_0@toc@l(r3)
662 ; P9-NEXT: fcmpo cr1, f2, f3
663 ; P9-NEXT: lis r3, -32768
664 ; P9-NEXT: fcmpo cr0, f1, f0
665 ; P9-NEXT: xxlxor f3, f3, f3
666 ; P9-NEXT: crand 4*cr5+lt, eq, 4*cr1+lt
667 ; P9-NEXT: crandc 4*cr5+gt, lt, eq
668 ; P9-NEXT: cror 4*cr5+lt, 4*cr5+gt, 4*cr5+lt
669 ; P9-NEXT: isel r30, 0, r3, 4*cr5+lt
670 ; P9-NEXT: bc 12, 4*cr5+lt, .LBB13_2
671 ; P9-NEXT: # %bb.1: # %entry
672 ; P9-NEXT: fmr f3, f0
673 ; P9-NEXT: .LBB13_2: # %entry
674 ; P9-NEXT: xxlxor f4, f4, f4
675 ; P9-NEXT: bl __gcc_qsub
680 ; P9-NEXT: fadd f1, f2, f1
681 ; P9-NEXT: mtfsf 1, f0
682 ; P9-NEXT: xscvdpsxws f0, f1
683 ; P9-NEXT: mffprwz r3, f0
684 ; P9-NEXT: xor r3, r3, r30
685 ; P9-NEXT: clrldi r3, r3, 32
686 ; P9-NEXT: addi r1, r1, 48
687 ; P9-NEXT: ld r0, 16(r1)
688 ; P9-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
692 ; NOVSX-LABEL: ppcq_to_u32:
693 ; NOVSX: # %bb.0: # %entry
694 ; NOVSX-NEXT: mfocrf r12, 32
695 ; NOVSX-NEXT: mflr r0
696 ; NOVSX-NEXT: std r0, 16(r1)
697 ; NOVSX-NEXT: stw r12, 8(r1)
698 ; NOVSX-NEXT: stdu r1, -48(r1)
699 ; NOVSX-NEXT: .cfi_def_cfa_offset 48
700 ; NOVSX-NEXT: .cfi_offset lr, 16
701 ; NOVSX-NEXT: .cfi_offset cr2, 8
702 ; NOVSX-NEXT: addis r3, r2, .LCPI13_0@toc@ha
703 ; NOVSX-NEXT: addis r4, r2, .LCPI13_1@toc@ha
704 ; NOVSX-NEXT: lfs f0, .LCPI13_0@toc@l(r3)
705 ; NOVSX-NEXT: lfs f4, .LCPI13_1@toc@l(r4)
706 ; NOVSX-NEXT: fcmpo cr0, f1, f0
707 ; NOVSX-NEXT: fcmpo cr1, f2, f4
708 ; NOVSX-NEXT: fmr f3, f4
709 ; NOVSX-NEXT: crand 4*cr5+lt, eq, 4*cr1+lt
710 ; NOVSX-NEXT: crandc 4*cr5+gt, lt, eq
711 ; NOVSX-NEXT: cror 4*cr2+lt, 4*cr5+gt, 4*cr5+lt
712 ; NOVSX-NEXT: bc 12, 4*cr2+lt, .LBB13_2
713 ; NOVSX-NEXT: # %bb.1: # %entry
714 ; NOVSX-NEXT: fmr f3, f0
715 ; NOVSX-NEXT: .LBB13_2: # %entry
716 ; NOVSX-NEXT: bl __gcc_qsub
718 ; NOVSX-NEXT: mffs f0
719 ; NOVSX-NEXT: mtfsb1 31
720 ; NOVSX-NEXT: addi r3, r1, 44
721 ; NOVSX-NEXT: mtfsb0 30
722 ; NOVSX-NEXT: fadd f1, f2, f1
723 ; NOVSX-NEXT: mtfsf 1, f0
724 ; NOVSX-NEXT: fctiwz f0, f1
725 ; NOVSX-NEXT: stfiwx f0, 0, r3
726 ; NOVSX-NEXT: lis r3, -32768
727 ; NOVSX-NEXT: lwz r4, 44(r1)
728 ; NOVSX-NEXT: isel r3, 0, r3, 4*cr2+lt
729 ; NOVSX-NEXT: xor r3, r4, r3
730 ; NOVSX-NEXT: clrldi r3, r3, 32
731 ; NOVSX-NEXT: addi r1, r1, 48
732 ; NOVSX-NEXT: ld r0, 16(r1)
733 ; NOVSX-NEXT: lwz r12, 8(r1)
734 ; NOVSX-NEXT: mtocrf 32, r12
735 ; NOVSX-NEXT: mtlr r0
738 %conv = tail call i32 @llvm.experimental.constrained.fptoui.i32.ppcf128(ppc_fp128 %m, metadata !"fpexcept.strict") #0
742 define fp128 @i1_to_q(i1 signext %m) #0 {
744 ; P8: # %bb.0: # %entry
746 ; P8-NEXT: std r0, 16(r1)
747 ; P8-NEXT: stdu r1, -112(r1)
748 ; P8-NEXT: .cfi_def_cfa_offset 112
749 ; P8-NEXT: .cfi_offset lr, 16
750 ; P8-NEXT: bl __floatsikf
752 ; P8-NEXT: addi r1, r1, 112
753 ; P8-NEXT: ld r0, 16(r1)
758 ; P9: # %bb.0: # %entry
759 ; P9-NEXT: mtvsrwa v2, r3
760 ; P9-NEXT: xscvsdqp v2, v2
763 ; NOVSX-LABEL: i1_to_q:
764 ; NOVSX: # %bb.0: # %entry
765 ; NOVSX-NEXT: mflr r0
766 ; NOVSX-NEXT: std r0, 16(r1)
767 ; NOVSX-NEXT: stdu r1, -32(r1)
768 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
769 ; NOVSX-NEXT: .cfi_offset lr, 16
770 ; NOVSX-NEXT: bl __floatsikf
772 ; NOVSX-NEXT: addi r1, r1, 32
773 ; NOVSX-NEXT: ld r0, 16(r1)
774 ; NOVSX-NEXT: mtlr r0
777 %conv = tail call fp128 @llvm.experimental.constrained.sitofp.f128.i1(i1 %m, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
781 define fp128 @u1_to_q(i1 zeroext %m) #0 {
783 ; P8: # %bb.0: # %entry
785 ; P8-NEXT: std r0, 16(r1)
786 ; P8-NEXT: stdu r1, -112(r1)
787 ; P8-NEXT: .cfi_def_cfa_offset 112
788 ; P8-NEXT: .cfi_offset lr, 16
789 ; P8-NEXT: bl __floatsikf
791 ; P8-NEXT: addi r1, r1, 112
792 ; P8-NEXT: ld r0, 16(r1)
797 ; P9: # %bb.0: # %entry
798 ; P9-NEXT: mtvsrwa v2, r3
799 ; P9-NEXT: xscvsdqp v2, v2
802 ; NOVSX-LABEL: u1_to_q:
803 ; NOVSX: # %bb.0: # %entry
804 ; NOVSX-NEXT: mflr r0
805 ; NOVSX-NEXT: std r0, 16(r1)
806 ; NOVSX-NEXT: stdu r1, -32(r1)
807 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
808 ; NOVSX-NEXT: .cfi_offset lr, 16
809 ; NOVSX-NEXT: bl __floatunsikf
811 ; NOVSX-NEXT: addi r1, r1, 32
812 ; NOVSX-NEXT: ld r0, 16(r1)
813 ; NOVSX-NEXT: mtlr r0
816 %conv = tail call fp128 @llvm.experimental.constrained.uitofp.f128.i1(i1 %m, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
820 define ppc_fp128 @i1_to_ppcq(i1 signext %m) #0 {
821 ; P8-LABEL: i1_to_ppcq:
822 ; P8: # %bb.0: # %entry
823 ; P8-NEXT: mtfprwa f0, r3
824 ; P8-NEXT: xxlxor f2, f2, f2
825 ; P8-NEXT: xscvsxddp f1, f0
828 ; P9-LABEL: i1_to_ppcq:
829 ; P9: # %bb.0: # %entry
830 ; P9-NEXT: mtfprwa f0, r3
831 ; P9-NEXT: xxlxor f2, f2, f2
832 ; P9-NEXT: xscvsxddp f1, f0
835 ; NOVSX-LABEL: i1_to_ppcq:
836 ; NOVSX: # %bb.0: # %entry
837 ; NOVSX-NEXT: addi r4, r1, -4
838 ; NOVSX-NEXT: stw r3, -4(r1)
839 ; NOVSX-NEXT: addis r3, r2, .LCPI16_0@toc@ha
840 ; NOVSX-NEXT: lfiwax f0, 0, r4
841 ; NOVSX-NEXT: lfs f2, .LCPI16_0@toc@l(r3)
842 ; NOVSX-NEXT: fcfid f1, f0
845 %conv = tail call ppc_fp128 @llvm.experimental.constrained.sitofp.ppcf128.i1(i1 %m, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
849 define ppc_fp128 @u1_to_ppcq(i1 zeroext %m) #0 {
850 ; P8-LABEL: u1_to_ppcq:
851 ; P8: # %bb.0: # %entry
852 ; P8-NEXT: mtfprwa f0, r3
853 ; P8-NEXT: xxlxor f2, f2, f2
854 ; P8-NEXT: xscvsxddp f1, f0
857 ; P9-LABEL: u1_to_ppcq:
858 ; P9: # %bb.0: # %entry
859 ; P9-NEXT: mtfprwa f0, r3
860 ; P9-NEXT: xxlxor f2, f2, f2
861 ; P9-NEXT: xscvsxddp f1, f0
864 ; NOVSX-LABEL: u1_to_ppcq:
865 ; NOVSX: # %bb.0: # %entry
866 ; NOVSX-NEXT: addi r4, r1, -4
867 ; NOVSX-NEXT: stw r3, -4(r1)
868 ; NOVSX-NEXT: addis r3, r2, .LCPI17_0@toc@ha
869 ; NOVSX-NEXT: lfiwax f0, 0, r4
870 ; NOVSX-NEXT: lfs f2, .LCPI17_0@toc@l(r3)
871 ; NOVSX-NEXT: fcfid f1, f0
874 %conv = tail call ppc_fp128 @llvm.experimental.constrained.uitofp.ppcf128.i1(i1 %m, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
878 define fp128 @i32_to_q(i32 signext %m) #0 {
879 ; P8-LABEL: i32_to_q:
880 ; P8: # %bb.0: # %entry
882 ; P8-NEXT: std r0, 16(r1)
883 ; P8-NEXT: stdu r1, -112(r1)
884 ; P8-NEXT: .cfi_def_cfa_offset 112
885 ; P8-NEXT: .cfi_offset lr, 16
886 ; P8-NEXT: bl __floatsikf
888 ; P8-NEXT: addi r1, r1, 112
889 ; P8-NEXT: ld r0, 16(r1)
893 ; P9-LABEL: i32_to_q:
894 ; P9: # %bb.0: # %entry
895 ; P9-NEXT: mtvsrwa v2, r3
896 ; P9-NEXT: xscvsdqp v2, v2
899 ; NOVSX-LABEL: i32_to_q:
900 ; NOVSX: # %bb.0: # %entry
901 ; NOVSX-NEXT: mflr r0
902 ; NOVSX-NEXT: std r0, 16(r1)
903 ; NOVSX-NEXT: stdu r1, -32(r1)
904 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
905 ; NOVSX-NEXT: .cfi_offset lr, 16
906 ; NOVSX-NEXT: bl __floatsikf
908 ; NOVSX-NEXT: addi r1, r1, 32
909 ; NOVSX-NEXT: ld r0, 16(r1)
910 ; NOVSX-NEXT: mtlr r0
913 %conv = tail call fp128 @llvm.experimental.constrained.sitofp.f128.i32(i32 %m, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
917 define fp128 @i64_to_q(i64 %m) #0 {
918 ; P8-LABEL: i64_to_q:
919 ; P8: # %bb.0: # %entry
921 ; P8-NEXT: std r0, 16(r1)
922 ; P8-NEXT: stdu r1, -112(r1)
923 ; P8-NEXT: .cfi_def_cfa_offset 112
924 ; P8-NEXT: .cfi_offset lr, 16
925 ; P8-NEXT: bl __floatdikf
927 ; P8-NEXT: addi r1, r1, 112
928 ; P8-NEXT: ld r0, 16(r1)
932 ; P9-LABEL: i64_to_q:
933 ; P9: # %bb.0: # %entry
934 ; P9-NEXT: mtvsrd v2, r3
935 ; P9-NEXT: xscvsdqp v2, v2
938 ; NOVSX-LABEL: i64_to_q:
939 ; NOVSX: # %bb.0: # %entry
940 ; NOVSX-NEXT: mflr r0
941 ; NOVSX-NEXT: std r0, 16(r1)
942 ; NOVSX-NEXT: stdu r1, -32(r1)
943 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
944 ; NOVSX-NEXT: .cfi_offset lr, 16
945 ; NOVSX-NEXT: bl __floatdikf
947 ; NOVSX-NEXT: addi r1, r1, 32
948 ; NOVSX-NEXT: ld r0, 16(r1)
949 ; NOVSX-NEXT: mtlr r0
952 %conv = tail call fp128 @llvm.experimental.constrained.sitofp.f128.i64(i64 %m, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
956 define fp128 @u32_to_q(i32 zeroext %m) #0 {
957 ; P8-LABEL: u32_to_q:
958 ; P8: # %bb.0: # %entry
960 ; P8-NEXT: std r0, 16(r1)
961 ; P8-NEXT: stdu r1, -112(r1)
962 ; P8-NEXT: .cfi_def_cfa_offset 112
963 ; P8-NEXT: .cfi_offset lr, 16
964 ; P8-NEXT: bl __floatunsikf
966 ; P8-NEXT: addi r1, r1, 112
967 ; P8-NEXT: ld r0, 16(r1)
971 ; P9-LABEL: u32_to_q:
972 ; P9: # %bb.0: # %entry
973 ; P9-NEXT: mtvsrwz v2, r3
974 ; P9-NEXT: xscvudqp v2, v2
977 ; NOVSX-LABEL: u32_to_q:
978 ; NOVSX: # %bb.0: # %entry
979 ; NOVSX-NEXT: mflr r0
980 ; NOVSX-NEXT: std r0, 16(r1)
981 ; NOVSX-NEXT: stdu r1, -32(r1)
982 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
983 ; NOVSX-NEXT: .cfi_offset lr, 16
984 ; NOVSX-NEXT: bl __floatunsikf
986 ; NOVSX-NEXT: addi r1, r1, 32
987 ; NOVSX-NEXT: ld r0, 16(r1)
988 ; NOVSX-NEXT: mtlr r0
991 %conv = tail call fp128 @llvm.experimental.constrained.uitofp.f128.i32(i32 %m, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
995 define fp128 @u64_to_q(i64 %m) #0 {
996 ; P8-LABEL: u64_to_q:
997 ; P8: # %bb.0: # %entry
999 ; P8-NEXT: std r0, 16(r1)
1000 ; P8-NEXT: stdu r1, -112(r1)
1001 ; P8-NEXT: .cfi_def_cfa_offset 112
1002 ; P8-NEXT: .cfi_offset lr, 16
1003 ; P8-NEXT: bl __floatundikf
1005 ; P8-NEXT: addi r1, r1, 112
1006 ; P8-NEXT: ld r0, 16(r1)
1010 ; P9-LABEL: u64_to_q:
1011 ; P9: # %bb.0: # %entry
1012 ; P9-NEXT: mtvsrd v2, r3
1013 ; P9-NEXT: xscvudqp v2, v2
1016 ; NOVSX-LABEL: u64_to_q:
1017 ; NOVSX: # %bb.0: # %entry
1018 ; NOVSX-NEXT: mflr r0
1019 ; NOVSX-NEXT: std r0, 16(r1)
1020 ; NOVSX-NEXT: stdu r1, -32(r1)
1021 ; NOVSX-NEXT: .cfi_def_cfa_offset 32
1022 ; NOVSX-NEXT: .cfi_offset lr, 16
1023 ; NOVSX-NEXT: bl __floatundikf
1025 ; NOVSX-NEXT: addi r1, r1, 32
1026 ; NOVSX-NEXT: ld r0, 16(r1)
1027 ; NOVSX-NEXT: mtlr r0
1030 %conv = tail call fp128 @llvm.experimental.constrained.uitofp.f128.i64(i64 %m, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
1034 attributes #0 = { strictfp }