================ @@ -337,12 +350,77 @@ CharUnits PPC32_SVR4_ABIInfo::getParamTypeAlignment(QualType Ty) const { return CharUnits::fromQuantity(4); } +ABIArgInfo PPC32_SVR4_ABIInfo::handleComplex(QualType Ty, + uint64_t &TypeSize) const { + + assert(Ty->isAnyComplexType()); + llvm::Type *ElemTy; + unsigned SizeRegs; + + if (TypeSize == 64) { + ElemTy = llvm::Type::getInt64Ty(getVMContext()); + SizeRegs = 1; + } else { + ElemTy = llvm::Type::getInt32Ty(getVMContext()); ---------------- Long5hot wrote:
Reason for using llvm::Type::getInt64Ty(getVMContext()) for floats here was to follow ABI ATR-PASS-COMPLEX-IN-GPRS > complex single-precision float : If gr is even, set gr = gr + 1. Load the > lower-addressed word of the > argument into gr and the higher-addressed word into gr + 1, set gr = gr + 2. > > complex double-precision float: Load the words of the argument, in > memory-address order, into gr, gr + 1, > gr + 2 and gr + 3, set gr = gr + 4. You can check the previous discussion here. : https://reviews.llvm.org/D146942 https://github.com/llvm/llvm-project/pull/77732 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits