summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/AsmParser
diff options
context:
space:
mode:
authorToma Tabacu <toma.tabacu@imgtec.com>2014-09-17 09:01:54 +0000
committerToma Tabacu <toma.tabacu@imgtec.com>2014-09-17 09:01:54 +0000
commit351b2feeb3848a246bfe906225ed3799b86b3299 (patch)
tree41790ad7a820cf1267b56b3da42e58cbc7ebae05 /llvm/lib/Target/Mips/AsmParser
parenta187f791e06d2764c43fd7f5d3f066aaae4563a1 (diff)
downloadbcm5719-llvm-351b2feeb3848a246bfe906225ed3799b86b3299.tar.gz
bcm5719-llvm-351b2feeb3848a246bfe906225ed3799b86b3299.zip
[mips] Add assembler support for the .set nodsp directive.
Summary: This directive is used to tell the assembler to reject DSP-specific instructions. Reviewers: dsanders Reviewed By: dsanders Differential Revision: http://reviews.llvm.org/D5142 llvm-svn: 217946
Diffstat (limited to 'llvm/lib/Target/Mips/AsmParser')
-rw-r--r--llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index 4903dcff0da..5ae753f0a6d 100644
--- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -192,6 +192,7 @@ class MipsAsmParser : public MCTargetAsmParser {
bool parseSetNoMacroDirective();
bool parseSetMsaDirective();
bool parseSetNoMsaDirective();
+ bool parseSetNoDspDirective();
bool parseSetReorderDirective();
bool parseSetNoReorderDirective();
bool parseSetNoMips16Directive();
@@ -2654,6 +2655,20 @@ bool MipsAsmParser::parseSetNoMsaDirective() {
return false;
}
+bool MipsAsmParser::parseSetNoDspDirective() {
+ Parser.Lex(); // Eat "nodsp".
+
+ // If this is not the end of the statement, report an error.
+ if (getLexer().isNot(AsmToken::EndOfStatement)) {
+ reportParseError("unexpected token, expected end of statement");
+ return false;
+ }
+
+ clearFeatureBits(Mips::FeatureDSP, "dsp");
+ getTargetStreamer().emitDirectiveSetNoDsp();
+ return false;
+}
+
bool MipsAsmParser::parseSetNoMips16Directive() {
Parser.Lex();
// If this is not the end of the statement, report an error.
@@ -3037,6 +3052,8 @@ bool MipsAsmParser::parseDirectiveSet() {
return parseSetFeature(Mips::FeatureMips64r6);
} else if (Tok.getString() == "dsp") {
return parseSetFeature(Mips::FeatureDSP);
+ } else if (Tok.getString() == "nodsp") {
+ return parseSetNoDspDirective();
} else if (Tok.getString() == "msa") {
return parseSetMsaDirective();
} else if (Tok.getString() == "nomsa") {
OpenPOWER on IntegriCloud