diff options
author | Vladimir Medic <Vladimir.Medic@imgtec.com> | 2014-03-05 11:05:09 +0000 |
---|---|---|
committer | Vladimir Medic <Vladimir.Medic@imgtec.com> | 2014-03-05 11:05:09 +0000 |
commit | 6844c3f234517ac4afb5233d8b35279435dbfc4b (patch) | |
tree | 5d481795ee33f1823ac3c8606ce5e8bcf093100a /lib | |
parent | da55d20166a558c8b1a9b74f274c91a86245765c (diff) | |
download | llvm-6844c3f234517ac4afb5233d8b35279435dbfc4b.tar.gz llvm-6844c3f234517ac4afb5233d8b35279435dbfc4b.tar.bz2 llvm-6844c3f234517ac4afb5233d8b35279435dbfc4b.tar.xz |
This patch implements .set dsp directive and sets appropriate feature bits.This directive is a counterpart of -mattr=dsp command line option with the exception that it does not influence elf header flags. The usage example is gives in test file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202966 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 7 | ||||
-rw-r--r-- | lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp | 7 | ||||
-rw-r--r-- | lib/Target/Mips/MipsTargetStreamer.h | 3 |
3 files changed, 17 insertions, 0 deletions
diff --git a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index c6bee6302d..d010a97ca5 100644 --- a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -2460,6 +2460,13 @@ bool MipsAsmParser::parseDirectiveSet() { setFeatureBits(Mips::FeatureMips32r2,"mips32r2"); getTargetStreamer().emitDirectiveSetMips32R2(); return false; + } else if (Tok.getString() == "dsp") { + Parser.Lex(); // Eat token. + if (getLexer().isNot(AsmToken::EndOfStatement)) + return reportParseError("unexpected token in .set directive"); + setFeatureBits(Mips::FeatureDSP, "dsp"); + getTargetStreamer().emitDirectiveSetDsp(); + return false; } else { // It is just an identifier, look for an assignment. parseSetAssignment(); diff --git a/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp index ef6d8d40e3..e9ce4b8bf2 100644 --- a/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp +++ b/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp @@ -101,6 +101,9 @@ void MipsTargetAsmStreamer::emitDirectiveSetMips32R2() { OS << "\t.set\tmips32r2\n"; } +void MipsTargetAsmStreamer::emitDirectiveSetDsp() { + OS << "\t.set\tdsp\n"; +} // Print a 32 bit hex number with all numbers. static void printHex32(unsigned Value, raw_ostream &OS) { OS << "0x"; @@ -310,3 +313,7 @@ void MipsTargetELFStreamer::emitFMask(unsigned FPUBitmask, void MipsTargetELFStreamer::emitDirectiveSetMips32R2() { // No action required for ELF output. } + +void MipsTargetELFStreamer::emitDirectiveSetDsp() { + // No action required for ELF output. +} diff --git a/lib/Target/Mips/MipsTargetStreamer.h b/lib/Target/Mips/MipsTargetStreamer.h index b1132676a9..7917b77ced 100644 --- a/lib/Target/Mips/MipsTargetStreamer.h +++ b/lib/Target/Mips/MipsTargetStreamer.h @@ -41,6 +41,7 @@ public: virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) = 0; virtual void emitDirectiveSetMips32R2() = 0; + virtual void emitDirectiveSetDsp() = 0; }; // This part is for ascii assembly output @@ -71,6 +72,7 @@ public: virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff); virtual void emitDirectiveSetMips32R2(); + virtual void emitDirectiveSetDsp(); }; // This part is for ELF object output @@ -108,6 +110,7 @@ public: virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff); virtual void emitDirectiveSetMips32R2(); + virtual void emitDirectiveSetDsp(); }; } #endif |