brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 2a2abbd Raw
43 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 32; RUN: llc -mtriple=riscv64 -global-isel -mattr=+d -target-abi=lp64 \3; RUN:   -verify-machineinstrs < %s | FileCheck -check-prefix=RV64I %s4 5; Test copying between FPR64 and GPR on RV64.6; FIXME: This test should be replaced with a more general calling convention7; test once we have more FP implemented.8 9define double @fadd_f64(double %x, double %y) {10; RV64I-LABEL: fadd_f64:11; RV64I:       # %bb.0:12; RV64I-NEXT:    fmv.d.x fa5, a013; RV64I-NEXT:    fmv.d.x fa4, a114; RV64I-NEXT:    fadd.d fa5, fa5, fa415; RV64I-NEXT:    fmv.x.d a0, fa516; RV64I-NEXT:    ret17  %a = fadd double %x, %y18  ret double %a19}20 21; Test copying between FPR32 and GPR on RV64.22; FIXME: This test should be replaced with a more general calling convention23; test once we have more FP implemented.24 25define float @fadd_f32(float %x, float %y) {26; RV32I-LABEL: fadd:27; RV32I:       # %bb.0:28; RV32I-NEXT:    fmv.d.x fa5, a029; RV32I-NEXT:    fmv.d.x fa4, a130; RV32I-NEXT:    fadd.d fa5, fa5, fa431; RV32I-NEXT:    fmv.x.d a0, fa532; RV32I-NEXT:    ret33; RV64I-LABEL: fadd_f32:34; RV64I:       # %bb.0:35; RV64I-NEXT:    fmv.w.x fa5, a036; RV64I-NEXT:    fmv.w.x fa4, a137; RV64I-NEXT:    fadd.s fa5, fa5, fa438; RV64I-NEXT:    fmv.x.w a0, fa539; RV64I-NEXT:    ret40  %a = fadd float %x, %y41  ret float %a42}43