From: Akira Hatanaka Date: Mon, 11 Nov 2013 22:10:46 +0000 (+0000) Subject: [mips] Partially revert r193640. Stack alignment should not be determined by X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dda91e0c4b794b1054a6672a6267942ec72d387f;p=clang [mips] Partially revert r193640. Stack alignment should not be determined by the floating point register mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194426 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 42d48ea48d..618ea4828c 100644 --- a/lib/Basic/Targets.cpp +++ b/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/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 7d7f7b7dda..1412bc279a 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/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/test/CodeGen/mips-target-data.c b/test/CodeGen/mips-target-data.c index fa03fb78ed..6475ccb4d2 100644 --- a/test/CodeGen/mips-target-data.c +++ b/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/test/CodeGen/mips64-padding-arg.c b/test/CodeGen/mips64-padding-arg.c index 2d635c332f..49a29c1efb 100644 --- a/test/CodeGen/mips64-padding-arg.c +++ b/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;