diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2013-10-29 19:00:35 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2013-10-29 19:00:35 +0000 |
commit | 618b29813ac587a85513acca9710d0e3be1bc46b (patch) | |
tree | 2bcc36cfb3cf6fc3fb20b924d769562c7b74536c /clang/lib/CodeGen/TargetInfo.cpp | |
parent | 596d108febc0eafb77fbfaa1cdb4a026a0f65ec1 (diff) | |
download | bcm5719-llvm-618b29813ac587a85513acca9710d0e3be1bc46b.tar.gz bcm5719-llvm-618b29813ac587a85513acca9710d0e3be1bc46b.zip |
[mips] Align the stack to 16-bytes for -mfp64.
llvm-svn: 193640
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index f5602130098..fa66fcbe945 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -4648,9 +4648,9 @@ class MipsABIInfo : public ABIInfo { llvm::Type* returnAggregateInRegs(QualType RetTy, uint64_t Size) const; llvm::Type* getPaddingType(uint64_t Align, uint64_t Offset) const; public: - MipsABIInfo(CodeGenTypes &CGT, bool _IsO32) : + MipsABIInfo(CodeGenTypes &CGT, bool _IsO32, bool HasFP64) : ABIInfo(CGT), IsO32(_IsO32), MinABIStackAlignInBytes(IsO32 ? 4 : 8), - StackAlignInBytes(IsO32 ? 8 : 16) {} + StackAlignInBytes(IsO32 && !HasFP64 ? 8 : 16) {} ABIArgInfo classifyReturnType(QualType RetTy) const; ABIArgInfo classifyArgumentType(QualType RetTy, uint64_t &Offset) const; @@ -4662,8 +4662,8 @@ public: class MIPSTargetCodeGenInfo : public TargetCodeGenInfo { unsigned SizeOfUnwindException; public: - MIPSTargetCodeGenInfo(CodeGenTypes &CGT, bool IsO32) - : TargetCodeGenInfo(new MipsABIInfo(CGT, IsO32)), + MIPSTargetCodeGenInfo(CodeGenTypes &CGT, bool IsO32, const TargetInfo &Info) + : TargetCodeGenInfo(new MipsABIInfo(CGT, IsO32, Info.hasFeature("fp64"))), SizeOfUnwindException(IsO32 ? 24 : 32) {} int getDwarfEHStackPointer(CodeGen::CodeGenModule &CGM) const { @@ -5508,12 +5508,12 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() { return *(TheTargetCodeGenInfo = new PNaClTargetCodeGenInfo(Types)); case llvm::Triple::mips: case llvm::Triple::mipsel: - return *(TheTargetCodeGenInfo = new MIPSTargetCodeGenInfo(Types, true)); - + return *(TheTargetCodeGenInfo = new MIPSTargetCodeGenInfo(Types, true, + getTarget())); case llvm::Triple::mips64: case llvm::Triple::mips64el: - return *(TheTargetCodeGenInfo = new MIPSTargetCodeGenInfo(Types, false)); - + return *(TheTargetCodeGenInfo = new MIPSTargetCodeGenInfo(Types, false, + getTarget())); case llvm::Triple::aarch64: return *(TheTargetCodeGenInfo = new AArch64TargetCodeGenInfo(Types)); |