1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mcpu=ppc32 -mtriple=powerpc-unknown-linux-gnu < %s | FileCheck %s
4 define double @test(i1 %X) {
7 ; CHECK-NEXT: li 4, .LCPI0_0@l
8 ; CHECK-NEXT: andi. 3, 3, 1
9 ; CHECK-NEXT: addis 3, 4, .LCPI0_0@ha
10 ; CHECK-NEXT: li 4, .LCPI0_1@l
11 ; CHECK-NEXT: addis 4, 4, .LCPI0_1@ha
12 ; CHECK-NEXT: bc 12, 1, .LBB0_1
13 ; CHECK-NEXT: b .LBB0_2
14 ; CHECK-NEXT: .LBB0_1:
15 ; CHECK-NEXT: addi 3, 4, 0
16 ; CHECK-NEXT: .LBB0_2:
17 ; CHECK-NEXT: lfs 1, 0(3)
19 %Y = uitofp i1 %X to double
23 ; Verify the cases won't crash because of missing chains
25 @foo = dso_local global double 0.000000e+00, align 8
27 define double @u1tofp(i1 %i, double %d) #0 {
28 ; CHECK-LABEL: u1tofp:
29 ; CHECK: # %bb.0: # %entry
30 ; CHECK-NEXT: li 4, .LCPI1_0@l
31 ; CHECK-NEXT: andi. 3, 3, 1
32 ; CHECK-NEXT: addis 3, 4, .LCPI1_0@ha
33 ; CHECK-NEXT: li 4, .LCPI1_1@l
34 ; CHECK-NEXT: addis 4, 4, .LCPI1_1@ha
35 ; CHECK-NEXT: bc 12, 1, .LBB1_1
36 ; CHECK-NEXT: b .LBB1_2
37 ; CHECK-NEXT: .LBB1_1: # %entry
38 ; CHECK-NEXT: addi 3, 4, 0
39 ; CHECK-NEXT: .LBB1_2: # %entry
40 ; CHECK-NEXT: fmr 0, 1
41 ; CHECK-NEXT: lfs 1, 0(3)
42 ; CHECK-NEXT: lis 3, foo@ha
43 ; CHECK-NEXT: stfd 0, foo@l(3)
46 %conv = tail call double @llvm.experimental.constrained.uitofp.f64.i1(i1 %i, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
47 store volatile double %d, ptr @foo, align 8
51 define double @s1tofp(i1 %i, double %d) #0 {
52 ; CHECK-LABEL: s1tofp:
53 ; CHECK: # %bb.0: # %entry
54 ; CHECK-NEXT: li 4, .LCPI2_0@l
55 ; CHECK-NEXT: andi. 3, 3, 1
56 ; CHECK-NEXT: addis 3, 4, .LCPI2_0@ha
57 ; CHECK-NEXT: li 4, .LCPI2_1@l
58 ; CHECK-NEXT: addis 4, 4, .LCPI2_1@ha
59 ; CHECK-NEXT: bc 12, 1, .LBB2_1
60 ; CHECK-NEXT: b .LBB2_2
61 ; CHECK-NEXT: .LBB2_1: # %entry
62 ; CHECK-NEXT: addi 3, 4, 0
63 ; CHECK-NEXT: .LBB2_2: # %entry
64 ; CHECK-NEXT: fmr 0, 1
65 ; CHECK-NEXT: lfs 1, 0(3)
66 ; CHECK-NEXT: lis 3, foo@ha
67 ; CHECK-NEXT: stfd 0, foo@l(3)
70 %conv = tail call double @llvm.experimental.constrained.sitofp.f64.i1(i1 %i, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
71 store volatile double %d, ptr @foo, align 8
75 declare double @llvm.experimental.constrained.uitofp.f64.i1(i1, metadata, metadata)
76 declare double @llvm.experimental.constrained.sitofp.f64.i1(i1, metadata, metadata)
78 attributes #0 = { strictfp }