summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatheus Almeida <matheus.almeida@imgtec.com>2014-03-26 14:52:22 +0000
committerMatheus Almeida <matheus.almeida@imgtec.com>2014-03-26 14:52:22 +0000
commit53ccc093bf3d24003fb683adfcf8da59b038919e (patch)
treeaec5c1b839ac2a439ae8ffd9c504a7d5f36a81b4 /lib
parent94708f1784b3a8c85433ac405dd63709b2c419d3 (diff)
downloadllvm-53ccc093bf3d24003fb683adfcf8da59b038919e.tar.gz
llvm-53ccc093bf3d24003fb683adfcf8da59b038919e.tar.bz2
llvm-53ccc093bf3d24003fb683adfcf8da59b038919e.tar.xz
[mips] Add support to '.set mips64r2'.
The '.set mips64r2' directive enables the feature Mips:FeatureMips64r2 from assembly. Note that it doesn't modify the ELF header as opposed to the use of -mips64r2 from the command-line. The reason for this is that we want to be as compatible as possible with existing assemblers like GAS. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204815 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/Mips/AsmParser/MipsAsmParser.cpp6
-rw-r--r--lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp8
-rw-r--r--lib/Target/Mips/MipsTargetStreamer.h3
3 files changed, 17 insertions, 0 deletions
diff --git a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index 4745750944..2244e3dec6 100644
--- a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/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::FeatureMips64r2:
+ setFeatureBits(Mips::FeatureMips64r2, "mips64r2");
+ getTargetStreamer().emitDirectiveSetMips64R2();
+ break;
}
return false;
}
@@ -2522,6 +2526,8 @@ bool MipsAsmParser::parseDirectiveSet() {
return parseSetFeature(Mips::FeatureMicroMips);
} else if (Tok.getString() == "mips32r2") {
return parseSetFeature(Mips::FeatureMips32r2);
+ } else if (Tok.getString() == "mips64r2") {
+ return parseSetFeature(Mips::FeatureMips64r2);
} else if (Tok.getString() == "dsp") {
return parseSetFeature(Mips::FeatureDSP);
} else {
diff --git a/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
index afe501b2ea..f21dbed3c8 100644
--- a/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
+++ b/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
@@ -105,6 +105,10 @@ void MipsTargetAsmStreamer::emitDirectiveSetMips32R2() {
OS << "\t.set\tmips32r2\n";
}
+void MipsTargetAsmStreamer::emitDirectiveSetMips64R2() {
+ OS << "\t.set\tmips64r2\n";
+}
+
void MipsTargetAsmStreamer::emitDirectiveSetDsp() {
OS << "\t.set\tdsp\n";
}
@@ -355,6 +359,10 @@ void MipsTargetELFStreamer::emitDirectiveSetMips32R2() {
// No action required for ELF output.
}
+void MipsTargetELFStreamer::emitDirectiveSetMips64R2() {
+ // 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 72d6891e42..e8349a6e3e 100644
--- a/lib/Target/Mips/MipsTargetStreamer.h
+++ b/lib/Target/Mips/MipsTargetStreamer.h
@@ -42,6 +42,7 @@ public:
virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) = 0;
virtual void emitDirectiveSetMips32R2() = 0;
+ virtual void emitDirectiveSetMips64R2() = 0;
virtual void emitDirectiveSetDsp() = 0;
};
@@ -74,6 +75,7 @@ public:
virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff);
virtual void emitDirectiveSetMips32R2();
+ virtual void emitDirectiveSetMips64R2();
virtual void emitDirectiveSetDsp();
};
@@ -115,6 +117,7 @@ public:
virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff);
virtual void emitDirectiveSetMips32R2();
+ virtual void emitDirectiveSetMips64R2();
virtual void emitDirectiveSetDsp();
};
}