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: andi. 3, 3, 1
8 ; CHECK-NEXT: bc 12, 1, .LBB0_2
10 ; CHECK-NEXT: li 3, .LCPI0_0@l
11 ; CHECK-NEXT: addis 3, 3, .LCPI0_0@ha
12 ; CHECK-NEXT: lfs 1, 0(3)
14 ; CHECK-NEXT: .LBB0_2:
15 ; CHECK-NEXT: li 3, .LCPI0_1@l
16 ; CHECK-NEXT: addis 3, 3, .LCPI0_1@ha
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: andi. 3, 3, 1
31 ; CHECK-NEXT: fmr 0, 1
32 ; CHECK-NEXT: bc 12, 1, .LBB1_2
33 ; CHECK-NEXT: # %bb.1: # %entry
34 ; CHECK-NEXT: li 3, .LCPI1_0@l
35 ; CHECK-NEXT: addis 3, 3, .LCPI1_0@ha
36 ; CHECK-NEXT: b .LBB1_3
37 ; CHECK-NEXT: .LBB1_2:
38 ; CHECK-NEXT: li 3, .LCPI1_1@l
39 ; CHECK-NEXT: addis 3, 3, .LCPI1_1@ha
40 ; CHECK-NEXT: .LBB1_3: # %entry
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: andi. 3, 3, 1
55 ; CHECK-NEXT: fmr 0, 1
56 ; CHECK-NEXT: bc 12, 1, .LBB2_2
57 ; CHECK-NEXT: # %bb.1: # %entry
58 ; CHECK-NEXT: li 3, .LCPI2_0@l
59 ; CHECK-NEXT: addis 3, 3, .LCPI2_0@ha
60 ; CHECK-NEXT: b .LBB2_3
61 ; CHECK-NEXT: .LBB2_2:
62 ; CHECK-NEXT: li 3, .LCPI2_1@l
63 ; CHECK-NEXT: addis 3, 3, .LCPI2_1@ha
64 ; CHECK-NEXT: .LBB2_3: # %entry
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 }