diff options
author | Toma Tabacu <toma.tabacu@imgtec.com> | 2015-05-07 10:29:52 +0000 |
---|---|---|
committer | Toma Tabacu <toma.tabacu@imgtec.com> | 2015-05-07 10:29:52 +0000 |
commit | 506cfd0b2b9d65d584aaff2e8ac69ca76beb1f54 (patch) | |
tree | 9a5bee5c05d0f9ba7a27ccc0f11db50aedd24b5c /llvm/lib/Target/Mips/MipsTargetMachine.cpp | |
parent | 2ce89617c9f9bb536cdf2366082e20b86ba9e2b9 (diff) | |
download | llvm-506cfd0b2b9d65d584aaff2e8ac69ca76beb1f54.zip llvm-506cfd0b2b9d65d584aaff2e8ac69ca76beb1f54.tar.gz llvm-506cfd0b2b9d65d584aaff2e8ac69ca76beb1f54.tar.bz2 |
[mips] Add the SoftFloat MipsSubtarget feature.
Summary: This will enable the IAS to reject floating point instructions if soft-float is enabled.
Reviewers: dsanders, echristo
Reviewed By: dsanders
Subscribers: jfb, llvm-commits, mpf
Differential Revision: http://reviews.llvm.org/D9053
llvm-svn: 236713
Diffstat (limited to 'llvm/lib/Target/Mips/MipsTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/Mips/MipsTargetMachine.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Target/Mips/MipsTargetMachine.cpp b/llvm/lib/Target/Mips/MipsTargetMachine.cpp index 79f6617..4d05eb84 100644 --- a/llvm/lib/Target/Mips/MipsTargetMachine.cpp +++ b/llvm/lib/Target/Mips/MipsTargetMachine.cpp @@ -139,9 +139,7 @@ MipsTargetMachine::getSubtargetImpl(const Function &F) const { // FIXME: This is related to the code below to reset the target options, // we need to know whether or not the soft float flag is set on the - // function before we can generate a subtarget. We also need to use - // it as a key for the subtarget since that can be the only difference - // between two functions. + // function, so we can enable it as a subtarget feature. Attribute SFAttr = F.getFnAttribute("use-soft-float"); bool softFloat = !SFAttr.hasAttribute(Attribute::None) ? SFAttr.getValueAsString() == "true" @@ -151,9 +149,10 @@ MipsTargetMachine::getSubtargetImpl(const Function &F) const { FS += FS.empty() ? "+mips16" : ",+mips16"; else if (hasNoMips16Attr) FS += FS.empty() ? "-mips16" : ",-mips16"; + if (softFloat) + FS += FS.empty() ? "+soft-float" : ",+soft-float"; - auto &I = SubtargetMap[CPU + FS + (softFloat ? "use-soft-float=true" - : "use-soft-float=false")]; + auto &I = SubtargetMap[CPU + FS]; if (!I) { // This needs to be done before we create a new subtarget since any // creation will depend on the TM and the code generation flags on the |