1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -global-isel -mattr=+d \
3 ; RUN: -target-abi=ilp32d \
4 ; RUN: | FileCheck -check-prefixes=CHECKIFD,RV32IFD %s
5 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -global-isel -mattr=+d \
6 ; RUN: -target-abi=lp64d \
7 ; RUN: | FileCheck -check-prefixes=CHECKIFD,RV64IFD %s
8 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -global-isel \
9 ; RUN: | FileCheck -check-prefix=RV32I %s
10 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -global-isel \
11 ; RUN: | FileCheck -check-prefix=RV64I %s
13 declare double @llvm.sqrt.f64(double)
15 define double @sqrt_f64(double %a) nounwind {
16 ; CHECKIFD-LABEL: sqrt_f64:
18 ; CHECKIFD-NEXT: fsqrt.d fa0, fa0
21 ; RV32I-LABEL: sqrt_f64:
23 ; RV32I-NEXT: addi sp, sp, -16
24 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
25 ; RV32I-NEXT: call sqrt
26 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
27 ; RV32I-NEXT: addi sp, sp, 16
30 ; RV64I-LABEL: sqrt_f64:
32 ; RV64I-NEXT: addi sp, sp, -16
33 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
34 ; RV64I-NEXT: call sqrt
35 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
36 ; RV64I-NEXT: addi sp, sp, 16
38 %1 = call double @llvm.sqrt.f64(double %a)
42 define double @powi_f64(double %a, i32 %b) nounwind {
43 ; RV32IFD-LABEL: powi_f64:
45 ; RV32IFD-NEXT: addi sp, sp, -16
46 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
47 ; RV32IFD-NEXT: call __powidf2
48 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
49 ; RV32IFD-NEXT: addi sp, sp, 16
52 ; RV64IFD-LABEL: powi_f64:
54 ; RV64IFD-NEXT: addi sp, sp, -16
55 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
56 ; RV64IFD-NEXT: sext.w a0, a0
57 ; RV64IFD-NEXT: call __powidf2
58 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
59 ; RV64IFD-NEXT: addi sp, sp, 16
62 ; RV32I-LABEL: powi_f64:
64 ; RV32I-NEXT: addi sp, sp, -16
65 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
66 ; RV32I-NEXT: call __powidf2
67 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
68 ; RV32I-NEXT: addi sp, sp, 16
71 ; RV64I-LABEL: powi_f64:
73 ; RV64I-NEXT: addi sp, sp, -16
74 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
75 ; RV64I-NEXT: sext.w a1, a1
76 ; RV64I-NEXT: call __powidf2
77 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
78 ; RV64I-NEXT: addi sp, sp, 16
80 %1 = call double @llvm.powi.f64.i32(double %a, i32 %b)
84 declare double @llvm.sin.f64(double)
86 define double @sin_f64(double %a) nounwind {
87 ; RV32IFD-LABEL: sin_f64:
89 ; RV32IFD-NEXT: addi sp, sp, -16
90 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
91 ; RV32IFD-NEXT: call sin
92 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
93 ; RV32IFD-NEXT: addi sp, sp, 16
96 ; RV64IFD-LABEL: sin_f64:
98 ; RV64IFD-NEXT: addi sp, sp, -16
99 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
100 ; RV64IFD-NEXT: call sin
101 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
102 ; RV64IFD-NEXT: addi sp, sp, 16
105 ; RV32I-LABEL: sin_f64:
107 ; RV32I-NEXT: addi sp, sp, -16
108 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
109 ; RV32I-NEXT: call sin
110 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
111 ; RV32I-NEXT: addi sp, sp, 16
114 ; RV64I-LABEL: sin_f64:
116 ; RV64I-NEXT: addi sp, sp, -16
117 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
118 ; RV64I-NEXT: call sin
119 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
120 ; RV64I-NEXT: addi sp, sp, 16
122 %1 = call double @llvm.sin.f64(double %a)
126 declare double @llvm.cos.f64(double)
128 define double @cos_f64(double %a) nounwind {
129 ; RV32IFD-LABEL: cos_f64:
131 ; RV32IFD-NEXT: addi sp, sp, -16
132 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
133 ; RV32IFD-NEXT: call cos
134 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
135 ; RV32IFD-NEXT: addi sp, sp, 16
138 ; RV64IFD-LABEL: cos_f64:
140 ; RV64IFD-NEXT: addi sp, sp, -16
141 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
142 ; RV64IFD-NEXT: call cos
143 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
144 ; RV64IFD-NEXT: addi sp, sp, 16
147 ; RV32I-LABEL: cos_f64:
149 ; RV32I-NEXT: addi sp, sp, -16
150 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
151 ; RV32I-NEXT: call cos
152 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
153 ; RV32I-NEXT: addi sp, sp, 16
156 ; RV64I-LABEL: cos_f64:
158 ; RV64I-NEXT: addi sp, sp, -16
159 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
160 ; RV64I-NEXT: call cos
161 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
162 ; RV64I-NEXT: addi sp, sp, 16
164 %1 = call double @llvm.cos.f64(double %a)
168 ; The sin+cos combination results in an FSINCOS SelectionDAG node.
169 define double @sincos_f64(double %a) nounwind {
170 ; RV32IFD-LABEL: sincos_f64:
172 ; RV32IFD-NEXT: addi sp, sp, -32
173 ; RV32IFD-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
174 ; RV32IFD-NEXT: fsd fs0, 16(sp) # 8-byte Folded Spill
175 ; RV32IFD-NEXT: fsd fs1, 8(sp) # 8-byte Folded Spill
176 ; RV32IFD-NEXT: fmv.d fs0, fa0
177 ; RV32IFD-NEXT: call sin
178 ; RV32IFD-NEXT: fmv.d fs1, fa0
179 ; RV32IFD-NEXT: fmv.d fa0, fs0
180 ; RV32IFD-NEXT: call cos
181 ; RV32IFD-NEXT: fadd.d fa0, fs1, fa0
182 ; RV32IFD-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
183 ; RV32IFD-NEXT: fld fs0, 16(sp) # 8-byte Folded Reload
184 ; RV32IFD-NEXT: fld fs1, 8(sp) # 8-byte Folded Reload
185 ; RV32IFD-NEXT: addi sp, sp, 32
188 ; RV64IFD-LABEL: sincos_f64:
190 ; RV64IFD-NEXT: addi sp, sp, -32
191 ; RV64IFD-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
192 ; RV64IFD-NEXT: fsd fs0, 16(sp) # 8-byte Folded Spill
193 ; RV64IFD-NEXT: fsd fs1, 8(sp) # 8-byte Folded Spill
194 ; RV64IFD-NEXT: fmv.d fs0, fa0
195 ; RV64IFD-NEXT: call sin
196 ; RV64IFD-NEXT: fmv.d fs1, fa0
197 ; RV64IFD-NEXT: fmv.d fa0, fs0
198 ; RV64IFD-NEXT: call cos
199 ; RV64IFD-NEXT: fadd.d fa0, fs1, fa0
200 ; RV64IFD-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
201 ; RV64IFD-NEXT: fld fs0, 16(sp) # 8-byte Folded Reload
202 ; RV64IFD-NEXT: fld fs1, 8(sp) # 8-byte Folded Reload
203 ; RV64IFD-NEXT: addi sp, sp, 32
206 ; RV32I-LABEL: sincos_f64:
208 ; RV32I-NEXT: addi sp, sp, -32
209 ; RV32I-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
210 ; RV32I-NEXT: sw s0, 24(sp) # 4-byte Folded Spill
211 ; RV32I-NEXT: sw s1, 20(sp) # 4-byte Folded Spill
212 ; RV32I-NEXT: sw s2, 16(sp) # 4-byte Folded Spill
213 ; RV32I-NEXT: sw s3, 12(sp) # 4-byte Folded Spill
214 ; RV32I-NEXT: mv s0, a0
215 ; RV32I-NEXT: mv s1, a1
216 ; RV32I-NEXT: call sin
217 ; RV32I-NEXT: mv s2, a0
218 ; RV32I-NEXT: mv s3, a1
219 ; RV32I-NEXT: mv a0, s0
220 ; RV32I-NEXT: mv a1, s1
221 ; RV32I-NEXT: call cos
222 ; RV32I-NEXT: mv a2, a0
223 ; RV32I-NEXT: mv a3, a1
224 ; RV32I-NEXT: mv a0, s2
225 ; RV32I-NEXT: mv a1, s3
226 ; RV32I-NEXT: call __adddf3
227 ; RV32I-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
228 ; RV32I-NEXT: lw s0, 24(sp) # 4-byte Folded Reload
229 ; RV32I-NEXT: lw s1, 20(sp) # 4-byte Folded Reload
230 ; RV32I-NEXT: lw s2, 16(sp) # 4-byte Folded Reload
231 ; RV32I-NEXT: lw s3, 12(sp) # 4-byte Folded Reload
232 ; RV32I-NEXT: addi sp, sp, 32
235 ; RV64I-LABEL: sincos_f64:
237 ; RV64I-NEXT: addi sp, sp, -32
238 ; RV64I-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
239 ; RV64I-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
240 ; RV64I-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
241 ; RV64I-NEXT: mv s0, a0
242 ; RV64I-NEXT: call sin
243 ; RV64I-NEXT: mv s1, a0
244 ; RV64I-NEXT: mv a0, s0
245 ; RV64I-NEXT: call cos
246 ; RV64I-NEXT: mv a1, a0
247 ; RV64I-NEXT: mv a0, s1
248 ; RV64I-NEXT: call __adddf3
249 ; RV64I-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
250 ; RV64I-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
251 ; RV64I-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
252 ; RV64I-NEXT: addi sp, sp, 32
254 %1 = call double @llvm.sin.f64(double %a)
255 %2 = call double @llvm.cos.f64(double %a)
256 %3 = fadd double %1, %2
260 declare double @llvm.pow.f64(double, double)
262 define double @pow_f64(double %a, double %b) nounwind {
263 ; RV32IFD-LABEL: pow_f64:
265 ; RV32IFD-NEXT: addi sp, sp, -16
266 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
267 ; RV32IFD-NEXT: call pow
268 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
269 ; RV32IFD-NEXT: addi sp, sp, 16
272 ; RV64IFD-LABEL: pow_f64:
274 ; RV64IFD-NEXT: addi sp, sp, -16
275 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
276 ; RV64IFD-NEXT: call pow
277 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
278 ; RV64IFD-NEXT: addi sp, sp, 16
281 ; RV32I-LABEL: pow_f64:
283 ; RV32I-NEXT: addi sp, sp, -16
284 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
285 ; RV32I-NEXT: call pow
286 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
287 ; RV32I-NEXT: addi sp, sp, 16
290 ; RV64I-LABEL: pow_f64:
292 ; RV64I-NEXT: addi sp, sp, -16
293 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
294 ; RV64I-NEXT: call pow
295 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
296 ; RV64I-NEXT: addi sp, sp, 16
298 %1 = call double @llvm.pow.f64(double %a, double %b)
302 declare double @llvm.exp.f64(double)
304 define double @exp_f64(double %a) nounwind {
305 ; RV32IFD-LABEL: exp_f64:
307 ; RV32IFD-NEXT: addi sp, sp, -16
308 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
309 ; RV32IFD-NEXT: call exp
310 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
311 ; RV32IFD-NEXT: addi sp, sp, 16
314 ; RV64IFD-LABEL: exp_f64:
316 ; RV64IFD-NEXT: addi sp, sp, -16
317 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
318 ; RV64IFD-NEXT: call exp
319 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
320 ; RV64IFD-NEXT: addi sp, sp, 16
323 ; RV32I-LABEL: exp_f64:
325 ; RV32I-NEXT: addi sp, sp, -16
326 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
327 ; RV32I-NEXT: call exp
328 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
329 ; RV32I-NEXT: addi sp, sp, 16
332 ; RV64I-LABEL: exp_f64:
334 ; RV64I-NEXT: addi sp, sp, -16
335 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
336 ; RV64I-NEXT: call exp
337 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
338 ; RV64I-NEXT: addi sp, sp, 16
340 %1 = call double @llvm.exp.f64(double %a)
344 declare double @llvm.exp2.f64(double)
346 define double @exp2_f64(double %a) nounwind {
347 ; RV32IFD-LABEL: exp2_f64:
349 ; RV32IFD-NEXT: addi sp, sp, -16
350 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
351 ; RV32IFD-NEXT: call exp2
352 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
353 ; RV32IFD-NEXT: addi sp, sp, 16
356 ; RV64IFD-LABEL: exp2_f64:
358 ; RV64IFD-NEXT: addi sp, sp, -16
359 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
360 ; RV64IFD-NEXT: call exp2
361 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
362 ; RV64IFD-NEXT: addi sp, sp, 16
365 ; RV32I-LABEL: exp2_f64:
367 ; RV32I-NEXT: addi sp, sp, -16
368 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
369 ; RV32I-NEXT: call exp2
370 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
371 ; RV32I-NEXT: addi sp, sp, 16
374 ; RV64I-LABEL: exp2_f64:
376 ; RV64I-NEXT: addi sp, sp, -16
377 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
378 ; RV64I-NEXT: call exp2
379 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
380 ; RV64I-NEXT: addi sp, sp, 16
382 %1 = call double @llvm.exp2.f64(double %a)
386 define double @exp10_f64(double %a) nounwind {
387 ; RV32IFD-LABEL: exp10_f64:
389 ; RV32IFD-NEXT: addi sp, sp, -16
390 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
391 ; RV32IFD-NEXT: call exp10
392 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
393 ; RV32IFD-NEXT: addi sp, sp, 16
396 ; RV64IFD-LABEL: exp10_f64:
398 ; RV64IFD-NEXT: addi sp, sp, -16
399 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
400 ; RV64IFD-NEXT: call exp10
401 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
402 ; RV64IFD-NEXT: addi sp, sp, 16
405 ; RV32I-LABEL: exp10_f64:
407 ; RV32I-NEXT: addi sp, sp, -16
408 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
409 ; RV32I-NEXT: call exp10
410 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
411 ; RV32I-NEXT: addi sp, sp, 16
414 ; RV64I-LABEL: exp10_f64:
416 ; RV64I-NEXT: addi sp, sp, -16
417 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
418 ; RV64I-NEXT: call exp10
419 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
420 ; RV64I-NEXT: addi sp, sp, 16
422 %1 = call double @llvm.exp10.f64(double %a)
426 declare double @llvm.log.f64(double)
428 define double @log_f64(double %a) nounwind {
429 ; RV32IFD-LABEL: log_f64:
431 ; RV32IFD-NEXT: addi sp, sp, -16
432 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
433 ; RV32IFD-NEXT: call log
434 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
435 ; RV32IFD-NEXT: addi sp, sp, 16
438 ; RV64IFD-LABEL: log_f64:
440 ; RV64IFD-NEXT: addi sp, sp, -16
441 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
442 ; RV64IFD-NEXT: call log
443 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
444 ; RV64IFD-NEXT: addi sp, sp, 16
447 ; RV32I-LABEL: log_f64:
449 ; RV32I-NEXT: addi sp, sp, -16
450 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
451 ; RV32I-NEXT: call log
452 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
453 ; RV32I-NEXT: addi sp, sp, 16
456 ; RV64I-LABEL: log_f64:
458 ; RV64I-NEXT: addi sp, sp, -16
459 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
460 ; RV64I-NEXT: call log
461 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
462 ; RV64I-NEXT: addi sp, sp, 16
464 %1 = call double @llvm.log.f64(double %a)
468 declare double @llvm.log10.f64(double)
470 define double @log10_f64(double %a) nounwind {
471 ; RV32IFD-LABEL: log10_f64:
473 ; RV32IFD-NEXT: addi sp, sp, -16
474 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
475 ; RV32IFD-NEXT: call log10
476 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
477 ; RV32IFD-NEXT: addi sp, sp, 16
480 ; RV64IFD-LABEL: log10_f64:
482 ; RV64IFD-NEXT: addi sp, sp, -16
483 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
484 ; RV64IFD-NEXT: call log10
485 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
486 ; RV64IFD-NEXT: addi sp, sp, 16
489 ; RV32I-LABEL: log10_f64:
491 ; RV32I-NEXT: addi sp, sp, -16
492 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
493 ; RV32I-NEXT: call log10
494 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
495 ; RV32I-NEXT: addi sp, sp, 16
498 ; RV64I-LABEL: log10_f64:
500 ; RV64I-NEXT: addi sp, sp, -16
501 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
502 ; RV64I-NEXT: call log10
503 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
504 ; RV64I-NEXT: addi sp, sp, 16
506 %1 = call double @llvm.log10.f64(double %a)
510 declare double @llvm.log2.f64(double)
512 define double @log2_f64(double %a) nounwind {
513 ; RV32IFD-LABEL: log2_f64:
515 ; RV32IFD-NEXT: addi sp, sp, -16
516 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
517 ; RV32IFD-NEXT: call log2
518 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
519 ; RV32IFD-NEXT: addi sp, sp, 16
522 ; RV64IFD-LABEL: log2_f64:
524 ; RV64IFD-NEXT: addi sp, sp, -16
525 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
526 ; RV64IFD-NEXT: call log2
527 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
528 ; RV64IFD-NEXT: addi sp, sp, 16
531 ; RV32I-LABEL: log2_f64:
533 ; RV32I-NEXT: addi sp, sp, -16
534 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
535 ; RV32I-NEXT: call log2
536 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
537 ; RV32I-NEXT: addi sp, sp, 16
540 ; RV64I-LABEL: log2_f64:
542 ; RV64I-NEXT: addi sp, sp, -16
543 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
544 ; RV64I-NEXT: call log2
545 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
546 ; RV64I-NEXT: addi sp, sp, 16
548 %1 = call double @llvm.log2.f64(double %a)
552 declare double @llvm.fma.f64(double, double, double)
554 define double @fma_f64(double %a, double %b, double %c) nounwind {
555 ; CHECKIFD-LABEL: fma_f64:
557 ; CHECKIFD-NEXT: fmadd.d fa0, fa0, fa1, fa2
560 ; RV32I-LABEL: fma_f64:
562 ; RV32I-NEXT: addi sp, sp, -16
563 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
564 ; RV32I-NEXT: call fma
565 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
566 ; RV32I-NEXT: addi sp, sp, 16
569 ; RV64I-LABEL: fma_f64:
571 ; RV64I-NEXT: addi sp, sp, -16
572 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
573 ; RV64I-NEXT: call fma
574 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
575 ; RV64I-NEXT: addi sp, sp, 16
577 %1 = call double @llvm.fma.f64(double %a, double %b, double %c)
581 declare double @llvm.fmuladd.f64(double, double, double)
583 define double @fmuladd_f64(double %a, double %b, double %c) nounwind {
584 ; CHECKIFD-LABEL: fmuladd_f64:
586 ; CHECKIFD-NEXT: fmadd.d fa0, fa0, fa1, fa2
589 ; RV32I-LABEL: fmuladd_f64:
591 ; RV32I-NEXT: addi sp, sp, -16
592 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
593 ; RV32I-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
594 ; RV32I-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
595 ; RV32I-NEXT: mv s0, a4
596 ; RV32I-NEXT: mv s1, a5
597 ; RV32I-NEXT: call __muldf3
598 ; RV32I-NEXT: mv a2, s0
599 ; RV32I-NEXT: mv a3, s1
600 ; RV32I-NEXT: call __adddf3
601 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
602 ; RV32I-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
603 ; RV32I-NEXT: lw s1, 4(sp) # 4-byte Folded Reload
604 ; RV32I-NEXT: addi sp, sp, 16
607 ; RV64I-LABEL: fmuladd_f64:
609 ; RV64I-NEXT: addi sp, sp, -16
610 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
611 ; RV64I-NEXT: sd s0, 0(sp) # 8-byte Folded Spill
612 ; RV64I-NEXT: mv s0, a2
613 ; RV64I-NEXT: call __muldf3
614 ; RV64I-NEXT: mv a1, s0
615 ; RV64I-NEXT: call __adddf3
616 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
617 ; RV64I-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
618 ; RV64I-NEXT: addi sp, sp, 16
620 %1 = call double @llvm.fmuladd.f64(double %a, double %b, double %c)
624 declare double @llvm.fabs.f64(double)
626 define double @fabs_f64(double %a) nounwind {
627 ; CHECKIFD-LABEL: fabs_f64:
629 ; CHECKIFD-NEXT: fabs.d fa0, fa0
632 ; RV32I-LABEL: fabs_f64:
634 ; RV32I-NEXT: slli a1, a1, 1
635 ; RV32I-NEXT: srli a1, a1, 1
638 ; RV64I-LABEL: fabs_f64:
640 ; RV64I-NEXT: slli a0, a0, 1
641 ; RV64I-NEXT: srli a0, a0, 1
643 %1 = call double @llvm.fabs.f64(double %a)
647 declare double @llvm.minnum.f64(double, double)
649 define double @minnum_f64(double %a, double %b) nounwind {
650 ; CHECKIFD-LABEL: minnum_f64:
652 ; CHECKIFD-NEXT: fmin.d fa0, fa0, fa1
655 ; RV32I-LABEL: minnum_f64:
657 ; RV32I-NEXT: addi sp, sp, -16
658 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
659 ; RV32I-NEXT: call fmin
660 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
661 ; RV32I-NEXT: addi sp, sp, 16
664 ; RV64I-LABEL: minnum_f64:
666 ; RV64I-NEXT: addi sp, sp, -16
667 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
668 ; RV64I-NEXT: call fmin
669 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
670 ; RV64I-NEXT: addi sp, sp, 16
672 %1 = call double @llvm.minnum.f64(double %a, double %b)
676 declare double @llvm.maxnum.f64(double, double)
678 define double @maxnum_f64(double %a, double %b) nounwind {
679 ; CHECKIFD-LABEL: maxnum_f64:
681 ; CHECKIFD-NEXT: fmax.d fa0, fa0, fa1
684 ; RV32I-LABEL: maxnum_f64:
686 ; RV32I-NEXT: addi sp, sp, -16
687 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
688 ; RV32I-NEXT: call fmax
689 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
690 ; RV32I-NEXT: addi sp, sp, 16
693 ; RV64I-LABEL: maxnum_f64:
695 ; RV64I-NEXT: addi sp, sp, -16
696 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
697 ; RV64I-NEXT: call fmax
698 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
699 ; RV64I-NEXT: addi sp, sp, 16
701 %1 = call double @llvm.maxnum.f64(double %a, double %b)
705 declare double @llvm.copysign.f64(double, double)
707 define double @copysign_f64(double %a, double %b) nounwind {
708 ; CHECKIFD-LABEL: copysign_f64:
710 ; CHECKIFD-NEXT: fsgnj.d fa0, fa0, fa1
713 ; RV32I-LABEL: copysign_f64:
715 ; RV32I-NEXT: lui a2, 524288
716 ; RV32I-NEXT: slli a1, a1, 1
717 ; RV32I-NEXT: srli a1, a1, 1
718 ; RV32I-NEXT: and a2, a3, a2
719 ; RV32I-NEXT: or a1, a1, a2
722 ; RV64I-LABEL: copysign_f64:
724 ; RV64I-NEXT: slli a0, a0, 1
725 ; RV64I-NEXT: srli a1, a1, 63
726 ; RV64I-NEXT: srli a0, a0, 1
727 ; RV64I-NEXT: slli a1, a1, 63
728 ; RV64I-NEXT: or a0, a0, a1
730 %1 = call double @llvm.copysign.f64(double %a, double %b)
734 declare double @llvm.floor.f64(double)
736 define double @floor_f64(double %a) nounwind {
737 ; RV32IFD-LABEL: floor_f64:
739 ; RV32IFD-NEXT: addi sp, sp, -16
740 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
741 ; RV32IFD-NEXT: call floor
742 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
743 ; RV32IFD-NEXT: addi sp, sp, 16
746 ; RV64IFD-LABEL: floor_f64:
748 ; RV64IFD-NEXT: addi sp, sp, -16
749 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
750 ; RV64IFD-NEXT: call floor
751 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
752 ; RV64IFD-NEXT: addi sp, sp, 16
755 ; RV32I-LABEL: floor_f64:
757 ; RV32I-NEXT: addi sp, sp, -16
758 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
759 ; RV32I-NEXT: call floor
760 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
761 ; RV32I-NEXT: addi sp, sp, 16
764 ; RV64I-LABEL: floor_f64:
766 ; RV64I-NEXT: addi sp, sp, -16
767 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
768 ; RV64I-NEXT: call floor
769 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
770 ; RV64I-NEXT: addi sp, sp, 16
772 %1 = call double @llvm.floor.f64(double %a)
776 declare double @llvm.ceil.f64(double)
778 define double @ceil_f64(double %a) nounwind {
779 ; RV32IFD-LABEL: ceil_f64:
781 ; RV32IFD-NEXT: addi sp, sp, -16
782 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
783 ; RV32IFD-NEXT: call ceil
784 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
785 ; RV32IFD-NEXT: addi sp, sp, 16
788 ; RV64IFD-LABEL: ceil_f64:
790 ; RV64IFD-NEXT: addi sp, sp, -16
791 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
792 ; RV64IFD-NEXT: call ceil
793 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
794 ; RV64IFD-NEXT: addi sp, sp, 16
797 ; RV32I-LABEL: ceil_f64:
799 ; RV32I-NEXT: addi sp, sp, -16
800 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
801 ; RV32I-NEXT: call ceil
802 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
803 ; RV32I-NEXT: addi sp, sp, 16
806 ; RV64I-LABEL: ceil_f64:
808 ; RV64I-NEXT: addi sp, sp, -16
809 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
810 ; RV64I-NEXT: call ceil
811 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
812 ; RV64I-NEXT: addi sp, sp, 16
814 %1 = call double @llvm.ceil.f64(double %a)
818 declare double @llvm.trunc.f64(double)
820 define double @trunc_f64(double %a) nounwind {
821 ; RV32IFD-LABEL: trunc_f64:
823 ; RV32IFD-NEXT: addi sp, sp, -16
824 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
825 ; RV32IFD-NEXT: call trunc
826 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
827 ; RV32IFD-NEXT: addi sp, sp, 16
830 ; RV64IFD-LABEL: trunc_f64:
832 ; RV64IFD-NEXT: addi sp, sp, -16
833 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
834 ; RV64IFD-NEXT: call trunc
835 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
836 ; RV64IFD-NEXT: addi sp, sp, 16
839 ; RV32I-LABEL: trunc_f64:
841 ; RV32I-NEXT: addi sp, sp, -16
842 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
843 ; RV32I-NEXT: call trunc
844 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
845 ; RV32I-NEXT: addi sp, sp, 16
848 ; RV64I-LABEL: trunc_f64:
850 ; RV64I-NEXT: addi sp, sp, -16
851 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
852 ; RV64I-NEXT: call trunc
853 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
854 ; RV64I-NEXT: addi sp, sp, 16
856 %1 = call double @llvm.trunc.f64(double %a)
860 declare double @llvm.rint.f64(double)
862 define double @rint_f64(double %a) nounwind {
863 ; RV32IFD-LABEL: rint_f64:
865 ; RV32IFD-NEXT: addi sp, sp, -16
866 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
867 ; RV32IFD-NEXT: call rint
868 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
869 ; RV32IFD-NEXT: addi sp, sp, 16
872 ; RV64IFD-LABEL: rint_f64:
874 ; RV64IFD-NEXT: addi sp, sp, -16
875 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
876 ; RV64IFD-NEXT: call rint
877 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
878 ; RV64IFD-NEXT: addi sp, sp, 16
881 ; RV32I-LABEL: rint_f64:
883 ; RV32I-NEXT: addi sp, sp, -16
884 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
885 ; RV32I-NEXT: call rint
886 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
887 ; RV32I-NEXT: addi sp, sp, 16
890 ; RV64I-LABEL: rint_f64:
892 ; RV64I-NEXT: addi sp, sp, -16
893 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
894 ; RV64I-NEXT: call rint
895 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
896 ; RV64I-NEXT: addi sp, sp, 16
898 %1 = call double @llvm.rint.f64(double %a)
902 declare double @llvm.nearbyint.f64(double)
904 define double @nearbyint_f64(double %a) nounwind {
905 ; RV32IFD-LABEL: nearbyint_f64:
907 ; RV32IFD-NEXT: addi sp, sp, -16
908 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
909 ; RV32IFD-NEXT: call nearbyint
910 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
911 ; RV32IFD-NEXT: addi sp, sp, 16
914 ; RV64IFD-LABEL: nearbyint_f64:
916 ; RV64IFD-NEXT: addi sp, sp, -16
917 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
918 ; RV64IFD-NEXT: call nearbyint
919 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
920 ; RV64IFD-NEXT: addi sp, sp, 16
923 ; RV32I-LABEL: nearbyint_f64:
925 ; RV32I-NEXT: addi sp, sp, -16
926 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
927 ; RV32I-NEXT: call nearbyint
928 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
929 ; RV32I-NEXT: addi sp, sp, 16
932 ; RV64I-LABEL: nearbyint_f64:
934 ; RV64I-NEXT: addi sp, sp, -16
935 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
936 ; RV64I-NEXT: call nearbyint
937 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
938 ; RV64I-NEXT: addi sp, sp, 16
940 %1 = call double @llvm.nearbyint.f64(double %a)
944 declare double @llvm.round.f64(double)
946 define double @round_f64(double %a) nounwind {
947 ; RV32IFD-LABEL: round_f64:
949 ; RV32IFD-NEXT: addi sp, sp, -16
950 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
951 ; RV32IFD-NEXT: call round
952 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
953 ; RV32IFD-NEXT: addi sp, sp, 16
956 ; RV64IFD-LABEL: round_f64:
958 ; RV64IFD-NEXT: addi sp, sp, -16
959 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
960 ; RV64IFD-NEXT: call round
961 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
962 ; RV64IFD-NEXT: addi sp, sp, 16
965 ; RV32I-LABEL: round_f64:
967 ; RV32I-NEXT: addi sp, sp, -16
968 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
969 ; RV32I-NEXT: call round
970 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
971 ; RV32I-NEXT: addi sp, sp, 16
974 ; RV64I-LABEL: round_f64:
976 ; RV64I-NEXT: addi sp, sp, -16
977 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
978 ; RV64I-NEXT: call round
979 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
980 ; RV64I-NEXT: addi sp, sp, 16
982 %1 = call double @llvm.round.f64(double %a)
986 declare double @llvm.roundeven.f64(double)
988 define double @roundeven_f64(double %a) nounwind {
989 ; RV32IFD-LABEL: roundeven_f64:
991 ; RV32IFD-NEXT: addi sp, sp, -16
992 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
993 ; RV32IFD-NEXT: call roundeven
994 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
995 ; RV32IFD-NEXT: addi sp, sp, 16
998 ; RV64IFD-LABEL: roundeven_f64:
1000 ; RV64IFD-NEXT: addi sp, sp, -16
1001 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1002 ; RV64IFD-NEXT: call roundeven
1003 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1004 ; RV64IFD-NEXT: addi sp, sp, 16
1007 ; RV32I-LABEL: roundeven_f64:
1009 ; RV32I-NEXT: addi sp, sp, -16
1010 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1011 ; RV32I-NEXT: call roundeven
1012 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1013 ; RV32I-NEXT: addi sp, sp, 16
1016 ; RV64I-LABEL: roundeven_f64:
1018 ; RV64I-NEXT: addi sp, sp, -16
1019 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1020 ; RV64I-NEXT: call roundeven
1021 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1022 ; RV64I-NEXT: addi sp, sp, 16
1024 %1 = call double @llvm.roundeven.f64(double %a)
1028 declare i1 @llvm.is.fpclass.f64(double, i32)
1029 define i1 @isnan_d_fpclass(double %x) {
1030 ; CHECKIFD-LABEL: isnan_d_fpclass:
1031 ; CHECKIFD: # %bb.0:
1032 ; CHECKIFD-NEXT: fclass.d a0, fa0
1033 ; CHECKIFD-NEXT: andi a0, a0, 768
1034 ; CHECKIFD-NEXT: snez a0, a0
1035 ; CHECKIFD-NEXT: ret
1037 ; RV32I-LABEL: isnan_d_fpclass:
1039 ; RV32I-NEXT: lui a2, 524032
1040 ; RV32I-NEXT: slli a1, a1, 1
1041 ; RV32I-NEXT: srli a1, a1, 1
1042 ; RV32I-NEXT: beq a1, a2, .LBB25_2
1043 ; RV32I-NEXT: # %bb.1:
1044 ; RV32I-NEXT: sltu a0, a2, a1
1046 ; RV32I-NEXT: .LBB25_2:
1047 ; RV32I-NEXT: snez a0, a0
1050 ; RV64I-LABEL: isnan_d_fpclass:
1052 ; RV64I-NEXT: li a1, 2047
1053 ; RV64I-NEXT: slli a0, a0, 1
1054 ; RV64I-NEXT: slli a1, a1, 52
1055 ; RV64I-NEXT: srli a0, a0, 1
1056 ; RV64I-NEXT: sltu a0, a1, a0
1058 %1 = call i1 @llvm.is.fpclass.f64(double %x, i32 3) ; nan
1062 define double @tan_f64(double %a) nounwind {
1063 ; RV32IFD-LABEL: tan_f64:
1065 ; RV32IFD-NEXT: addi sp, sp, -16
1066 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1067 ; RV32IFD-NEXT: call tan
1068 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1069 ; RV32IFD-NEXT: addi sp, sp, 16
1072 ; RV64IFD-LABEL: tan_f64:
1074 ; RV64IFD-NEXT: addi sp, sp, -16
1075 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1076 ; RV64IFD-NEXT: call tan
1077 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1078 ; RV64IFD-NEXT: addi sp, sp, 16
1081 ; RV32I-LABEL: tan_f64:
1083 ; RV32I-NEXT: addi sp, sp, -16
1084 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1085 ; RV32I-NEXT: call tan
1086 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1087 ; RV32I-NEXT: addi sp, sp, 16
1090 ; RV64I-LABEL: tan_f64:
1092 ; RV64I-NEXT: addi sp, sp, -16
1093 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1094 ; RV64I-NEXT: call tan
1095 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1096 ; RV64I-NEXT: addi sp, sp, 16
1098 %1 = call double @llvm.tan.f64(double %a)
1102 define double @ldexp_double(double %x, i32 %y) nounwind {
1103 ; RV32IFD-LABEL: ldexp_double:
1105 ; RV32IFD-NEXT: addi sp, sp, -16
1106 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1107 ; RV32IFD-NEXT: call ldexp
1108 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1109 ; RV32IFD-NEXT: addi sp, sp, 16
1112 ; RV64IFD-LABEL: ldexp_double:
1114 ; RV64IFD-NEXT: addi sp, sp, -16
1115 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1116 ; RV64IFD-NEXT: sext.w a0, a0
1117 ; RV64IFD-NEXT: call ldexp
1118 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1119 ; RV64IFD-NEXT: addi sp, sp, 16
1122 ; RV32I-LABEL: ldexp_double:
1124 ; RV32I-NEXT: addi sp, sp, -16
1125 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1126 ; RV32I-NEXT: call ldexp
1127 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1128 ; RV32I-NEXT: addi sp, sp, 16
1131 ; RV64I-LABEL: ldexp_double:
1133 ; RV64I-NEXT: addi sp, sp, -16
1134 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1135 ; RV64I-NEXT: sext.w a1, a1
1136 ; RV64I-NEXT: call ldexp
1137 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1138 ; RV64I-NEXT: addi sp, sp, 16
1140 %z = call double @llvm.ldexp.f64.i32(double %x, i32 %y)
1144 define double @asin_f64(double %a) nounwind {
1145 ; RV32IFD-LABEL: asin_f64:
1147 ; RV32IFD-NEXT: addi sp, sp, -16
1148 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1149 ; RV32IFD-NEXT: call asin
1150 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1151 ; RV32IFD-NEXT: addi sp, sp, 16
1154 ; RV64IFD-LABEL: asin_f64:
1156 ; RV64IFD-NEXT: addi sp, sp, -16
1157 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1158 ; RV64IFD-NEXT: call asin
1159 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1160 ; RV64IFD-NEXT: addi sp, sp, 16
1163 ; RV32I-LABEL: asin_f64:
1165 ; RV32I-NEXT: addi sp, sp, -16
1166 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1167 ; RV32I-NEXT: call asin
1168 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1169 ; RV32I-NEXT: addi sp, sp, 16
1172 ; RV64I-LABEL: asin_f64:
1174 ; RV64I-NEXT: addi sp, sp, -16
1175 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1176 ; RV64I-NEXT: call asin
1177 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1178 ; RV64I-NEXT: addi sp, sp, 16
1180 %1 = call double @llvm.asin.f64(double %a)
1184 define double @acos_f64(double %a) nounwind {
1185 ; RV32IFD-LABEL: acos_f64:
1187 ; RV32IFD-NEXT: addi sp, sp, -16
1188 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1189 ; RV32IFD-NEXT: call acos
1190 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1191 ; RV32IFD-NEXT: addi sp, sp, 16
1194 ; RV64IFD-LABEL: acos_f64:
1196 ; RV64IFD-NEXT: addi sp, sp, -16
1197 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1198 ; RV64IFD-NEXT: call acos
1199 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1200 ; RV64IFD-NEXT: addi sp, sp, 16
1203 ; RV32I-LABEL: acos_f64:
1205 ; RV32I-NEXT: addi sp, sp, -16
1206 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1207 ; RV32I-NEXT: call acos
1208 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1209 ; RV32I-NEXT: addi sp, sp, 16
1212 ; RV64I-LABEL: acos_f64:
1214 ; RV64I-NEXT: addi sp, sp, -16
1215 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1216 ; RV64I-NEXT: call acos
1217 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1218 ; RV64I-NEXT: addi sp, sp, 16
1220 %1 = call double @llvm.acos.f64(double %a)
1224 define double @atan_f64(double %a) nounwind {
1225 ; RV32IFD-LABEL: atan_f64:
1227 ; RV32IFD-NEXT: addi sp, sp, -16
1228 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1229 ; RV32IFD-NEXT: call atan
1230 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1231 ; RV32IFD-NEXT: addi sp, sp, 16
1234 ; RV64IFD-LABEL: atan_f64:
1236 ; RV64IFD-NEXT: addi sp, sp, -16
1237 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1238 ; RV64IFD-NEXT: call atan
1239 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1240 ; RV64IFD-NEXT: addi sp, sp, 16
1243 ; RV32I-LABEL: atan_f64:
1245 ; RV32I-NEXT: addi sp, sp, -16
1246 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1247 ; RV32I-NEXT: call atan
1248 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1249 ; RV32I-NEXT: addi sp, sp, 16
1252 ; RV64I-LABEL: atan_f64:
1254 ; RV64I-NEXT: addi sp, sp, -16
1255 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1256 ; RV64I-NEXT: call atan
1257 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1258 ; RV64I-NEXT: addi sp, sp, 16
1260 %1 = call double @llvm.atan.f64(double %a)
1264 define double @atan2_f64(double %a, double %b) nounwind {
1265 ; RV32IFD-LABEL: atan2_f64:
1267 ; RV32IFD-NEXT: addi sp, sp, -16
1268 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1269 ; RV32IFD-NEXT: call atan2
1270 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1271 ; RV32IFD-NEXT: addi sp, sp, 16
1274 ; RV64IFD-LABEL: atan2_f64:
1276 ; RV64IFD-NEXT: addi sp, sp, -16
1277 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1278 ; RV64IFD-NEXT: call atan2
1279 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1280 ; RV64IFD-NEXT: addi sp, sp, 16
1283 ; RV32I-LABEL: atan2_f64:
1285 ; RV32I-NEXT: addi sp, sp, -16
1286 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1287 ; RV32I-NEXT: call atan2
1288 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1289 ; RV32I-NEXT: addi sp, sp, 16
1292 ; RV64I-LABEL: atan2_f64:
1294 ; RV64I-NEXT: addi sp, sp, -16
1295 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1296 ; RV64I-NEXT: call atan2
1297 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1298 ; RV64I-NEXT: addi sp, sp, 16
1300 %1 = call double @llvm.atan2.f64(double %a, double %b)
1304 define double @sinh_f64(double %a) nounwind {
1305 ; RV32IFD-LABEL: sinh_f64:
1307 ; RV32IFD-NEXT: addi sp, sp, -16
1308 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1309 ; RV32IFD-NEXT: call sinh
1310 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1311 ; RV32IFD-NEXT: addi sp, sp, 16
1314 ; RV64IFD-LABEL: sinh_f64:
1316 ; RV64IFD-NEXT: addi sp, sp, -16
1317 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1318 ; RV64IFD-NEXT: call sinh
1319 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1320 ; RV64IFD-NEXT: addi sp, sp, 16
1323 ; RV32I-LABEL: sinh_f64:
1325 ; RV32I-NEXT: addi sp, sp, -16
1326 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1327 ; RV32I-NEXT: call sinh
1328 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1329 ; RV32I-NEXT: addi sp, sp, 16
1332 ; RV64I-LABEL: sinh_f64:
1334 ; RV64I-NEXT: addi sp, sp, -16
1335 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1336 ; RV64I-NEXT: call sinh
1337 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1338 ; RV64I-NEXT: addi sp, sp, 16
1340 %1 = call double @llvm.sinh.f64(double %a)
1344 define double @cosh_f64(double %a) nounwind {
1345 ; RV32IFD-LABEL: cosh_f64:
1347 ; RV32IFD-NEXT: addi sp, sp, -16
1348 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1349 ; RV32IFD-NEXT: call cosh
1350 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1351 ; RV32IFD-NEXT: addi sp, sp, 16
1354 ; RV64IFD-LABEL: cosh_f64:
1356 ; RV64IFD-NEXT: addi sp, sp, -16
1357 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1358 ; RV64IFD-NEXT: call cosh
1359 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1360 ; RV64IFD-NEXT: addi sp, sp, 16
1363 ; RV32I-LABEL: cosh_f64:
1365 ; RV32I-NEXT: addi sp, sp, -16
1366 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1367 ; RV32I-NEXT: call cosh
1368 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1369 ; RV32I-NEXT: addi sp, sp, 16
1372 ; RV64I-LABEL: cosh_f64:
1374 ; RV64I-NEXT: addi sp, sp, -16
1375 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1376 ; RV64I-NEXT: call cosh
1377 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1378 ; RV64I-NEXT: addi sp, sp, 16
1380 %1 = call double @llvm.cosh.f64(double %a)
1384 define double @tanh_f64(double %a) nounwind {
1385 ; RV32IFD-LABEL: tanh_f64:
1387 ; RV32IFD-NEXT: addi sp, sp, -16
1388 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1389 ; RV32IFD-NEXT: call tanh
1390 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1391 ; RV32IFD-NEXT: addi sp, sp, 16
1394 ; RV64IFD-LABEL: tanh_f64:
1396 ; RV64IFD-NEXT: addi sp, sp, -16
1397 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1398 ; RV64IFD-NEXT: call tanh
1399 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1400 ; RV64IFD-NEXT: addi sp, sp, 16
1403 ; RV32I-LABEL: tanh_f64:
1405 ; RV32I-NEXT: addi sp, sp, -16
1406 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1407 ; RV32I-NEXT: call tanh
1408 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1409 ; RV32I-NEXT: addi sp, sp, 16
1412 ; RV64I-LABEL: tanh_f64:
1414 ; RV64I-NEXT: addi sp, sp, -16
1415 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1416 ; RV64I-NEXT: call tanh
1417 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1418 ; RV64I-NEXT: addi sp, sp, 16
1420 %1 = call double @llvm.tanh.f64(double %a)