diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index aaf5a8a794e5..f79aec3c5c7e 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/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/clang/test/CodeGen/mips-target-data.c b/clang/test/CodeGen/mips-target-data.c new file mode 100644 index 000000000000..88eadcb13d6b --- /dev/null +++ b/clang/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 +