Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM, | ||||
: TargetLowering(TM), Subtarget(STI) { | : TargetLowering(TM), Subtarget(STI) { | ||||
if (Subtarget.isRV32E()) | if (Subtarget.isRV32E()) | ||||
report_fatal_error("Codegen not yet implemented for RV32E"); | report_fatal_error("Codegen not yet implemented for RV32E"); | ||||
RISCVABI::ABI ABI = Subtarget.getTargetABI(); | RISCVABI::ABI ABI = Subtarget.getTargetABI(); | ||||
assert(ABI != RISCVABI::ABI_Unknown && "Improperly initialised target ABI"); | assert(ABI != RISCVABI::ABI_Unknown && "Improperly initialised target ABI"); | ||||
if ((ABI == RISCVABI::ABI_ILP32F || ABI == RISCVABI::ABI_LP64F) && | |||||
!Subtarget.hasStdExtF()) { | |||||
errs() << "Hard-float 'f' ABI can't be used for a target that " | |||||
"doesn't support the F instruction set extension (ignoring " | |||||
"target-abi)\n"; | |||||
ABI = Subtarget.is64Bit() ? RISCVABI::ABI_LP64 : RISCVABI::ABI_ILP32; | |||||
lenary: I don't think we should be changing the ABI here if the user already chose one explicitly. | |||||
I follow the same behavior to changing the ABI. please see https://github.com/llvm/llvm-project/blob/master/llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.cpp#L59-L68. If we want to change the original behavior maybe it should be another patch? khchen: I follow the same behavior to changing the ABI. please see https://github.com/llvm/llvm… | |||||
} else if ((ABI == RISCVABI::ABI_ILP32D || ABI == RISCVABI::ABI_LP64D) && | |||||
!Subtarget.hasStdExtD()) { | |||||
errs() << "Hard-float 'd' ABI can't be used for a target that " | |||||
"doesn't support the D instruction set extension (ignoring " | |||||
"target-abi)\n"; | |||||
ABI = Subtarget.is64Bit() ? RISCVABI::ABI_LP64 : RISCVABI::ABI_ILP32; | |||||
} | |||||
switch (ABI) { | switch (ABI) { | ||||
default: | default: | ||||
report_fatal_error("Don't know how to lower this ABI"); | report_fatal_error("Don't know how to lower this ABI"); | ||||
case RISCVABI::ABI_ILP32: | case RISCVABI::ABI_ILP32: | ||||
case RISCVABI::ABI_ILP32F: | case RISCVABI::ABI_ILP32F: | ||||
case RISCVABI::ABI_ILP32D: | case RISCVABI::ABI_ILP32D: | ||||
case RISCVABI::ABI_LP64: | case RISCVABI::ABI_LP64: | ||||
case RISCVABI::ABI_LP64F: | case RISCVABI::ABI_LP64F: | ||||
▲ Show 20 Lines • Show All 2,848 Lines • Show Last 20 Lines |
I don't think we should be changing the ABI here if the user already chose one explicitly.