1 ; RUN: llc -march=mips64 -mcpu=mips64r2 -mattr=+soft-float -O2 < %s | FileCheck %s
3 define void @foosf() #0 {
5 %in = alloca float, align 4
6 %out = alloca float, align 4
7 store volatile float 0xBFD59E1380000000, ptr %in, align 4
8 %in.0.in.0. = load volatile float, ptr %in, align 4
9 %rintf = tail call float @rintf(float %in.0.in.0.) #1
10 store volatile float %rintf, ptr %out, align 4
19 declare float @rintf(float)
21 define float @foosf1(ptr nocapture readonly %a) #0 {
23 %0 = load float, ptr %a, align 4
24 %call = tail call float @roundf(float %0) #2
33 declare float @roundf(float) #1
35 define float @foosf2(ptr nocapture readonly %a) #0 {
37 %0 = load float, ptr %a, align 4
38 %call = tail call float @truncf(float %0) #2
47 declare float @truncf(float) #1
49 define float @foosf3(ptr nocapture readonly %a) #0 {
51 %0 = load float, ptr %a, align 4
52 %call = tail call float @floorf(float %0) #2
61 declare float @floorf(float) #1
63 define float @foosf4(ptr nocapture readonly %a) #0 {
65 %0 = load float, ptr %a, align 4
66 %call = tail call float @nearbyintf(float %0) #2
75 declare float @nearbyintf(float) #1
77 define float @foosf5(ptr nocapture readonly %a) #0 {
79 %0 = load float, ptr %a, align 4
80 %mul = fmul float %0, undef
89 define float @foosf6(ptr nocapture readonly %a) #0 {
91 %0 = load float, ptr %a, align 4
92 %sub = fsub float %0, undef
101 define float @foosf7(ptr nocapture readonly %a) #0 {
103 %0 = load float, ptr %a, align 4
104 %add = fadd float %0, undef
107 ; CHECK-LABEL: foosf7
113 define float @foosf8(ptr nocapture readonly %a) #0 {
115 %b = alloca float, align 4
116 %b.0.b.0. = load volatile float, ptr %b, align 4
117 %0 = load float, ptr %a, align 4
118 %div = fdiv float %b.0.b.0., %0
121 ; CHECK-LABEL: foosf8
127 define float @foosf9() #0 {
129 %b = alloca float, align 4
130 %b.0.b.0. = load volatile float, ptr %b, align 4
131 %conv = fpext float %b.0.b.0. to double
132 %b.0.b.0.3 = load volatile float, ptr %b, align 4
133 %conv1 = fpext float %b.0.b.0.3 to double
134 %call = tail call double @pow(double %conv, double %conv1) #1
135 %conv2 = fptrunc double %call to float
138 ; CHECK-LABEL: foosf9
144 declare double @pow(double, double) #0
146 define float @foosf10() #0 {
148 %a = alloca float, align 4
149 %a.0.a.0. = load volatile float, ptr %a, align 4
150 %conv = fpext float %a.0.a.0. to double
151 %call = tail call double @sin(double %conv) #1
152 %conv1 = fptrunc double %call to float
155 ; CHECK-LABEL: foosf10
161 declare double @sin(double) #0
163 define float @foosf11() #0 {
165 %b = alloca float, align 4
166 %b.0.b.0. = load volatile float, ptr %b, align 4
167 %call = tail call float @ceilf(float %b.0.b.0.) #2
170 ; CHECK-LABEL: foosf11
176 declare float @ceilf(float) #1
178 define float @foosf12() #0 {
180 %b = alloca float, align 4
181 %a = alloca float, align 4
182 %b.0.b.0. = load volatile float, ptr %b, align 4
183 %a.0.a.0. = load volatile float, ptr %a, align 4
184 %call = tail call float @fmaxf(float %b.0.b.0., float %a.0.a.0.) #2
187 ; CHECK-LABEL: foosf12
193 declare float @fmaxf(float, float) #1
195 define float @foosf13() #0 {
197 %b = alloca float, align 4
198 %a = alloca float, align 4
199 %b.0.b.0. = load volatile float, ptr %b, align 4
200 %a.0.a.0. = load volatile float, ptr %a, align 4
201 %call = tail call float @fminf(float %b.0.b.0., float %a.0.a.0.) #2
204 ; CHECK-LABEL: foosf13
210 declare float @fminf(float, float) #1
213 attributes #0 = { nounwind "use-soft-float"="true" }
214 attributes #1 = { nounwind readnone "use-soft-float"="true" }