diff options
author | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2012-10-29 14:59:36 +0000 |
---|---|---|
committer | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2012-10-29 14:59:36 +0000 |
commit | bbc661e572fdcd4fd8b3829308e0328ad69cedd4 (patch) | |
tree | 1a13f44fa00dde1ecd811c75c529eccfb7c16e5e /llvm/lib | |
parent | cec4cb151a07cb32785cee5b170176465b090a6a (diff) | |
download | bcm5719-llvm-bbc661e572fdcd4fd8b3829308e0328ad69cedd4.tar.gz bcm5719-llvm-bbc661e572fdcd4fd8b3829308e0328ad69cedd4.zip |
This patch adds alignment information for long double to the 64-bit PowerPC
ELF subtarget.
The existing logic is used as a fallback to avoid any changes to the Darwin
ABI. PPC64 ELF now has two possible data layout strings: one for FreeBSD,
which requires 8-byte alignment, and a default string that requires
16-byte alignment.
I've added a test for PPC64 Linux to verify the 16-byte alignment. If
somebody wants to add a separate test for FreeBSD, that would be great.
Note that there is a companion patch to update the alignment information
in Clang, which I am committing now as well.
llvm-svn: 166928
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCSubtarget.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCSubtarget.h b/llvm/lib/Target/PowerPC/PPCSubtarget.h index c20995afe83..77784e045de 100644 --- a/llvm/lib/Target/PowerPC/PPCSubtarget.h +++ b/llvm/lib/Target/PowerPC/PPCSubtarget.h @@ -113,6 +113,12 @@ public: const char *getDataLayoutString() const { // Note, the alignment values for f64 and i64 on ppc64 in Darwin // documentation are wrong; these are correct (i.e. "what gcc does"). + if (isPPC64() && isSVR4ABI()) + if (TargetTriple.getOS() == llvm::Triple::FreeBSD) + return "E-p:64:64-f64:64:64-i64:64:64-f128:64:64-v128:128:128-n32:64"; + else + return "E-p:64:64-f64:64:64-i64:64:64-f128:128:128-v128:128:128-n32:64"; + return isPPC64() ? "E-p:64:64-f64:64:64-i64:64:64-f128:64:128-n32:64" : "E-p:32:32-f64:64:64-i64:64:64-f128:64:128-n32"; } |