From: Akira Hatanaka Date: Sat, 5 Jan 2013 02:04:34 +0000 (+0000) Subject: [mips] Fix data layout string. Add 64 to the list of native integer widths X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=390a70f718871933cbfd751f8c3dfde28a762a18;p=clang [mips] Fix data layout string. Add 64 to the list of native integer widths and add stack alignment information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171588 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index aaf5a8a794..f79aec3c5c 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -4194,7 +4194,7 @@ class Mips32EBTargetInfo : public Mips32TargetInfoBase { public: Mips32EBTargetInfo(const std::string& triple) : Mips32TargetInfoBase(triple) { 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"; + "i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S64"; } virtual void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const { @@ -4209,7 +4209,7 @@ public: Mips32ELTargetInfo(const std::string& triple) : Mips32TargetInfoBase(triple) { BigEndian = false; 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"; + "i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S64"; } virtual void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const { @@ -4315,14 +4315,14 @@ class Mips64EBTargetInfo : public Mips64TargetInfoBase { if (Name == "n32") 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-f128:128:128-" - "v64:64:64-n32"; + "v64:64:64-n32:64-S128"; } public: Mips64EBTargetInfo(const std::string& triple) : Mips64TargetInfoBase(triple) { // Default ABI is n64. DescriptionString = "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"; + "v64:64:64-n32:64-S128"; } virtual void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const { @@ -4338,7 +4338,7 @@ class Mips64ELTargetInfo : public Mips64TargetInfoBase { if (Name == "n32") 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-f128:128:128" - "-v64:64:64-n32"; + "-v64:64:64-n32:64-S128"; } public: Mips64ELTargetInfo(const std::string& triple) : Mips64TargetInfoBase(triple) { @@ -4346,7 +4346,7 @@ public: BigEndian = false; DescriptionString = "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"; + "v64:64:64-n32:64-S128"; } virtual void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const { diff --git a/test/CodeGen/mips-target-data.c b/test/CodeGen/mips-target-data.c new file mode 100644 index 0000000000..88eadcb13d --- /dev/null +++ b/test/CodeGen/mips-target-data.c @@ -0,0 +1,14 @@ +// RUN: %clang -target mipsel-linux-gnu -o - -emit-llvm -S %s |\ +// RUN: FileCheck %s -check-prefix=32EL +// RUN: %clang -target mips-linux-gnu -o - -emit-llvm -S %s |\ +// RUN: FileCheck %s -check-prefix=32EB +// RUN: %clang -target mips64el-linux-gnu -o - -emit-llvm -S %s |\ +// RUN: FileCheck %s -check-prefix=64EL +// RUN: %clang -target mips64-linux-gnu -o - -emit-llvm -S %s |\ +// RUN: FileCheck %s -check-prefix=64EB + +// 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 +