1 ; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips16 -soft-float -mips16-hard-float -relocation-model=pic < %s | FileCheck %s -check-prefix=pic
3 @x = global float 1.500000e+00, align 4
4 @xn = global float -1.900000e+01, align 4
5 @negone = global float -1.000000e+00, align 4
6 @one = global float 1.000000e+00, align 4
7 @xd = global double 0x40048B0A8EA4481E, align 8
8 @xdn = global double 0xC0311F9ADD373963, align 8
9 @negoned = global double -1.000000e+00, align 8
10 @oned = global float 1.000000e+00, align 4
11 @y = common global float 0.000000e+00, align 4
12 @yd = common global double 0.000000e+00, align 8
14 ; Function Attrs: nounwind
15 define void @foo1() #0 {
17 %0 = load float* @x, align 4
18 %1 = load float* @one, align 4
19 %call = call float @copysignf(float %0, float %1) #2
20 store float %call, float* @y, align 4
24 ; Function Attrs: nounwind readnone
25 declare float @copysignf(float, float) #1
27 ; Function Attrs: nounwind
28 define void @foo2() #0 {
30 %0 = load float* @x, align 4
31 %1 = load float* @negone, align 4
32 %call = call float @copysignf(float %0, float %1) #2
33 store float %call, float* @y, align 4
37 ; Function Attrs: nounwind
38 define void @foo3() #0 {
40 %0 = load double* @xd, align 8
41 %1 = load float* @oned, align 4
42 %conv = fpext float %1 to double
43 %call = call double @copysign(double %0, double %conv) #2
44 store double %call, double* @yd, align 8
48 ; Function Attrs: nounwind readnone
49 declare double @copysign(double, double) #1
51 ; Function Attrs: nounwind
52 define void @foo4() #0 {
54 %0 = load double* @xd, align 8
55 %1 = load double* @negoned, align 8
56 %call = call double @copysign(double %0, double %1) #2
57 store double %call, double* @yd, align 8
61 ; Function Attrs: nounwind
62 define void @foo5() #0 {
64 %0 = load float* @xn, align 4
65 %call = call float @fabsf(float %0) #2
66 store float %call, float* @y, align 4
70 ; Function Attrs: nounwind readnone
71 declare float @fabsf(float) #1
73 ; Function Attrs: nounwind
74 define void @foo6() #0 {
76 %0 = load double* @xdn, align 8
77 %call = call double @fabs(double %0) #2
78 store double %call, double* @yd, align 8
82 ; Function Attrs: nounwind readnone
83 declare double @fabs(double) #1
85 ; Function Attrs: nounwind
86 define void @foo7() #0 {
88 %0 = load float* @x, align 4
89 %call = call float @sinf(float %0) #3
90 ;pic: lw ${{[0-9]+}}, %call16(sinf)(${{[0-9]+}})
91 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_sf_1)(${{[0-9]+}})
92 store float %call, float* @y, align 4
96 ; Function Attrs: nounwind
97 declare float @sinf(float) #0
99 ; Function Attrs: nounwind
100 define void @foo8() #0 {
102 %0 = load double* @xd, align 8
103 %call = call double @sin(double %0) #3
104 ;pic: lw ${{[0-9]+}}, %call16(sin)(${{[0-9]+}})
105 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_df_2)(${{[0-9]+}})
106 store double %call, double* @yd, align 8
110 ; Function Attrs: nounwind
111 declare double @sin(double) #0
113 ; Function Attrs: nounwind
114 define void @foo9() #0 {
116 %0 = load float* @x, align 4
117 %call = call float @cosf(float %0) #3
118 ;pic: lw ${{[0-9]+}}, %call16(cosf)(${{[0-9]+}})
119 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_sf_1)(${{[0-9]+}})
120 store float %call, float* @y, align 4
124 ; Function Attrs: nounwind
125 declare float @cosf(float) #0
127 ; Function Attrs: nounwind
128 define void @foo10() #0 {
130 %0 = load double* @xd, align 8
131 %call = call double @cos(double %0) #3
132 ;pic: lw ${{[0-9]+}}, %call16(cos)(${{[0-9]+}})
133 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_df_2)(${{[0-9]+}})
134 store double %call, double* @yd, align 8
138 ; Function Attrs: nounwind
139 declare double @cos(double) #0
141 ; Function Attrs: nounwind
142 define void @foo11() #0 {
144 %0 = load float* @x, align 4
145 %call = call float @sqrtf(float %0) #3
146 ;pic: lw ${{[0-9]+}}, %call16(sqrtf)(${{[0-9]+}})
147 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_sf_1)(${{[0-9]+}})
148 store float %call, float* @y, align 4
152 ; Function Attrs: nounwind
153 declare float @sqrtf(float) #0
155 ; Function Attrs: nounwind
156 define void @foo12() #0 {
158 %0 = load double* @xd, align 8
159 %call = call double @sqrt(double %0) #3
160 ;pic: lw ${{[0-9]+}}, %call16(sqrt)(${{[0-9]+}})
161 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_df_2)(${{[0-9]+}})
162 store double %call, double* @yd, align 8
166 ; Function Attrs: nounwind
167 declare double @sqrt(double) #0
169 ; Function Attrs: nounwind
170 define void @foo13() #0 {
172 %0 = load float* @x, align 4
173 %call = call float @floorf(float %0) #2
174 ;pic: lw ${{[0-9]+}}, %call16(floorf)(${{[0-9]+}})
175 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_sf_1)(${{[0-9]+}})
176 store float %call, float* @y, align 4
180 ; Function Attrs: nounwind readnone
181 declare float @floorf(float) #1
183 ; Function Attrs: nounwind
184 define void @foo14() #0 {
186 %0 = load double* @xd, align 8
187 %call = call double @floor(double %0) #2
188 ;pic: lw ${{[0-9]+}}, %call16(floor)(${{[0-9]+}})
189 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_df_2)(${{[0-9]+}})
190 store double %call, double* @yd, align 8
194 ; Function Attrs: nounwind readnone
195 declare double @floor(double) #1
197 ; Function Attrs: nounwind
198 define void @foo15() #0 {
200 %0 = load float* @x, align 4
201 %call = call float @nearbyintf(float %0) #2
202 ;pic: lw ${{[0-9]+}}, %call16(nearbyintf)(${{[0-9]+}})
203 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_sf_1)(${{[0-9]+}})
204 store float %call, float* @y, align 4
208 ; Function Attrs: nounwind readnone
209 declare float @nearbyintf(float) #1
211 ; Function Attrs: nounwind
212 define void @foo16() #0 {
214 %0 = load double* @xd, align 8
215 %call = call double @nearbyint(double %0) #2
216 ;pic: lw ${{[0-9]+}}, %call16(nearbyint)(${{[0-9]+}})
217 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_df_2)(${{[0-9]+}})
218 store double %call, double* @yd, align 8
222 ; Function Attrs: nounwind readnone
223 declare double @nearbyint(double) #1
225 ; Function Attrs: nounwind
226 define void @foo17() #0 {
228 %0 = load float* @x, align 4
229 %call = call float @ceilf(float %0) #2
230 ;pic: lw ${{[0-9]+}}, %call16(ceilf)(${{[0-9]+}})
231 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_sf_1)(${{[0-9]+}})
232 store float %call, float* @y, align 4
236 ; Function Attrs: nounwind readnone
237 declare float @ceilf(float) #1
239 ; Function Attrs: nounwind
240 define void @foo18() #0 {
242 %0 = load double* @xd, align 8
243 %call = call double @ceil(double %0) #2
244 ;pic: lw ${{[0-9]+}}, %call16(ceil)(${{[0-9]+}})
245 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_df_2)(${{[0-9]+}})
246 store double %call, double* @yd, align 8
250 ; Function Attrs: nounwind readnone
251 declare double @ceil(double) #1
253 ; Function Attrs: nounwind
254 define void @foo19() #0 {
256 %0 = load float* @x, align 4
257 %call = call float @rintf(float %0) #2
258 ;pic: lw ${{[0-9]+}}, %call16(rintf)(${{[0-9]+}})
259 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_sf_1)(${{[0-9]+}})
260 store float %call, float* @y, align 4
264 ; Function Attrs: nounwind readnone
265 declare float @rintf(float) #1
267 ; Function Attrs: nounwind
268 define void @foo20() #0 {
270 %0 = load double* @xd, align 8
271 %call = call double @rint(double %0) #2
272 ;pic: lw ${{[0-9]+}}, %call16(rint)(${{[0-9]+}})
273 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_df_2)(${{[0-9]+}})
274 store double %call, double* @yd, align 8
278 ; Function Attrs: nounwind readnone
279 declare double @rint(double) #1
281 ; Function Attrs: nounwind
282 define void @foo21() #0 {
284 %0 = load float* @x, align 4
285 %call = call float @truncf(float %0) #2
286 ;pic: lw ${{[0-9]+}}, %call16(truncf)(${{[0-9]+}})
287 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_sf_1)(${{[0-9]+}})
288 store float %call, float* @y, align 4
292 ; Function Attrs: nounwind readnone
293 declare float @truncf(float) #1
295 ; Function Attrs: nounwind
296 define void @foo22() #0 {
298 %0 = load double* @xd, align 8
299 %call = call double @trunc(double %0) #2
300 ;pic: lw ${{[0-9]+}}, %call16(trunc)(${{[0-9]+}})
301 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_df_2)(${{[0-9]+}})
302 store double %call, double* @yd, align 8
306 ; Function Attrs: nounwind readnone
307 declare double @trunc(double) #1
309 ; Function Attrs: nounwind
310 define void @foo23() #0 {
312 %0 = load float* @x, align 4
313 %call = call float @log2f(float %0) #3
314 ;pic: lw ${{[0-9]+}}, %call16(log2f)(${{[0-9]+}})
315 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_sf_1)(${{[0-9]+}})
316 store float %call, float* @y, align 4
320 ; Function Attrs: nounwind
321 declare float @log2f(float) #0
323 ; Function Attrs: nounwind
324 define void @foo24() #0 {
326 %0 = load double* @xd, align 8
327 %call = call double @log2(double %0) #3
328 ;pic: lw ${{[0-9]+}}, %call16(log2)(${{[0-9]+}})
329 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_df_2)(${{[0-9]+}})
330 store double %call, double* @yd, align 8
334 ; Function Attrs: nounwind
335 declare double @log2(double) #0
337 ; Function Attrs: nounwind
338 define void @foo25() #0 {
340 %0 = load float* @x, align 4
341 %call = call float @exp2f(float %0) #3
342 ;pic: lw ${{[0-9]+}}, %call16(exp2f)(${{[0-9]+}})
343 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_sf_1)(${{[0-9]+}})
344 store float %call, float* @y, align 4
348 ; Function Attrs: nounwind
349 declare float @exp2f(float) #0
351 ; Function Attrs: nounwind
352 define void @foo26() #0 {
354 %0 = load double* @xd, align 8
355 %call = call double @exp2(double %0) #3
356 ;pic: lw ${{[0-9]+}}, %call16(exp2)(${{[0-9]+}})
357 ;pic: lw ${{[0-9]+}}, %got(__mips16_call_stub_df_2)(${{[0-9]+}})
358 store double %call, double* @yd, align 8
362 ; Function Attrs: nounwind
363 declare double @exp2(double) #0
365 attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="true" }
366 attributes #1 = { nounwind readnone "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="true" }
367 attributes #2 = { nounwind readnone }
368 attributes #3 = { nounwind }