1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+f -verify-machineinstrs < %s \
3 ; RUN: | FileCheck -check-prefix=RV32IF %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+f -verify-machineinstrs < %s \
5 ; RUN: | FileCheck -check-prefix=RV64IF %s
6 ; RUN: llc -mtriple=riscv32 -mattr=+zfinx -verify-machineinstrs < %s \
7 ; RUN: | FileCheck -check-prefix=RV32IZFINX %s
8 ; RUN: llc -mtriple=riscv64 -mattr=+zfinx -verify-machineinstrs < %s \
9 ; RUN: | FileCheck -check-prefix=RV64IZFINX %s
10 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
11 ; RUN: | FileCheck -check-prefix=RV32I %s
12 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
13 ; RUN: | FileCheck -check-prefix=RV64I %s
15 define float @frem_f32(float %a, float %b) nounwind {
16 ; RV32IF-LABEL: frem_f32:
18 ; RV32IF-NEXT: tail fmodf
20 ; RV64IF-LABEL: frem_f32:
22 ; RV64IF-NEXT: tail fmodf
24 ; RV32IZFINX-LABEL: frem_f32:
25 ; RV32IZFINX: # %bb.0:
26 ; RV32IZFINX-NEXT: tail fmodf
28 ; RV64IZFINX-LABEL: frem_f32:
29 ; RV64IZFINX: # %bb.0:
30 ; RV64IZFINX-NEXT: addi sp, sp, -16
31 ; RV64IZFINX-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
32 ; RV64IZFINX-NEXT: call fmodf
33 ; RV64IZFINX-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
34 ; RV64IZFINX-NEXT: addi sp, sp, 16
35 ; RV64IZFINX-NEXT: ret
37 ; RV32I-LABEL: frem_f32:
39 ; RV32I-NEXT: addi sp, sp, -16
40 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
41 ; RV32I-NEXT: call fmodf
42 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
43 ; RV32I-NEXT: addi sp, sp, 16
46 ; RV64I-LABEL: frem_f32:
48 ; RV64I-NEXT: addi sp, sp, -16
49 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
50 ; RV64I-NEXT: call fmodf
51 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
52 ; RV64I-NEXT: addi sp, sp, 16
54 %1 = frem float %a, %b