[Driver][Mips] Support one more MIPS CPU name - octeon.

llvm-svn: 212339
This commit is contained in:
Simon Atanasyan 2014-07-04 12:37:04 +00:00
parent 26610c5960
commit 4e16a4250d
4 changed files with 18 additions and 2 deletions

View File

@ -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,

View File

@ -1633,7 +1633,8 @@ static bool isMips64r2(const ArgList &Args) {
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) {

View File

@ -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

View File

@ -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