[clang] [clang][RISC-V] fixed fp calling convention for fpcc eligible structs for risc-v (PR #110690)

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 1 10:16:01 PDT 2024


================
@@ -251,6 +253,15 @@ bool RISCVABIInfo::detectFPCCEligibleStructHelper(QualType Ty, CharUnits CurOff,
         // bitwidth is XLen or less.
         if (getContext().getTypeSize(QTy) > XLen && BitWidth <= XLen)
           QTy = getContext().getIntTypeForBitwidth(XLen, false);
+        // Trim type to alignment/bitwidth if that is possible
+        else if (getContext().getTypeSize(QTy) > Alignment &&
----------------
topperc wrote:

Is the alignment relevant? Should we just round the bitfield size to the smallest power of 2 always? Even without the packed attribute, gcc -O0 emits `sb` while clang emits `sw`.

https://github.com/llvm/llvm-project/pull/110690


More information about the cfe-commits mailing list