r208220 - [mips] Pass nan2008 info to the back-end.
Matheus Almeida
matheus.almeida at imgtec.com
Wed May 7 09:16:07 PDT 2014
Author: matheusalmeida
Date: Wed May 7 11:16:07 2014
New Revision: 208220
URL: http://llvm.org/viewvc/llvm-project?rev=208220&view=rev
Log:
[mips] Pass nan2008 info to the back-end.
Summary: The initial support for NaN2008 was added to the back-end in r206396.
Reviewers: atanasyan
Reviewed By: atanasyan
Differential Revision: http://reviews.llvm.org/D3448
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/mips-features.c
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=208220&r1=208219&r2=208220&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed May 7 11:16:07 2014
@@ -5669,9 +5669,6 @@ public:
std::find(Features.begin(), Features.end(), "+soft-float");
if (it != Features.end())
Features.erase(it);
- it = std::find(Features.begin(), Features.end(), "+nan2008");
- if (it != Features.end())
- Features.erase(it);
setDescriptionString();
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=208220&r1=208219&r2=208220&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed May 7 11:16:07 2014
@@ -1037,8 +1037,14 @@ static void getMIPSTargetFeatures(const
}
if (Arg *A = Args.getLastArg(options::OPT_mnan_EQ)) {
- if (StringRef(A->getValue()) == "2008")
+ StringRef Val = StringRef(A->getValue());
+ if (Val == "2008")
Features.push_back("+nan2008");
+ else if (Val == "legacy")
+ Features.push_back("-nan2008");
+ else
+ D.Diag(diag::err_drv_unsupported_option_argument)
+ << A->getOption().getName() << Val;
}
AddTargetFeature(Args, Features, options::OPT_msingle_float,
Modified: cfe/trunk/test/Driver/mips-features.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mips-features.c?rev=208220&r1=208219&r2=208220&view=diff
==============================================================================
--- cfe/trunk/test/Driver/mips-features.c (original)
+++ cfe/trunk/test/Driver/mips-features.c Wed May 7 11:16:07 2014
@@ -72,6 +72,18 @@
// RUN: | FileCheck --check-prefix=CHECK-NOMFP64 %s
// CHECK-NOMFP64: "-target-feature" "-fp64"
//
+// -mnan=2008
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN: -mnan=legacy -mnan=2008 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NAN2008 %s
+// CHECK-NAN2008: "-target-feature" "+nan2008"
+//
+// -mnan=legacy
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN: -mnan=2008 -mnan=legacy 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NANLEGACY %s
+// CHECK-NANLEGACY: "-target-feature" "-nan2008"
+//
// -mxgot
// RUN: %clang -target mips-linux-gnu -### -c %s \
// RUN: -mno-xgot -mxgot 2>&1 \
More information about the cfe-commits
mailing list