summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
diff options
context:
space:
mode:
authorJack Carter <jack.carter@imgtec.com>2014-01-22 23:08:42 +0000
committerJack Carter <jack.carter@imgtec.com>2014-01-22 23:08:42 +0000
commit2ccf523ce7f7fc7fe5471c505aafa32d827a8343 (patch)
tree4d486f96003ab5163384d8e1362803f1b870a7e4 /lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
parent9920bd341a7f6ddb887c397d41328848aba43a8d (diff)
downloadllvm-2ccf523ce7f7fc7fe5471c505aafa32d827a8343.tar.gz
llvm-2ccf523ce7f7fc7fe5471c505aafa32d827a8343.tar.bz2
llvm-2ccf523ce7f7fc7fe5471c505aafa32d827a8343.tar.xz
[Mips] TargetStreamer Support for .set mips16.
This patch updates .set mips16 support which affects the ELF ABI and its flags. In addition the patch uses a common interface for both the MipsTargetSteamer and MipsObjectStreamer that the assembler uses for both ELF and ASCII output for these directives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199851 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp')
-rw-r--r--lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
index 909f9dc159..786edf5d35 100644
--- a/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
+++ b/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
@@ -63,6 +63,12 @@ void MipsTargetAsmStreamer::emitDirectiveAbiCalls() { OS << "\t.abicalls\n"; }
void MipsTargetAsmStreamer::emitDirectiveOptionPic0() {
OS << "\t.option\tpic0\n";
}
+void MipsTargetAsmStreamer::emitDirectiveSetMips16(bool IsMips16) {
+ if (IsMips16)
+ OS << "\t.set\tmips16\n";
+ else
+ OS << "\t.set\tnomips16\n";
+}
// This part is for ELF object output.
MipsTargetELFStreamer::MipsTargetELFStreamer() : MicroMipsEnabled(false) {}
@@ -122,3 +128,13 @@ void MipsTargetELFStreamer::emitDirectiveOptionPic0() {
Flags &= ~ELF::EF_MIPS_PIC;
MCA.setELFHeaderEFlags(Flags);
}
+void MipsTargetELFStreamer::emitDirectiveSetMips16(bool IsMips16) {
+ // Don't do anything for .set nomips16
+ if (!IsMips16)
+ return;
+
+ MCAssembler &MCA = getStreamer().getAssembler();
+ unsigned Flags = MCA.getELFHeaderEFlags();
+ Flags |= ELF::EF_MIPS_ARCH_ASE_M16;
+ MCA.setELFHeaderEFlags(Flags);
+}