69 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \3; RUN: | FileCheck -check-prefix=RV64I %s4; RUN: llc -mtriple=riscv64 -mattr=+f -target-abi lp64f \5; RUN: -verify-machineinstrs < %s \6; RUN: | FileCheck -check-prefix=RV64I %s7 8; This file contains tests that should have identical output for the lp64 and9; lp64f ABIs. It doesn't check codegen when frame pointer elimination is10; disabled, as there is sufficient coverage for this case in other files.11 12define i64 @callee_double_in_regs(i64 %a, double %b) nounwind {13; RV64I-LABEL: callee_double_in_regs:14; RV64I: # %bb.0:15; RV64I-NEXT: addi sp, sp, -1616; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill17; RV64I-NEXT: sd s0, 0(sp) # 8-byte Folded Spill18; RV64I-NEXT: mv s0, a019; RV64I-NEXT: mv a0, a120; RV64I-NEXT: call __fixdfdi21; RV64I-NEXT: add a0, s0, a022; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload23; RV64I-NEXT: ld s0, 0(sp) # 8-byte Folded Reload24; RV64I-NEXT: addi sp, sp, 1625; RV64I-NEXT: ret26 %b_fptosi = fptosi double %b to i6427 %1 = add i64 %a, %b_fptosi28 ret i64 %129}30 31define i64 @caller_double_in_regs() nounwind {32; RV64I-LABEL: caller_double_in_regs:33; RV64I: # %bb.0:34; RV64I-NEXT: addi sp, sp, -1635; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill36; RV64I-NEXT: li a1, 137; RV64I-NEXT: slli a1, a1, 6238; RV64I-NEXT: li a0, 139; RV64I-NEXT: call callee_double_in_regs40; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload41; RV64I-NEXT: addi sp, sp, 1642; RV64I-NEXT: ret43 %1 = call i64 @callee_double_in_regs(i64 1, double 2.0)44 ret i64 %145}46 47define double @callee_double_ret() nounwind {48; RV64I-LABEL: callee_double_ret:49; RV64I: # %bb.0:50; RV64I-NEXT: li a0, 102351; RV64I-NEXT: slli a0, a0, 5252; RV64I-NEXT: ret53 ret double 1.054}55 56define i64 @caller_double_ret() nounwind {57; RV64I-LABEL: caller_double_ret:58; RV64I: # %bb.0:59; RV64I-NEXT: addi sp, sp, -1660; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill61; RV64I-NEXT: call callee_double_ret62; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload63; RV64I-NEXT: addi sp, sp, 1664; RV64I-NEXT: ret65 %1 = call double @callee_double_ret()66 %2 = bitcast double %1 to i6467 ret i64 %268}69