umesh.kalappa0 created this revision. umesh.kalappa0 added a reviewer: nikic. umesh.kalappa0 added projects: LLVM, clang. Herald added subscribers: StephenFan, shchenz, nemanjai. Herald added a project: All. umesh.kalappa0 requested review of this revision. Herald added a subscriber: cfe-commits.
Changes : Like GNU GCC passes and returns float/double/long double complex in FPRs . Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D146942 Files: clang/lib/CodeGen/TargetInfo.cpp Index: clang/lib/CodeGen/TargetInfo.cpp =================================================================== --- clang/lib/CodeGen/TargetInfo.cpp +++ clang/lib/CodeGen/TargetInfo.cpp @@ -4720,6 +4720,7 @@ IsRetSmallStructInRegABI(RetSmallStructInRegABI) {} ABIArgInfo classifyReturnType(QualType RetTy) const; + ABIArgInfo classifyArgumentType(QualType Ty) const; void computeInfo(CGFunctionInfo &FI) const override { if (!getCXXABI().classifyReturnType(FI)) @@ -4776,6 +4777,15 @@ return CharUnits::fromQuantity(4); } +ABIArgInfo PPC32_SVR4_ABIInfo::classifyArgumentType(QualType Ty) const { + Ty = useFirstFieldIfTransparentUnion(Ty); + + if (Ty->isAnyComplexType()) + return ABIArgInfo::getDirect(); + + return DefaultABIInfo::classifyArgumentType(Ty); +} + ABIArgInfo PPC32_SVR4_ABIInfo::classifyReturnType(QualType RetTy) const { uint64_t Size; @@ -4801,6 +4811,9 @@ } } + if (RetTy->isAnyComplexType()) + return ABIArgInfo::getDirect(); + return DefaultABIInfo::classifyReturnType(RetTy); }
Index: clang/lib/CodeGen/TargetInfo.cpp =================================================================== --- clang/lib/CodeGen/TargetInfo.cpp +++ clang/lib/CodeGen/TargetInfo.cpp @@ -4720,6 +4720,7 @@ IsRetSmallStructInRegABI(RetSmallStructInRegABI) {} ABIArgInfo classifyReturnType(QualType RetTy) const; + ABIArgInfo classifyArgumentType(QualType Ty) const; void computeInfo(CGFunctionInfo &FI) const override { if (!getCXXABI().classifyReturnType(FI)) @@ -4776,6 +4777,15 @@ return CharUnits::fromQuantity(4); } +ABIArgInfo PPC32_SVR4_ABIInfo::classifyArgumentType(QualType Ty) const { + Ty = useFirstFieldIfTransparentUnion(Ty); + + if (Ty->isAnyComplexType()) + return ABIArgInfo::getDirect(); + + return DefaultABIInfo::classifyArgumentType(Ty); +} + ABIArgInfo PPC32_SVR4_ABIInfo::classifyReturnType(QualType RetTy) const { uint64_t Size; @@ -4801,6 +4811,9 @@ } } + if (RetTy->isAnyComplexType()) + return ABIArgInfo::getDirect(); + return DefaultABIInfo::classifyReturnType(RetTy); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits