diff options
author | Matheus Almeida <matheus.almeida@imgtec.com> | 2014-03-26 15:14:32 +0000 |
---|---|---|
committer | Matheus Almeida <matheus.almeida@imgtec.com> | 2014-03-26 15:14:32 +0000 |
commit | 3b9c63d29b04c005014a66d23caf5d0c77147ab5 (patch) | |
tree | 004ae4757538975730b887671cb4d41fdd6c8ad9 /llvm/lib/Target | |
parent | 99974c7242208e0bcdd6474cecabd4682fb03e36 (diff) | |
download | bcm5719-llvm-3b9c63d29b04c005014a66d23caf5d0c77147ab5.tar.gz bcm5719-llvm-3b9c63d29b04c005014a66d23caf5d0c77147ab5.zip |
[mips] Add support to '.set mips64'.
The '.set mips64' directive enables the feature Mips:FeatureMips64
from assembly. Note that it doesn't modify the ELF header as opposed
to the use of -mips64 from the command-line. The reason for this
is that we want to be as compatible as possible with existing assemblers
like GAS.
llvm-svn: 204817
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/Target/Mips/MipsTargetStreamer.h | 3 |
3 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 2244e3dec64..35c1f4bf4f5 100644 --- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -2489,6 +2489,10 @@ bool MipsAsmParser::parseSetFeature(uint64_t Feature) { setFeatureBits(Mips::FeatureMips32r2, "mips32r2"); getTargetStreamer().emitDirectiveSetMips32R2(); break; + case Mips::FeatureMips64: + setFeatureBits(Mips::FeatureMips64, "mips64"); + getTargetStreamer().emitDirectiveSetMips64(); + break; case Mips::FeatureMips64r2: setFeatureBits(Mips::FeatureMips64r2, "mips64r2"); getTargetStreamer().emitDirectiveSetMips64R2(); @@ -2526,6 +2530,8 @@ bool MipsAsmParser::parseDirectiveSet() { return parseSetFeature(Mips::FeatureMicroMips); } else if (Tok.getString() == "mips32r2") { return parseSetFeature(Mips::FeatureMips32r2); + } else if (Tok.getString() == "mips64") { + return parseSetFeature(Mips::FeatureMips64); } else if (Tok.getString() == "mips64r2") { return parseSetFeature(Mips::FeatureMips64r2); } else if (Tok.getString() == "dsp") { diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp index f21dbed3c8a..01730dd773c 100644 --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp @@ -105,6 +105,10 @@ void MipsTargetAsmStreamer::emitDirectiveSetMips32R2() { OS << "\t.set\tmips32r2\n"; } +void MipsTargetAsmStreamer::emitDirectiveSetMips64() { + OS << "\t.set\tmips64\n"; +} + void MipsTargetAsmStreamer::emitDirectiveSetMips64R2() { OS << "\t.set\tmips64r2\n"; } @@ -359,6 +363,10 @@ void MipsTargetELFStreamer::emitDirectiveSetMips32R2() { // No action required for ELF output. } +void MipsTargetELFStreamer::emitDirectiveSetMips64() { + // No action required for ELF output. +} + void MipsTargetELFStreamer::emitDirectiveSetMips64R2() { // No action required for ELF output. } diff --git a/llvm/lib/Target/Mips/MipsTargetStreamer.h b/llvm/lib/Target/Mips/MipsTargetStreamer.h index e8349a6e3e7..5f4b74b3ba0 100644 --- a/llvm/lib/Target/Mips/MipsTargetStreamer.h +++ b/llvm/lib/Target/Mips/MipsTargetStreamer.h @@ -42,6 +42,7 @@ public: virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) = 0; virtual void emitDirectiveSetMips32R2() = 0; + virtual void emitDirectiveSetMips64() = 0; virtual void emitDirectiveSetMips64R2() = 0; virtual void emitDirectiveSetDsp() = 0; }; @@ -75,6 +76,7 @@ public: virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff); virtual void emitDirectiveSetMips32R2(); + virtual void emitDirectiveSetMips64(); virtual void emitDirectiveSetMips64R2(); virtual void emitDirectiveSetDsp(); }; @@ -117,6 +119,7 @@ public: virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff); virtual void emitDirectiveSetMips32R2(); + virtual void emitDirectiveSetMips64(); virtual void emitDirectiveSetMips64R2(); virtual void emitDirectiveSetDsp(); }; |