[llvm] r204815 - [mips] Add support to '.set mips64r2'.
Matheus Almeida
matheus.almeida at imgtec.com
Wed Mar 26 07:52:23 PDT 2014
Author: matheusalmeida
Date: Wed Mar 26 09:52:22 2014
New Revision: 204815
URL: http://llvm.org/viewvc/llvm-project?rev=204815&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
llvm/trunk/lib/Target/Mips/MipsTargetStreamer.h
llvm/trunk/test/MC/Mips/mips_directives.s
Modified: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=204815&r1=204814&r2=204815&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Wed Mar 26 09:52:22 2014
@@ -2489,6 +2489,10 @@ bool MipsAsmParser::parseSetFeature(uint
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 {
Modified: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp?rev=204815&r1=204814&r2=204815&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp Wed Mar 26 09:52:22 2014
@@ -105,6 +105,10 @@ void MipsTargetAsmStreamer::emitDirectiv
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::emitDirectiv
// No action required for ELF output.
}
+void MipsTargetELFStreamer::emitDirectiveSetMips64R2() {
+ // No action required for ELF output.
+}
+
void MipsTargetELFStreamer::emitDirectiveSetDsp() {
// No action required for ELF output.
}
Modified: llvm/trunk/lib/Target/Mips/MipsTargetStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetStreamer.h?rev=204815&r1=204814&r2=204815&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsTargetStreamer.h (original)
+++ llvm/trunk/lib/Target/Mips/MipsTargetStreamer.h Wed Mar 26 09:52:22 2014
@@ -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();
};
}
Modified: llvm/trunk/test/MC/Mips/mips_directives.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mips_directives.s?rev=204815&r1=204814&r2=204815&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/mips_directives.s (original)
+++ llvm/trunk/test/MC/Mips/mips_directives.s Wed Mar 26 09:52:22 2014
@@ -65,6 +65,11 @@ $BB0_4:
luxc1 $f0, $6($5)
lwxc1 $f6, $2($5)
+# CHECK: .set mips64r2
+# CHECK: drotr $9, $6, 30 # encoding: [0x00,0x26,0x4f,0xba]
+ .set mips64r2
+ drotr $9, $6, 30
+
# CHECK: .set dsp
# CHECK: lbux $7, $10($11) # encoding: [0x7d,0x6a,0x39,0x8a]
# CHECK: lhx $5, $6($7) # encoding: [0x7c,0xe6,0x29,0x0a]
More information about the llvm-commits
mailing list