summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2014-07-09 13:56:23 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2014-07-09 13:56:23 +0000
commit9500d2d75185d05e45d785050d158acdfa0f34e8 (patch)
treeefa295275592e1cc07790ae5a640a8e26f3fd9a7 /clang/lib
parentcfbb71dfb6464d9d442d6fc2fa0b76ded3981a53 (diff)
downloadbcm5719-llvm-9500d2d75185d05e45d785050d158acdfa0f34e8.tar.gz
bcm5719-llvm-9500d2d75185d05e45d785050d158acdfa0f34e8.zip
[mips][mips64r6] Define _MIPS_FPSET, __mips_fpr, and __mips_nan2008 correctly on MIPS32r6/MIPS64r6
Summary: This removes the need to pass -mnan=2008 explicitly to be able to compile the test-suite for MIPS32r6/MIPS64r6. Differential Revision: http://reviews.llvm.org/D4433 llvm-svn: 212619
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Basic/Targets.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 75e154d7d5e..a38e752c1f9 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -5297,6 +5297,14 @@ public:
IsNan2008(false), IsSingleFloat(false), FloatABI(HardFloat),
DspRev(NoDSP), HasMSA(false), HasFP64(false), ABI(ABIStr) {}
+ bool isNaN2008Default() const {
+ return CPU == "mips32r6" || CPU == "mips64r6";
+ }
+
+ bool isFP64Default() const {
+ return CPU == "mips32r6" || ABI == "n32" || ABI == "n64" || ABI == "64";
+ }
+
StringRef getABI() const override { return ABI; }
bool setCPU(const std::string &Name) override {
bool IsMips32 = getTriple().getArch() == llvm::Triple::mips ||
@@ -5467,11 +5475,11 @@ public:
DiagnosticsEngine &Diags) override {
IsMips16 = false;
IsMicromips = false;
- IsNan2008 = false;
+ IsNan2008 = isNaN2008Default();
IsSingleFloat = false;
FloatABI = HardFloat;
DspRev = NoDSP;
- HasFP64 = ABI == "n32" || ABI == "n64" || ABI == "64";
+ HasFP64 = isFP64Default();
for (std::vector<std::string>::iterator it = Features.begin(),
ie = Features.end(); it != ie; ++it) {
@@ -5495,6 +5503,8 @@ public:
HasFP64 = false;
else if (*it == "+nan2008")
IsNan2008 = true;
+ else if (*it == "-nan2008")
+ IsNan2008 = false;
}
// Remove front-end specific options.
OpenPOWER on IntegriCloud