aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/TargetInfo.cpp
diff options
context:
space:
mode:
authorQiu Chaofan <qiucofan@cn.ibm.com>2020-12-02 17:02:26 +0800
committerQiu Chaofan <qiucofan@cn.ibm.com>2020-12-02 17:02:26 +0800
commit3fca6a7844b515496446667a18a9703c29cf6e88 (patch)
tree4d9207ce9bdd527893bf62d5d15b90396da249a8 /clang/lib/CodeGen/TargetInfo.cpp
parent3f5dc57fd18106766f45216b5ddd4648d2fb4629 (diff)
downloadllvm-3fca6a7844b515496446667a18a9703c29cf6e88.zip
llvm-3fca6a7844b515496446667a18a9703c29cf6e88.tar.gz
llvm-3fca6a7844b515496446667a18a9703c29cf6e88.tar.bz2
[Clang] Don't adjust align for IBM extended double
Commit 6b1341eb fixed alignment for 128-bit FP types on PowerPC. However, the quadword alignment adjustment shouldn't be applied to IBM extended double (ppc_fp128 in IR) values. Reviewed By: jsji Differential Revision: https://reviews.llvm.org/D92278
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 3469bc6..48152663 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -5052,10 +5052,12 @@ CharUnits PPC64_SVR4_ABIInfo::getParamTypeAlignment(QualType Ty) const {
return CharUnits::fromQuantity(16);
} else if (Ty->isVectorType()) {
return CharUnits::fromQuantity(getContext().getTypeSize(Ty) == 128 ? 16 : 8);
- } else if (Ty->isRealFloatingType() && getContext().getTypeSize(Ty) == 128) {
- // IEEE 128-bit floating numbers are also stored in vector registers.
- // And both IEEE quad-precision and IBM extended double (ppc_fp128) should
- // be quad-word aligned.
+ } else if (Ty->isRealFloatingType() &&
+ &getContext().getFloatTypeSemantics(Ty) ==
+ &llvm::APFloat::IEEEquad()) {
+ // According to ABI document section 'Optional Save Areas': If extended
+ // precision floating-point values in IEEE BINARY 128 QUADRUPLE PRECISION
+ // format are supported, map them to a single quadword, quadword aligned.
return CharUnits::fromQuantity(16);
}