89 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 32; RUN: llc -mtriple=riscv64 -global-isel -stop-after=irtranslator \3; RUN: -verify-machineinstrs < %s \4; RUN: | FileCheck -check-prefixes=RV64,RV64I %s5; RUN: llc -mtriple=riscv64 -mattr=+f -target-abi=lp64 \6; RUN: -global-isel -stop-after=irtranslator -verify-machineinstrs < %s \7; RUN: | FileCheck -check-prefixes=RV64,RV64F %s8 9; Any tests that would have identical output for some combination of the lp64*10; ABIs belong in calling-conv-*-common.ll. This file contains tests that will11; have different output across those ABIs. i.e. where some arguments would be12; passed according to the floating point ABI.13 14define i64 @callee_float_in_regs(i64 %a, float %b) nounwind {15 ; RV64-LABEL: name: callee_float_in_regs16 ; RV64: bb.1 (%ir-block.0):17 ; RV64-NEXT: liveins: $x10, $x1118 ; RV64-NEXT: {{ $}}19 ; RV64-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x1020 ; RV64-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1121 ; RV64-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)22 ; RV64-NEXT: [[FPTOSI:%[0-9]+]]:_(s64) = G_FPTOSI [[TRUNC]](s32)23 ; RV64-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[COPY]], [[FPTOSI]]24 ; RV64-NEXT: $x10 = COPY [[ADD]](s64)25 ; RV64-NEXT: PseudoRET implicit $x1026 %b_fptosi = fptosi float %b to i6427 %1 = add i64 %a, %b_fptosi28 ret i64 %129}30 31define i64 @caller_float_in_regs() nounwind {32 ; RV64I-LABEL: name: caller_float_in_regs33 ; RV64I: bb.1 (%ir-block.0):34 ; RV64I-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 135 ; RV64I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_FCONSTANT float 2.000000e+0036 ; RV64I-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x237 ; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[C1]](s32)38 ; RV64I-NEXT: $x10 = COPY [[C]](s64)39 ; RV64I-NEXT: $x11 = COPY [[ANYEXT]](s64)40 ; RV64I-NEXT: PseudoCALL target-flags(riscv-call) @callee_float_in_regs, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x1041 ; RV64I-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x242 ; RV64I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x1043 ; RV64I-NEXT: $x10 = COPY [[COPY]](s64)44 ; RV64I-NEXT: PseudoRET implicit $x1045 ;46 ; RV64F-LABEL: name: caller_float_in_regs47 ; RV64F: bb.1 (%ir-block.0):48 ; RV64F-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 149 ; RV64F-NEXT: [[C1:%[0-9]+]]:_(s32) = G_FCONSTANT float 2.000000e+0050 ; RV64F-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x251 ; RV64F-NEXT: $x10 = COPY [[C]](s64)52 ; RV64F-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[C1]](s32)53 ; RV64F-NEXT: $x11 = COPY [[ANYEXT]](s64)54 ; RV64F-NEXT: PseudoCALL target-flags(riscv-call) @callee_float_in_regs, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x1055 ; RV64F-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x256 ; RV64F-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x1057 ; RV64F-NEXT: $x10 = COPY [[COPY]](s64)58 ; RV64F-NEXT: PseudoRET implicit $x1059 %1 = call i64 @callee_float_in_regs(i64 1, float 2.0)60 ret i64 %161}62 63define float @callee_tiny_scalar_ret() nounwind {64 ; RV64-LABEL: name: callee_tiny_scalar_ret65 ; RV64: bb.1 (%ir-block.0):66 ; RV64-NEXT: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 1.000000e+0067 ; RV64-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[C]](s32)68 ; RV64-NEXT: $x10 = COPY [[ANYEXT]](s64)69 ; RV64-NEXT: PseudoRET implicit $x1070 ret float 1.071}72 73define i64 @caller_tiny_scalar_ret() nounwind {74 ; RV64-LABEL: name: caller_tiny_scalar_ret75 ; RV64: bb.1 (%ir-block.0):76 ; RV64-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x277 ; RV64-NEXT: PseudoCALL target-flags(riscv-call) @callee_tiny_scalar_ret, csr_ilp32_lp64, implicit-def $x1, implicit-def $x1078 ; RV64-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x279 ; RV64-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x1080 ; RV64-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)81 ; RV64-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[TRUNC]](s32)82 ; RV64-NEXT: $x10 = COPY [[SEXT]](s64)83 ; RV64-NEXT: PseudoRET implicit $x1084 %1 = call float @callee_tiny_scalar_ret()85 %2 = bitcast float %1 to i3286 %3 = sext i32 %2 to i6487 ret i64 %388}89