r212339 - [Driver][Mips] Support one more MIPS CPU name - octeon.
Simon Atanasyan
simon at atanasyan.com
Fri Jul 4 05:37:05 PDT 2014
Author: atanasyan
Date: Fri Jul 4 07:37:04 2014
New Revision: 212339
URL: http://llvm.org/viewvc/llvm-project?rev=212339&view=rev
Log:
[Driver][Mips] Support one more MIPS CPU name - octeon.
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/test/Driver/mips-abi.c
cfe/trunk/test/Driver/mips-as.c
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=212339&r1=212338&r2=212339&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Fri Jul 4 07:37:04 2014
@@ -5320,6 +5320,7 @@ public:
.Case("mips64", true)
.Case("mips64r2", true)
.Case("mips64r6", true)
+ .Case("octeon", true)
.Default(false);
}
const std::string& getCPU() const { return CPU; }
@@ -5332,7 +5333,10 @@ public:
Features["n64"] = false;
Features[ABI] = true;
- Features[CPU] = true;
+ if (CPU == "octeon")
+ Features["mips64r2"] = Features["cnmips"] = true;
+ else
+ Features[CPU] = true;
}
void getTargetDefines(const LangOptions &Opts,
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=212339&r1=212338&r2=212339&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Fri Jul 4 07:37:04 2014
@@ -1633,7 +1633,8 @@ static bool isMips64r2(const ArgList &Ar
Arg *A = Args.getLastArg(options::OPT_march_EQ,
options::OPT_mcpu_EQ);
- return A && A->getValue() == StringRef("mips64r2");
+ return A && (A->getValue() == StringRef("mips64r2") ||
+ A->getValue() == StringRef("octeon"));
}
static bool isMicroMips(const ArgList &Args) {
Modified: cfe/trunk/test/Driver/mips-abi.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mips-abi.c?rev=212339&r1=212338&r2=212339&view=diff
==============================================================================
--- cfe/trunk/test/Driver/mips-abi.c (original)
+++ cfe/trunk/test/Driver/mips-abi.c Fri Jul 4 07:37:04 2014
@@ -116,6 +116,12 @@
// MIPS-ARCH-64R2: "-target-cpu" "mips64r2"
// MIPS-ARCH-64R2: "-target-abi" "n64"
//
+// RUN: %clang -target mips64-linux-gnu -### -c %s \
+// RUN: -march=octeon 2>&1 \
+// RUN: | FileCheck -check-prefix=MIPS-ARCH-OCTEON %s
+// MIPS-ARCH-OCTEON: "-target-cpu" "octeon"
+// MIPS-ARCH-OCTEON: "-target-abi" "n64"
+//
// RUN: not %clang -target mips64-linux-gnu -c %s \
// RUN: -march=mips32 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS-ARCH-6432 %s
Modified: cfe/trunk/test/Driver/mips-as.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mips-as.c?rev=212339&r1=212338&r2=212339&view=diff
==============================================================================
--- cfe/trunk/test/Driver/mips-as.c (original)
+++ cfe/trunk/test/Driver/mips-as.c Fri Jul 4 07:37:04 2014
@@ -52,6 +52,11 @@
// RUN: | FileCheck -check-prefix=MIPS-32R2 %s
// MIPS-32R2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-EB"
//
+// RUN: %clang -target mips64-linux-gnu -march=octeon -### \
+// RUN: -no-integrated-as -c %s 2>&1 \
+// RUN: | FileCheck -check-prefix=MIPS-OCTEON %s
+// MIPS-OCTEON: as{{(.exe)?}}" "-march" "octeon" "-mabi" "64" "-EB"
+//
// RUN: %clang -target mips-linux-gnu -mips1 -### \
// RUN: -no-integrated-as -c %s 2>&1 \
// RUN: | FileCheck -check-prefix=MIPS-ALIAS-1 %s
More information about the cfe-commits
mailing list