1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d -verify-machineinstrs < %s \
3 ; RUN: | FileCheck -check-prefix=RV32IFD %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+d -verify-machineinstrs < %s \
5 ; RUN: | FileCheck -check-prefix=RV64IFD %s
7 declare double @llvm.sqrt.f64(double)
9 define double @sqrt_f64(double %a) nounwind {
10 ; RV32IFD-LABEL: sqrt_f64:
12 ; RV32IFD-NEXT: addi sp, sp, -16
13 ; RV32IFD-NEXT: sw a0, 8(sp)
14 ; RV32IFD-NEXT: sw a1, 12(sp)
15 ; RV32IFD-NEXT: fld ft0, 8(sp)
16 ; RV32IFD-NEXT: fsqrt.d ft0, ft0
17 ; RV32IFD-NEXT: fsd ft0, 8(sp)
18 ; RV32IFD-NEXT: lw a0, 8(sp)
19 ; RV32IFD-NEXT: lw a1, 12(sp)
20 ; RV32IFD-NEXT: addi sp, sp, 16
23 ; RV64IFD-LABEL: sqrt_f64:
25 ; RV64IFD-NEXT: fmv.d.x ft0, a0
26 ; RV64IFD-NEXT: fsqrt.d ft0, ft0
27 ; RV64IFD-NEXT: fmv.x.d a0, ft0
29 %1 = call double @llvm.sqrt.f64(double %a)
33 declare double @llvm.powi.f64(double, i32)
35 define double @powi_f64(double %a, i32 %b) nounwind {
36 ; RV32IFD-LABEL: powi_f64:
38 ; RV32IFD-NEXT: addi sp, sp, -16
39 ; RV32IFD-NEXT: sw ra, 12(sp)
40 ; RV32IFD-NEXT: call __powidf2
41 ; RV32IFD-NEXT: lw ra, 12(sp)
42 ; RV32IFD-NEXT: addi sp, sp, 16
45 ; RV64IFD-LABEL: powi_f64:
47 ; RV64IFD-NEXT: addi sp, sp, -16
48 ; RV64IFD-NEXT: sd ra, 8(sp)
49 ; RV64IFD-NEXT: sext.w a1, a1
50 ; RV64IFD-NEXT: call __powidf2
51 ; RV64IFD-NEXT: ld ra, 8(sp)
52 ; RV64IFD-NEXT: addi sp, sp, 16
54 %1 = call double @llvm.powi.f64(double %a, i32 %b)
58 declare double @llvm.sin.f64(double)
60 define double @sin_f64(double %a) nounwind {
61 ; RV32IFD-LABEL: sin_f64:
63 ; RV32IFD-NEXT: addi sp, sp, -16
64 ; RV32IFD-NEXT: sw ra, 12(sp)
65 ; RV32IFD-NEXT: call sin
66 ; RV32IFD-NEXT: lw ra, 12(sp)
67 ; RV32IFD-NEXT: addi sp, sp, 16
70 ; RV64IFD-LABEL: sin_f64:
72 ; RV64IFD-NEXT: addi sp, sp, -16
73 ; RV64IFD-NEXT: sd ra, 8(sp)
74 ; RV64IFD-NEXT: call sin
75 ; RV64IFD-NEXT: ld ra, 8(sp)
76 ; RV64IFD-NEXT: addi sp, sp, 16
78 %1 = call double @llvm.sin.f64(double %a)
82 declare double @llvm.cos.f64(double)
84 define double @cos_f64(double %a) nounwind {
85 ; RV32IFD-LABEL: cos_f64:
87 ; RV32IFD-NEXT: addi sp, sp, -16
88 ; RV32IFD-NEXT: sw ra, 12(sp)
89 ; RV32IFD-NEXT: call cos
90 ; RV32IFD-NEXT: lw ra, 12(sp)
91 ; RV32IFD-NEXT: addi sp, sp, 16
94 ; RV64IFD-LABEL: cos_f64:
96 ; RV64IFD-NEXT: addi sp, sp, -16
97 ; RV64IFD-NEXT: sd ra, 8(sp)
98 ; RV64IFD-NEXT: call cos
99 ; RV64IFD-NEXT: ld ra, 8(sp)
100 ; RV64IFD-NEXT: addi sp, sp, 16
102 %1 = call double @llvm.cos.f64(double %a)
106 ; The sin+cos combination results in an FSINCOS SelectionDAG node.
107 define double @sincos_f64(double %a) nounwind {
108 ; RV32IFD-LABEL: sincos_f64:
110 ; RV32IFD-NEXT: addi sp, sp, -32
111 ; RV32IFD-NEXT: sw ra, 28(sp)
112 ; RV32IFD-NEXT: sw s0, 24(sp)
113 ; RV32IFD-NEXT: sw s1, 20(sp)
114 ; RV32IFD-NEXT: mv s0, a1
115 ; RV32IFD-NEXT: mv s1, a0
116 ; RV32IFD-NEXT: call sin
117 ; RV32IFD-NEXT: sw a0, 8(sp)
118 ; RV32IFD-NEXT: sw a1, 12(sp)
119 ; RV32IFD-NEXT: fld ft0, 8(sp)
120 ; RV32IFD-NEXT: fsd ft0, 0(sp)
121 ; RV32IFD-NEXT: mv a0, s1
122 ; RV32IFD-NEXT: mv a1, s0
123 ; RV32IFD-NEXT: call cos
124 ; RV32IFD-NEXT: sw a0, 8(sp)
125 ; RV32IFD-NEXT: sw a1, 12(sp)
126 ; RV32IFD-NEXT: fld ft0, 8(sp)
127 ; RV32IFD-NEXT: fld ft1, 0(sp)
128 ; RV32IFD-NEXT: fadd.d ft0, ft1, ft0
129 ; RV32IFD-NEXT: fsd ft0, 8(sp)
130 ; RV32IFD-NEXT: lw a0, 8(sp)
131 ; RV32IFD-NEXT: lw a1, 12(sp)
132 ; RV32IFD-NEXT: lw s1, 20(sp)
133 ; RV32IFD-NEXT: lw s0, 24(sp)
134 ; RV32IFD-NEXT: lw ra, 28(sp)
135 ; RV32IFD-NEXT: addi sp, sp, 32
138 ; RV64IFD-LABEL: sincos_f64:
140 ; RV64IFD-NEXT: addi sp, sp, -32
141 ; RV64IFD-NEXT: sd ra, 24(sp)
142 ; RV64IFD-NEXT: sd s0, 16(sp)
143 ; RV64IFD-NEXT: mv s0, a0
144 ; RV64IFD-NEXT: call sin
145 ; RV64IFD-NEXT: fmv.d.x ft0, a0
146 ; RV64IFD-NEXT: fsd ft0, 8(sp)
147 ; RV64IFD-NEXT: mv a0, s0
148 ; RV64IFD-NEXT: call cos
149 ; RV64IFD-NEXT: fmv.d.x ft0, a0
150 ; RV64IFD-NEXT: fld ft1, 8(sp)
151 ; RV64IFD-NEXT: fadd.d ft0, ft1, ft0
152 ; RV64IFD-NEXT: fmv.x.d a0, ft0
153 ; RV64IFD-NEXT: ld s0, 16(sp)
154 ; RV64IFD-NEXT: ld ra, 24(sp)
155 ; RV64IFD-NEXT: addi sp, sp, 32
157 %1 = call double @llvm.sin.f64(double %a)
158 %2 = call double @llvm.cos.f64(double %a)
159 %3 = fadd double %1, %2
163 declare double @llvm.pow.f64(double, double)
165 define double @pow_f64(double %a, double %b) nounwind {
166 ; RV32IFD-LABEL: pow_f64:
168 ; RV32IFD-NEXT: addi sp, sp, -16
169 ; RV32IFD-NEXT: sw ra, 12(sp)
170 ; RV32IFD-NEXT: call pow
171 ; RV32IFD-NEXT: lw ra, 12(sp)
172 ; RV32IFD-NEXT: addi sp, sp, 16
175 ; RV64IFD-LABEL: pow_f64:
177 ; RV64IFD-NEXT: addi sp, sp, -16
178 ; RV64IFD-NEXT: sd ra, 8(sp)
179 ; RV64IFD-NEXT: call pow
180 ; RV64IFD-NEXT: ld ra, 8(sp)
181 ; RV64IFD-NEXT: addi sp, sp, 16
183 %1 = call double @llvm.pow.f64(double %a, double %b)
187 declare double @llvm.exp.f64(double)
189 define double @exp_f64(double %a) nounwind {
190 ; RV32IFD-LABEL: exp_f64:
192 ; RV32IFD-NEXT: addi sp, sp, -16
193 ; RV32IFD-NEXT: sw ra, 12(sp)
194 ; RV32IFD-NEXT: call exp
195 ; RV32IFD-NEXT: lw ra, 12(sp)
196 ; RV32IFD-NEXT: addi sp, sp, 16
199 ; RV64IFD-LABEL: exp_f64:
201 ; RV64IFD-NEXT: addi sp, sp, -16
202 ; RV64IFD-NEXT: sd ra, 8(sp)
203 ; RV64IFD-NEXT: call exp
204 ; RV64IFD-NEXT: ld ra, 8(sp)
205 ; RV64IFD-NEXT: addi sp, sp, 16
207 %1 = call double @llvm.exp.f64(double %a)
211 declare double @llvm.exp2.f64(double)
213 define double @exp2_f64(double %a) nounwind {
214 ; RV32IFD-LABEL: exp2_f64:
216 ; RV32IFD-NEXT: addi sp, sp, -16
217 ; RV32IFD-NEXT: sw ra, 12(sp)
218 ; RV32IFD-NEXT: call exp2
219 ; RV32IFD-NEXT: lw ra, 12(sp)
220 ; RV32IFD-NEXT: addi sp, sp, 16
223 ; RV64IFD-LABEL: exp2_f64:
225 ; RV64IFD-NEXT: addi sp, sp, -16
226 ; RV64IFD-NEXT: sd ra, 8(sp)
227 ; RV64IFD-NEXT: call exp2
228 ; RV64IFD-NEXT: ld ra, 8(sp)
229 ; RV64IFD-NEXT: addi sp, sp, 16
231 %1 = call double @llvm.exp2.f64(double %a)
235 declare double @llvm.log.f64(double)
237 define double @log_f64(double %a) nounwind {
238 ; RV32IFD-LABEL: log_f64:
240 ; RV32IFD-NEXT: addi sp, sp, -16
241 ; RV32IFD-NEXT: sw ra, 12(sp)
242 ; RV32IFD-NEXT: call log
243 ; RV32IFD-NEXT: lw ra, 12(sp)
244 ; RV32IFD-NEXT: addi sp, sp, 16
247 ; RV64IFD-LABEL: log_f64:
249 ; RV64IFD-NEXT: addi sp, sp, -16
250 ; RV64IFD-NEXT: sd ra, 8(sp)
251 ; RV64IFD-NEXT: call log
252 ; RV64IFD-NEXT: ld ra, 8(sp)
253 ; RV64IFD-NEXT: addi sp, sp, 16
255 %1 = call double @llvm.log.f64(double %a)
259 declare double @llvm.log10.f64(double)
261 define double @log10_f64(double %a) nounwind {
262 ; RV32IFD-LABEL: log10_f64:
264 ; RV32IFD-NEXT: addi sp, sp, -16
265 ; RV32IFD-NEXT: sw ra, 12(sp)
266 ; RV32IFD-NEXT: call log10
267 ; RV32IFD-NEXT: lw ra, 12(sp)
268 ; RV32IFD-NEXT: addi sp, sp, 16
271 ; RV64IFD-LABEL: log10_f64:
273 ; RV64IFD-NEXT: addi sp, sp, -16
274 ; RV64IFD-NEXT: sd ra, 8(sp)
275 ; RV64IFD-NEXT: call log10
276 ; RV64IFD-NEXT: ld ra, 8(sp)
277 ; RV64IFD-NEXT: addi sp, sp, 16
279 %1 = call double @llvm.log10.f64(double %a)
283 declare double @llvm.log2.f64(double)
285 define double @log2_f64(double %a) nounwind {
286 ; RV32IFD-LABEL: log2_f64:
288 ; RV32IFD-NEXT: addi sp, sp, -16
289 ; RV32IFD-NEXT: sw ra, 12(sp)
290 ; RV32IFD-NEXT: call log2
291 ; RV32IFD-NEXT: lw ra, 12(sp)
292 ; RV32IFD-NEXT: addi sp, sp, 16
295 ; RV64IFD-LABEL: log2_f64:
297 ; RV64IFD-NEXT: addi sp, sp, -16
298 ; RV64IFD-NEXT: sd ra, 8(sp)
299 ; RV64IFD-NEXT: call log2
300 ; RV64IFD-NEXT: ld ra, 8(sp)
301 ; RV64IFD-NEXT: addi sp, sp, 16
303 %1 = call double @llvm.log2.f64(double %a)
307 declare double @llvm.fma.f64(double, double, double)
309 define double @fma_f64(double %a, double %b, double %c) nounwind {
310 ; RV32IFD-LABEL: fma_f64:
312 ; RV32IFD-NEXT: addi sp, sp, -16
313 ; RV32IFD-NEXT: sw a4, 8(sp)
314 ; RV32IFD-NEXT: sw a5, 12(sp)
315 ; RV32IFD-NEXT: fld ft0, 8(sp)
316 ; RV32IFD-NEXT: sw a2, 8(sp)
317 ; RV32IFD-NEXT: sw a3, 12(sp)
318 ; RV32IFD-NEXT: fld ft1, 8(sp)
319 ; RV32IFD-NEXT: sw a0, 8(sp)
320 ; RV32IFD-NEXT: sw a1, 12(sp)
321 ; RV32IFD-NEXT: fld ft2, 8(sp)
322 ; RV32IFD-NEXT: fmadd.d ft0, ft2, ft1, ft0
323 ; RV32IFD-NEXT: fsd ft0, 8(sp)
324 ; RV32IFD-NEXT: lw a0, 8(sp)
325 ; RV32IFD-NEXT: lw a1, 12(sp)
326 ; RV32IFD-NEXT: addi sp, sp, 16
329 ; RV64IFD-LABEL: fma_f64:
331 ; RV64IFD-NEXT: fmv.d.x ft0, a2
332 ; RV64IFD-NEXT: fmv.d.x ft1, a1
333 ; RV64IFD-NEXT: fmv.d.x ft2, a0
334 ; RV64IFD-NEXT: fmadd.d ft0, ft2, ft1, ft0
335 ; RV64IFD-NEXT: fmv.x.d a0, ft0
337 %1 = call double @llvm.fma.f64(double %a, double %b, double %c)
341 declare double @llvm.fmuladd.f64(double, double, double)
343 define double @fmuladd_f64(double %a, double %b, double %c) nounwind {
344 ; Use of fmadd depends on TargetLowering::isFMAFasterthanFMulAndFAdd
345 ; RV32IFD-LABEL: fmuladd_f64:
347 ; RV32IFD-NEXT: addi sp, sp, -16
348 ; RV32IFD-NEXT: sw a4, 8(sp)
349 ; RV32IFD-NEXT: sw a5, 12(sp)
350 ; RV32IFD-NEXT: fld ft0, 8(sp)
351 ; RV32IFD-NEXT: sw a2, 8(sp)
352 ; RV32IFD-NEXT: sw a3, 12(sp)
353 ; RV32IFD-NEXT: fld ft1, 8(sp)
354 ; RV32IFD-NEXT: sw a0, 8(sp)
355 ; RV32IFD-NEXT: sw a1, 12(sp)
356 ; RV32IFD-NEXT: fld ft2, 8(sp)
357 ; RV32IFD-NEXT: fmul.d ft1, ft2, ft1
358 ; RV32IFD-NEXT: fadd.d ft0, ft1, ft0
359 ; RV32IFD-NEXT: fsd ft0, 8(sp)
360 ; RV32IFD-NEXT: lw a0, 8(sp)
361 ; RV32IFD-NEXT: lw a1, 12(sp)
362 ; RV32IFD-NEXT: addi sp, sp, 16
365 ; RV64IFD-LABEL: fmuladd_f64:
367 ; RV64IFD-NEXT: fmv.d.x ft0, a2
368 ; RV64IFD-NEXT: fmv.d.x ft1, a1
369 ; RV64IFD-NEXT: fmv.d.x ft2, a0
370 ; RV64IFD-NEXT: fmul.d ft1, ft2, ft1
371 ; RV64IFD-NEXT: fadd.d ft0, ft1, ft0
372 ; RV64IFD-NEXT: fmv.x.d a0, ft0
374 %1 = call double @llvm.fmuladd.f64(double %a, double %b, double %c)
378 declare double @llvm.fabs.f64(double)
380 define double @fabs_f64(double %a) nounwind {
381 ; RV32IFD-LABEL: fabs_f64:
383 ; RV32IFD-NEXT: lui a2, 524288
384 ; RV32IFD-NEXT: addi a2, a2, -1
385 ; RV32IFD-NEXT: and a1, a1, a2
388 ; RV64IFD-LABEL: fabs_f64:
390 ; RV64IFD-NEXT: addi a1, zero, -1
391 ; RV64IFD-NEXT: slli a1, a1, 63
392 ; RV64IFD-NEXT: addi a1, a1, -1
393 ; RV64IFD-NEXT: and a0, a0, a1
395 %1 = call double @llvm.fabs.f64(double %a)
399 declare double @llvm.minnum.f64(double, double)
401 define double @minnum_f64(double %a, double %b) nounwind {
402 ; RV32IFD-LABEL: minnum_f64:
404 ; RV32IFD-NEXT: addi sp, sp, -16
405 ; RV32IFD-NEXT: sw a2, 8(sp)
406 ; RV32IFD-NEXT: sw a3, 12(sp)
407 ; RV32IFD-NEXT: fld ft0, 8(sp)
408 ; RV32IFD-NEXT: sw a0, 8(sp)
409 ; RV32IFD-NEXT: sw a1, 12(sp)
410 ; RV32IFD-NEXT: fld ft1, 8(sp)
411 ; RV32IFD-NEXT: fmin.d ft0, ft1, ft0
412 ; RV32IFD-NEXT: fsd ft0, 8(sp)
413 ; RV32IFD-NEXT: lw a0, 8(sp)
414 ; RV32IFD-NEXT: lw a1, 12(sp)
415 ; RV32IFD-NEXT: addi sp, sp, 16
418 ; RV64IFD-LABEL: minnum_f64:
420 ; RV64IFD-NEXT: fmv.d.x ft0, a1
421 ; RV64IFD-NEXT: fmv.d.x ft1, a0
422 ; RV64IFD-NEXT: fmin.d ft0, ft1, ft0
423 ; RV64IFD-NEXT: fmv.x.d a0, ft0
425 %1 = call double @llvm.minnum.f64(double %a, double %b)
429 declare double @llvm.maxnum.f64(double, double)
431 define double @maxnum_f64(double %a, double %b) nounwind {
432 ; RV32IFD-LABEL: maxnum_f64:
434 ; RV32IFD-NEXT: addi sp, sp, -16
435 ; RV32IFD-NEXT: sw a2, 8(sp)
436 ; RV32IFD-NEXT: sw a3, 12(sp)
437 ; RV32IFD-NEXT: fld ft0, 8(sp)
438 ; RV32IFD-NEXT: sw a0, 8(sp)
439 ; RV32IFD-NEXT: sw a1, 12(sp)
440 ; RV32IFD-NEXT: fld ft1, 8(sp)
441 ; RV32IFD-NEXT: fmax.d ft0, ft1, ft0
442 ; RV32IFD-NEXT: fsd ft0, 8(sp)
443 ; RV32IFD-NEXT: lw a0, 8(sp)
444 ; RV32IFD-NEXT: lw a1, 12(sp)
445 ; RV32IFD-NEXT: addi sp, sp, 16
448 ; RV64IFD-LABEL: maxnum_f64:
450 ; RV64IFD-NEXT: fmv.d.x ft0, a1
451 ; RV64IFD-NEXT: fmv.d.x ft1, a0
452 ; RV64IFD-NEXT: fmax.d ft0, ft1, ft0
453 ; RV64IFD-NEXT: fmv.x.d a0, ft0
455 %1 = call double @llvm.maxnum.f64(double %a, double %b)
459 ; TODO: FMINNAN and FMAXNAN aren't handled in
460 ; SelectionDAGLegalize::ExpandNode.
462 ; declare double @llvm.minimum.f64(double, double)
464 ; define double @fminimum_f64(double %a, double %b) nounwind {
465 ; %1 = call double @llvm.minimum.f64(double %a, double %b)
469 ; declare double @llvm.maximum.f64(double, double)
471 ; define double @fmaximum_f64(double %a, double %b) nounwind {
472 ; %1 = call double @llvm.maximum.f64(double %a, double %b)
476 declare double @llvm.copysign.f64(double, double)
478 define double @copysign_f64(double %a, double %b) nounwind {
479 ; RV32IFD-LABEL: copysign_f64:
481 ; RV32IFD-NEXT: addi sp, sp, -16
482 ; RV32IFD-NEXT: sw a2, 8(sp)
483 ; RV32IFD-NEXT: sw a3, 12(sp)
484 ; RV32IFD-NEXT: fld ft0, 8(sp)
485 ; RV32IFD-NEXT: sw a0, 8(sp)
486 ; RV32IFD-NEXT: sw a1, 12(sp)
487 ; RV32IFD-NEXT: fld ft1, 8(sp)
488 ; RV32IFD-NEXT: fsgnj.d ft0, ft1, ft0
489 ; RV32IFD-NEXT: fsd ft0, 8(sp)
490 ; RV32IFD-NEXT: lw a0, 8(sp)
491 ; RV32IFD-NEXT: lw a1, 12(sp)
492 ; RV32IFD-NEXT: addi sp, sp, 16
495 ; RV64IFD-LABEL: copysign_f64:
497 ; RV64IFD-NEXT: fmv.d.x ft0, a1
498 ; RV64IFD-NEXT: fmv.d.x ft1, a0
499 ; RV64IFD-NEXT: fsgnj.d ft0, ft1, ft0
500 ; RV64IFD-NEXT: fmv.x.d a0, ft0
502 %1 = call double @llvm.copysign.f64(double %a, double %b)
506 declare double @llvm.floor.f64(double)
508 define double @floor_f64(double %a) nounwind {
509 ; RV32IFD-LABEL: floor_f64:
511 ; RV32IFD-NEXT: addi sp, sp, -16
512 ; RV32IFD-NEXT: sw ra, 12(sp)
513 ; RV32IFD-NEXT: call floor
514 ; RV32IFD-NEXT: lw ra, 12(sp)
515 ; RV32IFD-NEXT: addi sp, sp, 16
518 ; RV64IFD-LABEL: floor_f64:
520 ; RV64IFD-NEXT: addi sp, sp, -16
521 ; RV64IFD-NEXT: sd ra, 8(sp)
522 ; RV64IFD-NEXT: call floor
523 ; RV64IFD-NEXT: ld ra, 8(sp)
524 ; RV64IFD-NEXT: addi sp, sp, 16
526 %1 = call double @llvm.floor.f64(double %a)
530 declare double @llvm.ceil.f64(double)
532 define double @ceil_f64(double %a) nounwind {
533 ; RV32IFD-LABEL: ceil_f64:
535 ; RV32IFD-NEXT: addi sp, sp, -16
536 ; RV32IFD-NEXT: sw ra, 12(sp)
537 ; RV32IFD-NEXT: call ceil
538 ; RV32IFD-NEXT: lw ra, 12(sp)
539 ; RV32IFD-NEXT: addi sp, sp, 16
542 ; RV64IFD-LABEL: ceil_f64:
544 ; RV64IFD-NEXT: addi sp, sp, -16
545 ; RV64IFD-NEXT: sd ra, 8(sp)
546 ; RV64IFD-NEXT: call ceil
547 ; RV64IFD-NEXT: ld ra, 8(sp)
548 ; RV64IFD-NEXT: addi sp, sp, 16
550 %1 = call double @llvm.ceil.f64(double %a)
554 declare double @llvm.trunc.f64(double)
556 define double @trunc_f64(double %a) nounwind {
557 ; RV32IFD-LABEL: trunc_f64:
559 ; RV32IFD-NEXT: addi sp, sp, -16
560 ; RV32IFD-NEXT: sw ra, 12(sp)
561 ; RV32IFD-NEXT: call trunc
562 ; RV32IFD-NEXT: lw ra, 12(sp)
563 ; RV32IFD-NEXT: addi sp, sp, 16
566 ; RV64IFD-LABEL: trunc_f64:
568 ; RV64IFD-NEXT: addi sp, sp, -16
569 ; RV64IFD-NEXT: sd ra, 8(sp)
570 ; RV64IFD-NEXT: call trunc
571 ; RV64IFD-NEXT: ld ra, 8(sp)
572 ; RV64IFD-NEXT: addi sp, sp, 16
574 %1 = call double @llvm.trunc.f64(double %a)
578 declare double @llvm.rint.f64(double)
580 define double @rint_f64(double %a) nounwind {
581 ; RV32IFD-LABEL: rint_f64:
583 ; RV32IFD-NEXT: addi sp, sp, -16
584 ; RV32IFD-NEXT: sw ra, 12(sp)
585 ; RV32IFD-NEXT: call rint
586 ; RV32IFD-NEXT: lw ra, 12(sp)
587 ; RV32IFD-NEXT: addi sp, sp, 16
590 ; RV64IFD-LABEL: rint_f64:
592 ; RV64IFD-NEXT: addi sp, sp, -16
593 ; RV64IFD-NEXT: sd ra, 8(sp)
594 ; RV64IFD-NEXT: call rint
595 ; RV64IFD-NEXT: ld ra, 8(sp)
596 ; RV64IFD-NEXT: addi sp, sp, 16
598 %1 = call double @llvm.rint.f64(double %a)
602 declare double @llvm.nearbyint.f64(double)
604 define double @nearbyint_f64(double %a) nounwind {
605 ; RV32IFD-LABEL: nearbyint_f64:
607 ; RV32IFD-NEXT: addi sp, sp, -16
608 ; RV32IFD-NEXT: sw ra, 12(sp)
609 ; RV32IFD-NEXT: call nearbyint
610 ; RV32IFD-NEXT: lw ra, 12(sp)
611 ; RV32IFD-NEXT: addi sp, sp, 16
614 ; RV64IFD-LABEL: nearbyint_f64:
616 ; RV64IFD-NEXT: addi sp, sp, -16
617 ; RV64IFD-NEXT: sd ra, 8(sp)
618 ; RV64IFD-NEXT: call nearbyint
619 ; RV64IFD-NEXT: ld ra, 8(sp)
620 ; RV64IFD-NEXT: addi sp, sp, 16
622 %1 = call double @llvm.nearbyint.f64(double %a)
626 declare double @llvm.round.f64(double)
628 define double @round_f64(double %a) nounwind {
629 ; RV32IFD-LABEL: round_f64:
631 ; RV32IFD-NEXT: addi sp, sp, -16
632 ; RV32IFD-NEXT: sw ra, 12(sp)
633 ; RV32IFD-NEXT: call round
634 ; RV32IFD-NEXT: lw ra, 12(sp)
635 ; RV32IFD-NEXT: addi sp, sp, 16
638 ; RV64IFD-LABEL: round_f64:
640 ; RV64IFD-NEXT: addi sp, sp, -16
641 ; RV64IFD-NEXT: sd ra, 8(sp)
642 ; RV64IFD-NEXT: call round
643 ; RV64IFD-NEXT: ld ra, 8(sp)
644 ; RV64IFD-NEXT: addi sp, sp, 16
646 %1 = call double @llvm.round.f64(double %a)