[PATCH] D91242: [RISCV] Custom lowering of SET_ROUNDING
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 11 09:37:15 PST 2020
craig.topper added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:225
+ if (Subtarget.hasStdExtD() || Subtarget.hasStdExtF()) {
+ setOperationAction(ISD::SET_ROUNDING, MVT::Other, Custom);
----------------
StdExtD implies StdExtF. So I think you only need to check StdExtF
================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:906
+ if (auto CV = dyn_cast<ConstantSDNode>(RMValue)) {
+ uint64_t RM = cast<ConstantSDNode>(RMValue)->getZExtValue();
+ assert(RM <= static_cast<unsigned>(llvm::RoundingMode::MaxIEEEMode));
----------------
Why do we need two code paths? Won't the other code constant fold if RMValue is a constant?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91242/new/
https://reviews.llvm.org/D91242
More information about the llvm-commits
mailing list