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@plt
20 ; RV64IF-LABEL: frem_f32:
22 ; RV64IF-NEXT: addi sp, sp, -16
23 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
24 ; RV64IF-NEXT: call fmodf@plt
25 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
26 ; RV64IF-NEXT: addi sp, sp, 16
29 ; RV32IZFINX-LABEL: frem_f32:
30 ; RV32IZFINX: # %bb.0:
31 ; RV32IZFINX-NEXT: tail fmodf@plt
33 ; RV64IZFINX-LABEL: frem_f32:
34 ; RV64IZFINX: # %bb.0:
35 ; RV64IZFINX-NEXT: addi sp, sp, -16
36 ; RV64IZFINX-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
37 ; RV64IZFINX-NEXT: call fmodf@plt
38 ; RV64IZFINX-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
39 ; RV64IZFINX-NEXT: addi sp, sp, 16
40 ; RV64IZFINX-NEXT: ret
42 ; RV32I-LABEL: frem_f32:
44 ; RV32I-NEXT: addi sp, sp, -16
45 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
46 ; RV32I-NEXT: call fmodf@plt
47 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
48 ; RV32I-NEXT: addi sp, sp, 16
51 ; RV64I-LABEL: frem_f32:
53 ; RV64I-NEXT: addi sp, sp, -16
54 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
55 ; RV64I-NEXT: call fmodf@plt
56 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
57 ; RV64I-NEXT: addi sp, sp, 16
59 %1 = frem float %a, %b