diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2013-11-11 22:10:46 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2013-11-11 22:10:46 +0000 |
commit | c4baedd71ddd480cfb21cfbbfde6c53f7edb2bb6 (patch) | |
tree | 16e2ba5111ee6e7ea79c3ebdfa321093c2b766f5 | |
parent | f143af3fe951e086b7c158213e6e113c73835723 (diff) | |
download | bcm5719-llvm-c4baedd71ddd480cfb21cfbbfde6c53f7edb2bb6.tar.gz bcm5719-llvm-c4baedd71ddd480cfb21cfbbfde6c53f7edb2bb6.zip |
[mips] Partially revert r193640. Stack alignment should not be determined by
the floating point register mode.
llvm-svn: 194426
-rw-r--r-- | clang/lib/Basic/Targets.cpp | 16 | ||||
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 16 | ||||
-rw-r--r-- | clang/test/CodeGen/mips-target-data.c | 3 | ||||
-rw-r--r-- | clang/test/CodeGen/mips64-padding-arg.c | 4 |
4 files changed, 14 insertions, 25 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 42d48ea48d9..618ea4828ca 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -5099,12 +5099,8 @@ public: class Mips32EBTargetInfo : public Mips32TargetInfoBase { virtual void setDescriptionString() { - if (HasFP64) - DescriptionString = "E-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-" - "i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S128"; - else - DescriptionString = "E-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-" - "i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S64"; + DescriptionString = "E-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-" + "i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S64"; } public: @@ -5121,12 +5117,8 @@ public: class Mips32ELTargetInfo : public Mips32TargetInfoBase { virtual void setDescriptionString() { - if (HasFP64) - DescriptionString = "e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-" - "i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S128"; - else - DescriptionString = "e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-" - "i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S64"; + DescriptionString = "e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-" + "i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S64"; } public: diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index 7d7f7b7dda8..1412bc279ae 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -4647,9 +4647,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, bool HasFP64) : + MipsABIInfo(CodeGenTypes &CGT, bool _IsO32) : ABIInfo(CGT), IsO32(_IsO32), MinABIStackAlignInBytes(IsO32 ? 4 : 8), - StackAlignInBytes(IsO32 && !HasFP64 ? 8 : 16) {} + StackAlignInBytes(IsO32 ? 8 : 16) {} ABIArgInfo classifyReturnType(QualType RetTy) const; ABIArgInfo classifyArgumentType(QualType RetTy, uint64_t &Offset) const; @@ -4661,8 +4661,8 @@ public: class MIPSTargetCodeGenInfo : public TargetCodeGenInfo { unsigned SizeOfUnwindException; public: - MIPSTargetCodeGenInfo(CodeGenTypes &CGT, bool IsO32, const TargetInfo &Info) - : TargetCodeGenInfo(new MipsABIInfo(CGT, IsO32, Info.hasFeature("fp64"))), + MIPSTargetCodeGenInfo(CodeGenTypes &CGT, bool IsO32) + : TargetCodeGenInfo(new MipsABIInfo(CGT, IsO32)), SizeOfUnwindException(IsO32 ? 24 : 32) {} int getDwarfEHStackPointer(CodeGen::CodeGenModule &CGM) const { @@ -5507,12 +5507,12 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() { return *(TheTargetCodeGenInfo = new PNaClTargetCodeGenInfo(Types)); case llvm::Triple::mips: case llvm::Triple::mipsel: - return *(TheTargetCodeGenInfo = new MIPSTargetCodeGenInfo(Types, true, - getTarget())); + return *(TheTargetCodeGenInfo = new MIPSTargetCodeGenInfo(Types, true)); + case llvm::Triple::mips64: case llvm::Triple::mips64el: - return *(TheTargetCodeGenInfo = new MIPSTargetCodeGenInfo(Types, false, - getTarget())); + return *(TheTargetCodeGenInfo = new MIPSTargetCodeGenInfo(Types, false)); + case llvm::Triple::aarch64: return *(TheTargetCodeGenInfo = new AArch64TargetCodeGenInfo(Types)); diff --git a/clang/test/CodeGen/mips-target-data.c b/clang/test/CodeGen/mips-target-data.c index fa03fb78ed6..6475ccb4d27 100644 --- a/clang/test/CodeGen/mips-target-data.c +++ b/clang/test/CodeGen/mips-target-data.c @@ -7,11 +7,10 @@ // RUN: %clang -target mips64-linux-gnu -o - -emit-llvm -S %s |\ // RUN: FileCheck %s -check-prefix=64EB // RUN: %clang -target mipsel-linux-gnu -o - -emit-llvm -S -mfp64 %s |\ -// RUN: FileCheck %s -check-prefix=32EL-FP64 +// RUN: FileCheck %s -check-prefix=32EL // 32EL: e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S64 // 32EB: E-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S64 // 64EL: e-p:64:64:64-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v64:64:64-n32:64-S128 // 64EB: E-p:64:64:64-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v64:64:64-n32:64-S128 -// 32EL-FP64: e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S128 diff --git a/clang/test/CodeGen/mips64-padding-arg.c b/clang/test/CodeGen/mips64-padding-arg.c index 2d635c332f2..49a29c1efb3 100644 --- a/clang/test/CodeGen/mips64-padding-arg.c +++ b/clang/test/CodeGen/mips64-padding-arg.c @@ -1,6 +1,6 @@ // RUN: %clang -target mipsel-unknown-linux -O3 -S -o - -emit-llvm %s | FileCheck %s -check-prefix=O32 // RUN: %clang -target mips64el-unknown-linux -O3 -S -mabi=n64 -o - -emit-llvm %s | FileCheck %s -check-prefix=N64 -// RUN: %clang -target mipsel-unknown-linux -mfp64 -O3 -S -o - -emit-llvm %s | FileCheck %s -check-prefix=O32-FP64 +// RUN: %clang -target mipsel-unknown-linux -mfp64 -O3 -S -o - -emit-llvm %s | FileCheck %s -check-prefix=O32 typedef struct { double d; @@ -56,8 +56,6 @@ void foo7(float a0, double a1) { // O32-LABEL: define void @foo9() // O32: declare void @foo10(i32, i32 -// O32-FP64-LABEL: define void @foo9() -// O32-FP64: declare void @foo10(i32, i96 typedef struct __attribute__((aligned(16))) { int a; |