[clang] [llvm] [RISCV][GISel] Add support for quadruple-precision floating point ABIs (PR #195166)
Sam Elliott via cfe-commits
cfe-commits at lists.llvm.org
Mon May 4 13:54:20 PDT 2026
================
@@ -524,29 +544,49 @@ static bool CC_RISCV_Impl(unsigned ValNo, MVT ValVT, MVT LocVT,
assert(PendingLocs.size() == PendingArgFlags.size() &&
"PendingLocs and PendingArgFlags out of sync");
+ // If f128 cannot be passed in an FPR on RV32, it is passed according to the
+ // integer calling convention. Since it is larger than 2*XLEN, pass it by
+ // reference.
+ if (XLen == 32 && LocVT == MVT::f128) {
+ LocVT = XLenVT;
+ LocInfo = CCValAssign::Indirect;
+ if (MCRegister Reg = State.AllocateReg(ArgGPRs))
+ State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
+ else {
+ int64_t StackOffset = State.AllocateStack(4, Align(4));
----------------
lenary wrote:
This Allocation is slightly confusing me. Are we allocating for the pointer, or for the f128 value? If the former, use XLenInBytes, otherwise the values seem quite wrong.
https://github.com/llvm/llvm-project/pull/195166
More information about the cfe-commits
mailing list