1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc -mtriple=riscv64 -global-isel -mattr=+d -target-abi=lp64 \
3 ; RUN: -verify-machineinstrs < %s | FileCheck -check-prefix=RV64I %s
5 ; Test copying between FPR64 and GPR on RV64.
6 ; FIXME: This test should be replaced with a more general calling convention
7 ; test once we have more FP implemented.
9 define double @fadd_f64(double %x, double %y) {
10 ; RV64I-LABEL: fadd_f64:
12 ; RV64I-NEXT: fmv.d.x fa5, a0
13 ; RV64I-NEXT: fmv.d.x fa4, a1
14 ; RV64I-NEXT: fadd.d fa5, fa5, fa4
15 ; RV64I-NEXT: fmv.x.d a0, fa5
17 %a = fadd double %x, %y
21 ; Test copying between FPR32 and GPR on RV64.
22 ; FIXME: This test should be replaced with a more general calling convention
23 ; test once we have more FP implemented.
25 define float @fadd_f32(float %x, float %y) {
28 ; RV32I-NEXT: fmv.d.x fa5, a0
29 ; RV32I-NEXT: fmv.d.x fa4, a1
30 ; RV32I-NEXT: fadd.d fa5, fa5, fa4
31 ; RV32I-NEXT: fmv.x.d a0, fa5
33 %a = fadd float %x, %y