<p dir="ltr"><br>
On 4 Aug 2014 13:31, "Daniel Sanders" <<a href="mailto:daniel.sanders@imgtec.com">daniel.sanders@imgtec.com</a>> wrote:<br>
><br>
> Author: dsanders<br>
> Date: Mon Aug 4 07:20:00 2014<br>
> New Revision: 214709<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=214709&view=rev">http://llvm.org/viewvc/llvm-project?rev=214709&view=rev</a><br>
> Log:<br>
> [mips] Add assembler support for '.set mipsX'.<br>
><br>
> Summary:<br>
> This patch also fixes an issue with the way the Mips assembler enables/disables architecture<br>
> features. Before this patch, the assembler never disabled feature bits. For example,<br>
> .set mips64<br>
> .set mips32r2<br>
><br>
> would result in the 'OR' of mips64 with mips32r2 feature bits which isn't right.<br>
> Unfortunately this isn't trivial to fix because there's not an easy way to clear<br>
> feature bits as the algorithm in MCSubtargetInfo (ToggleFeature) only clears the bits<br>
> that imply the feature being cleared and not the implied bits by the feature (there's a<br>
> better explanation to the code I added).<br>
><br>
> Patch by Matheus Almeida and updated by Toma Tabacu<br>
><br>
> Reviewers: vmedic, matheusalmeida, dsanders<br>
><br>
> Reviewed By: dsanders<br>
><br>
> Subscribers: tomatabacu, llvm-commits<br>
><br>
> Differential Revision: <a href="http://reviews.llvm.org/D4123">http://reviews.llvm.org/D4123</a><br>
><br>
> Added:<br>
> llvm/trunk/test/MC/Mips/set-mips-directives-bad.s<br>
> llvm/trunk/test/MC/Mips/set-mips-directives.s<br>
> Modified:<br>
> llvm/trunk/include/llvm/MC/MCSubtargetInfo.h<br>
> llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp<br>
> llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp<br>
> llvm/trunk/lib/Target/Mips/MipsTargetStreamer.h<br>
><br>
> Modified: llvm/trunk/include/llvm/MC/MCSubtargetInfo.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSubtargetInfo.h?rev=214709&r1=214708&r2=214709&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSubtargetInfo.h?rev=214709&r1=214708&r2=214709&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/MC/MCSubtargetInfo.h (original)<br>
> +++ llvm/trunk/include/llvm/MC/MCSubtargetInfo.h Mon Aug 4 07:20:00 2014<br>
> @@ -65,6 +65,10 @@ public:<br>
> return FeatureBits;<br>
> }<br>
><br>
> + /// setFeatureBits - Set the feature bits.<br>
> + ///<br>
> + void setFeatureBits(uint64_t _FeatureBits) { FeatureBits = _FeatureBits; }</p>
<p dir="ltr">Shouldn't this be FeatureBits_?<br>
In the n337.pdf of C++11, 17.6.4.3.2 says that names beginning with _ and then a capital letter are reserved.</p>
<p dir="ltr">> +<br>
> /// InitMCProcessorInfo - Set or change the CPU (optionally supplemented with<br>
> /// feature string). Recompute feature bits and scheduling model.<br>
> void InitMCProcessorInfo(StringRef CPU, StringRef FS);<br>
><br>
> Modified: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=214709&r1=214708&r2=214709&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=214709&r1=214708&r2=214709&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)<br>
> +++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Mon Aug 4 07:20:00 2014<br>
> @@ -51,6 +51,20 @@ public:<br>
> void setMacro() { macro = true; }<br>
> void setNomacro() { macro = false; }<br>
><br>
> + // Set of features that are either architecture features or referenced<br>
> + // by them (e.g.: FeatureNaN2008 implied by FeatureMips32r6).<br>
> + // The full table can be found in MipsGenSubtargetInfo.inc (MipsFeatureKV[]).<br>
> + // The reason we need this mask is explained in the selectArch function.<br>
> + // FIXME: Ideally we would like TableGen to generate this information.<br>
> + static const uint64_t AllArchRelatedMask =<br>
> + Mips::FeatureMips1 | Mips::FeatureMips2 | Mips::FeatureMips3 |<br>
> + Mips::FeatureMips3_32 | Mips::FeatureMips3_32r2 | Mips::FeatureMips4 |<br>
> + Mips::FeatureMips4_32 | Mips::FeatureMips4_32r2 | Mips::FeatureMips5 |<br>
> + Mips::FeatureMips5_32r2 | Mips::FeatureMips32 | Mips::FeatureMips32r2 |<br>
> + Mips::FeatureMips32r6 | Mips::FeatureMips64 | Mips::FeatureMips64r2 |<br>
> + Mips::FeatureMips64r6 | Mips::FeatureCnMips | Mips::FeatureFP64Bit |<br>
> + Mips::FeatureGP64Bit | Mips::FeatureNaN2008;<br>
> +<br>
> private:<br>
> unsigned aTReg;<br>
> bool reorder;<br>
> @@ -200,6 +214,36 @@ class MipsAsmParser : public MCTargetAsm<br>
> // Example: INSERT.B $w0[n], $1 => 16 > n >= 0<br>
> bool validateMSAIndex(int Val, int RegKind);<br>
><br>
> + // Selects a new architecture by updating the FeatureBits with the necessary<br>
> + // info including implied dependencies.<br>
> + // Internally, it clears all the feature bits related to *any* architecture<br>
> + // and selects the new one using the ToggleFeature functionality of the<br>
> + // MCSubtargetInfo object that handles implied dependencies. The reason we<br>
> + // clear all the arch related bits manually is because ToggleFeature only<br>
> + // clears the features that imply the feature being cleared and not the<br>
> + // features implied by the feature being cleared. This is easier to see<br>
> + // with an example:<br>
> + // --------------------------------------------------<br>
> + // | Feature | Implies |<br>
> + // | -------------------------------------------------|<br>
> + // | FeatureMips1 | None |<br>
> + // | FeatureMips2 | FeatureMips1 |<br>
> + // | FeatureMips3 | FeatureMips2 | FeatureMipsGP64 |<br>
> + // | FeatureMips4 | FeatureMips3 |<br>
> + // | ... | |<br>
> + // --------------------------------------------------<br>
> + //<br>
> + // Setting Mips3 is equivalent to set: (FeatureMips3 | FeatureMips2 |<br>
> + // FeatureMipsGP64 | FeatureMips1)<br>
> + // Clearing Mips3 is equivalent to clear (FeatureMips3 | FeatureMips4).<br>
> + void selectArch(StringRef ArchFeature) {<br>
> + uint64_t FeatureBits = STI.getFeatureBits();<br>
> + FeatureBits &= ~MipsAssemblerOptions::AllArchRelatedMask;<br>
> + STI.setFeatureBits(FeatureBits);<br>
> + setAvailableFeatures(<br>
> + ComputeAvailableFeatures(STI.ToggleFeature(ArchFeature)));<br>
> + }<br>
> +<br>
> void setFeatureBits(unsigned Feature, StringRef FeatureString) {<br>
> if (!(STI.getFeatureBits() & Feature)) {<br>
> setAvailableFeatures(<br>
> @@ -2523,18 +2567,50 @@ bool MipsAsmParser::parseSetFeature(uint<br>
> case Mips::FeatureMips16:<br>
> getTargetStreamer().emitDirectiveSetMips16();<br>
> break;<br>
> + case Mips::FeatureMips1:<br>
> + selectArch("mips1");<br>
> + getTargetStreamer().emitDirectiveSetMips1();<br>
> + break;<br>
> + case Mips::FeatureMips2:<br>
> + selectArch("mips2");<br>
> + getTargetStreamer().emitDirectiveSetMips2();<br>
> + break;<br>
> + case Mips::FeatureMips3:<br>
> + selectArch("mips3");<br>
> + getTargetStreamer().emitDirectiveSetMips3();<br>
> + break;<br>
> + case Mips::FeatureMips4:<br>
> + selectArch("mips4");<br>
> + getTargetStreamer().emitDirectiveSetMips4();<br>
> + break;<br>
> + case Mips::FeatureMips5:<br>
> + selectArch("mips5");<br>
> + getTargetStreamer().emitDirectiveSetMips5();<br>
> + break;<br>
> + case Mips::FeatureMips32:<br>
> + selectArch("mips32");<br>
> + getTargetStreamer().emitDirectiveSetMips32();<br>
> + break;<br>
> case Mips::FeatureMips32r2:<br>
> - setFeatureBits(Mips::FeatureMips32r2, "mips32r2");<br>
> + selectArch("mips32r2");<br>
> getTargetStreamer().emitDirectiveSetMips32R2();<br>
> break;<br>
> + case Mips::FeatureMips32r6:<br>
> + selectArch("mips32r6");<br>
> + getTargetStreamer().emitDirectiveSetMips32R6();<br>
> + break;<br>
> case Mips::FeatureMips64:<br>
> - setFeatureBits(Mips::FeatureMips64, "mips64");<br>
> + selectArch("mips64");<br>
> getTargetStreamer().emitDirectiveSetMips64();<br>
> break;<br>
> case Mips::FeatureMips64r2:<br>
> - setFeatureBits(Mips::FeatureMips64r2, "mips64r2");<br>
> + selectArch("mips64r2");<br>
> getTargetStreamer().emitDirectiveSetMips64R2();<br>
> break;<br>
> + case Mips::FeatureMips64r6:<br>
> + selectArch("mips64r6");<br>
> + getTargetStreamer().emitDirectiveSetMips64R6();<br>
> + break;<br>
> }<br>
> return false;<br>
> }<br>
> @@ -2682,12 +2758,28 @@ bool MipsAsmParser::parseDirectiveSet()<br>
> return false;<br>
> } else if (Tok.getString() == "micromips") {<br>
> return parseSetFeature(Mips::FeatureMicroMips);<br>
> + } else if (Tok.getString() == "mips1") {<br>
> + return parseSetFeature(Mips::FeatureMips1);<br>
> + } else if (Tok.getString() == "mips2") {<br>
> + return parseSetFeature(Mips::FeatureMips2);<br>
> + } else if (Tok.getString() == "mips3") {<br>
> + return parseSetFeature(Mips::FeatureMips3);<br>
> + } else if (Tok.getString() == "mips4") {<br>
> + return parseSetFeature(Mips::FeatureMips4);<br>
> + } else if (Tok.getString() == "mips5") {<br>
> + return parseSetFeature(Mips::FeatureMips5);<br>
> + } else if (Tok.getString() == "mips32") {<br>
> + return parseSetFeature(Mips::FeatureMips32);<br>
> } else if (Tok.getString() == "mips32r2") {<br>
> return parseSetFeature(Mips::FeatureMips32r2);<br>
> + } else if (Tok.getString() == "mips32r6") {<br>
> + return parseSetFeature(Mips::FeatureMips32r6);<br>
> } else if (Tok.getString() == "mips64") {<br>
> return parseSetFeature(Mips::FeatureMips64);<br>
> } else if (Tok.getString() == "mips64r2") {<br>
> return parseSetFeature(Mips::FeatureMips64r2);<br>
> + } else if (Tok.getString() == "mips64r6") {<br>
> + return parseSetFeature(Mips::FeatureMips64r6);<br>
> } else if (Tok.getString() == "dsp") {<br>
> return parseSetFeature(Mips::FeatureDSP);<br>
> } else {<br>
><br>
> Modified: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp?rev=214709&r1=214708&r2=214709&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp?rev=214709&r1=214708&r2=214709&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp (original)<br>
> +++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp Mon Aug 4 07:20:00 2014<br>
> @@ -52,9 +52,17 @@ void MipsTargetStreamer::emitFrame(unsig<br>
> void MipsTargetStreamer::emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) {}<br>
> void MipsTargetStreamer::emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) {<br>
> }<br>
> +void MipsTargetStreamer::emitDirectiveSetMips1() {}<br>
> +void MipsTargetStreamer::emitDirectiveSetMips2() {}<br>
> +void MipsTargetStreamer::emitDirectiveSetMips3() {}<br>
> +void MipsTargetStreamer::emitDirectiveSetMips4() {}<br>
> +void MipsTargetStreamer::emitDirectiveSetMips5() {}<br>
> +void MipsTargetStreamer::emitDirectiveSetMips32() {}<br>
> void MipsTargetStreamer::emitDirectiveSetMips32R2() {}<br>
> +void MipsTargetStreamer::emitDirectiveSetMips32R6() {}<br>
> void MipsTargetStreamer::emitDirectiveSetMips64() {}<br>
> void MipsTargetStreamer::emitDirectiveSetMips64R2() {}<br>
> +void MipsTargetStreamer::emitDirectiveSetMips64R6() {}<br>
> void MipsTargetStreamer::emitDirectiveSetDsp() {}<br>
> void MipsTargetStreamer::emitDirectiveCpload(unsigned RegNo) {}<br>
> void MipsTargetStreamer::emitDirectiveCpsetup(unsigned RegNo, int RegOrOffset,<br>
> @@ -152,11 +160,46 @@ void MipsTargetAsmStreamer::emitFrame(un<br>
> << StringRef(MipsInstPrinter::getRegisterName(ReturnReg)).lower() << '\n';<br>
> }<br>
><br>
> +void MipsTargetAsmStreamer::emitDirectiveSetMips1() {<br>
> + OS << "\t.set\tmips1\n";<br>
> + setCanHaveModuleDir(false);<br>
> +}<br>
> +<br>
> +void MipsTargetAsmStreamer::emitDirectiveSetMips2() {<br>
> + OS << "\t.set\tmips2\n";<br>
> + setCanHaveModuleDir(false);<br>
> +}<br>
> +<br>
> +void MipsTargetAsmStreamer::emitDirectiveSetMips3() {<br>
> + OS << "\t.set\tmips3\n";<br>
> + setCanHaveModuleDir(false);<br>
> +}<br>
> +<br>
> +void MipsTargetAsmStreamer::emitDirectiveSetMips4() {<br>
> + OS << "\t.set\tmips4\n";<br>
> + setCanHaveModuleDir(false);<br>
> +}<br>
> +<br>
> +void MipsTargetAsmStreamer::emitDirectiveSetMips5() {<br>
> + OS << "\t.set\tmips5\n";<br>
> + setCanHaveModuleDir(false);<br>
> +}<br>
> +<br>
> +void MipsTargetAsmStreamer::emitDirectiveSetMips32() {<br>
> + OS << "\t.set\tmips32\n";<br>
> + setCanHaveModuleDir(false);<br>
> +}<br>
> +<br>
> void MipsTargetAsmStreamer::emitDirectiveSetMips32R2() {<br>
> OS << "\t.set\tmips32r2\n";<br>
> setCanHaveModuleDir(false);<br>
> }<br>
><br>
> +void MipsTargetAsmStreamer::emitDirectiveSetMips32R6() {<br>
> + OS << "\t.set\tmips32r6\n";<br>
> + setCanHaveModuleDir(false);<br>
> +}<br>
> +<br>
> void MipsTargetAsmStreamer::emitDirectiveSetMips64() {<br>
> OS << "\t.set\tmips64\n";<br>
> setCanHaveModuleDir(false);<br>
> @@ -167,6 +210,11 @@ void MipsTargetAsmStreamer::emitDirectiv<br>
> setCanHaveModuleDir(false);<br>
> }<br>
><br>
> +void MipsTargetAsmStreamer::emitDirectiveSetMips64R6() {<br>
> + OS << "\t.set\tmips64r6\n";<br>
> + setCanHaveModuleDir(false);<br>
> +}<br>
> +<br>
> void MipsTargetAsmStreamer::emitDirectiveSetDsp() {<br>
> OS << "\t.set\tdsp\n";<br>
> setCanHaveModuleDir(false);<br>
> @@ -496,10 +544,38 @@ void MipsTargetELFStreamer::emitFMask(un<br>
> // FIXME: implement.<br>
> }<br>
><br>
> +void MipsTargetELFStreamer::emitDirectiveSetMips1() {<br>
> + setCanHaveModuleDir(false);<br>
> +}<br>
> +<br>
> +void MipsTargetELFStreamer::emitDirectiveSetMips2() {<br>
> + setCanHaveModuleDir(false);<br>
> +}<br>
> +<br>
> +void MipsTargetELFStreamer::emitDirectiveSetMips3() {<br>
> + setCanHaveModuleDir(false);<br>
> +}<br>
> +<br>
> +void MipsTargetELFStreamer::emitDirectiveSetMips4() {<br>
> + setCanHaveModuleDir(false);<br>
> +}<br>
> +<br>
> +void MipsTargetELFStreamer::emitDirectiveSetMips5() {<br>
> + setCanHaveModuleDir(false);<br>
> +}<br>
> +<br>
> +void MipsTargetELFStreamer::emitDirectiveSetMips32() {<br>
> + setCanHaveModuleDir(false);<br>
> +}<br>
> +<br>
> void MipsTargetELFStreamer::emitDirectiveSetMips32R2() {<br>
> setCanHaveModuleDir(false);<br>
> }<br>
><br>
> +void MipsTargetELFStreamer::emitDirectiveSetMips32R6() {<br>
> + setCanHaveModuleDir(false);<br>
> +}<br>
> +<br>
> void MipsTargetELFStreamer::emitDirectiveSetMips64() {<br>
> setCanHaveModuleDir(false);<br>
> }<br>
> @@ -508,6 +584,10 @@ void MipsTargetELFStreamer::emitDirectiv<br>
> setCanHaveModuleDir(false);<br>
> }<br>
><br>
> +void MipsTargetELFStreamer::emitDirectiveSetMips64R6() {<br>
> + setCanHaveModuleDir(false);<br>
> +}<br>
> +<br>
> void MipsTargetELFStreamer::emitDirectiveSetDsp() {<br>
> setCanHaveModuleDir(false);<br>
> }<br>
><br>
> Modified: llvm/trunk/lib/Target/Mips/MipsTargetStreamer.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetStreamer.h?rev=214709&r1=214708&r2=214709&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetStreamer.h?rev=214709&r1=214708&r2=214709&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Target/Mips/MipsTargetStreamer.h (original)<br>
> +++ llvm/trunk/lib/Target/Mips/MipsTargetStreamer.h Mon Aug 4 07:20:00 2014<br>
> @@ -45,9 +45,17 @@ public:<br>
> virtual void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff);<br>
> virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff);<br>
><br>
> + virtual void emitDirectiveSetMips1();<br>
> + virtual void emitDirectiveSetMips2();<br>
> + virtual void emitDirectiveSetMips3();<br>
> + virtual void emitDirectiveSetMips4();<br>
> + virtual void emitDirectiveSetMips5();<br>
> + virtual void emitDirectiveSetMips32();<br>
> virtual void emitDirectiveSetMips32R2();<br>
> + virtual void emitDirectiveSetMips32R6();<br>
> virtual void emitDirectiveSetMips64();<br>
> virtual void emitDirectiveSetMips64R2();<br>
> + virtual void emitDirectiveSetMips64R6();<br>
> virtual void emitDirectiveSetDsp();<br>
><br>
> // PIC support<br>
> @@ -121,9 +129,17 @@ public:<br>
> void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) override;<br>
> void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) override;<br>
><br>
> + void emitDirectiveSetMips1() override;<br>
> + void emitDirectiveSetMips2() override;<br>
> + void emitDirectiveSetMips3() override;<br>
> + void emitDirectiveSetMips4() override;<br>
> + void emitDirectiveSetMips5() override;<br>
> + void emitDirectiveSetMips32() override;<br>
> void emitDirectiveSetMips32R2() override;<br>
> + void emitDirectiveSetMips32R6() override;<br>
> void emitDirectiveSetMips64() override;<br>
> void emitDirectiveSetMips64R2() override;<br>
> + void emitDirectiveSetMips64R6() override;<br>
> void emitDirectiveSetDsp() override;<br>
><br>
> // PIC support<br>
> @@ -178,9 +194,17 @@ public:<br>
> void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) override;<br>
> void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) override;<br>
><br>
> + void emitDirectiveSetMips1() override;<br>
> + void emitDirectiveSetMips2() override;<br>
> + void emitDirectiveSetMips3() override;<br>
> + void emitDirectiveSetMips4() override;<br>
> + void emitDirectiveSetMips5() override;<br>
> + void emitDirectiveSetMips32() override;<br>
> void emitDirectiveSetMips32R2() override;<br>
> + void emitDirectiveSetMips32R6() override;<br>
> void emitDirectiveSetMips64() override;<br>
> void emitDirectiveSetMips64R2() override;<br>
> + void emitDirectiveSetMips64R6() override;<br>
> void emitDirectiveSetDsp() override;<br>
><br>
> // PIC support<br>
><br>
> Added: llvm/trunk/test/MC/Mips/set-mips-directives-bad.s<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/set-mips-directives-bad.s?rev=214709&view=auto">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/set-mips-directives-bad.s?rev=214709&view=auto</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/MC/Mips/set-mips-directives-bad.s (added)<br>
> +++ llvm/trunk/test/MC/Mips/set-mips-directives-bad.s Mon Aug 4 07:20:00 2014<br>
> @@ -0,0 +1,30 @@<br>
> +# RUN: not llvm-mc %s -triple=mipsel-unknown-linux -mcpu=mips1 2>%t1<br>
> +# RUN: FileCheck %s < %t1<br>
> +<br>
> +# FIXME: At the moment we emit the wrong error message if we try to assemble the<br>
> +# ll instruction using an unsupported architecture so we just check for "error"<br>
> +# and ignore the rest of the message.<br>
> +<br>
> + .text<br>
> + .set noreorder<br>
> + .set mips1<br>
> + ll $2,-2($2) # CHECK: error:<br>
> + .set mips2<br>
> + dadd $2,$2,$2 # CHECK: error: instruction requires a CPU feature not currently enabled<br>
> + .set mips3<br>
> + ldxc1 $f8,$2($4) # CHECK: error: instruction requires a CPU feature not currently enabled<br>
> + .set mips4<br>
> + luxc1 $f19,$2($4) # CHECK: error: instruction requires a CPU feature not currently enabled<br>
> + .set mips5<br>
> + clo $2,$2 # CHECK: error: instruction requires a CPU feature not currently enabled<br>
> + .set mips32<br>
> + rotr $2,15 # CHECK: error: instruction requires a CPU feature not currently enabled<br>
> + .set mips32r2<br>
> + mod $2, $4, $6 # CHECK: error:instruction requires a CPU feature not currently enabled<br>
> + .set mips32r6<br>
> + daddi $2, $2, 10 # CHECK: error: instruction requires a CPU feature not currently enabled<br>
> + .set mips64<br>
> + drotr32 $1,$14,15 # CHECK: error: instruction requires a CPU feature not currently enabled<br>
> + .set mips64r2<br>
> + mod $2, $4, $6 # CHECK: error: instruction requires a CPU feature not currently enabled<br>
> +<br>
><br>
> Added: llvm/trunk/test/MC/Mips/set-mips-directives.s<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/set-mips-directives.s?rev=214709&view=auto">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/set-mips-directives.s?rev=214709&view=auto</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/MC/Mips/set-mips-directives.s (added)<br>
> +++ llvm/trunk/test/MC/Mips/set-mips-directives.s Mon Aug 4 07:20:00 2014<br>
> @@ -0,0 +1,51 @@<br>
> +# RUN: llvm-mc %s -triple=mipsel-unknown-linux -mcpu=mips1 | \<br>
> +# RUN: FileCheck %s<br>
> +<br>
> + .text<br>
> + .set noreorder<br>
> + .set mips1<br>
> + add $2, $2, $2<br>
> + .set mips2<br>
> + ll $2,-2($2)<br>
> + .set mips3<br>
> + dadd $2,$2,$2<br>
> + .set mips4<br>
> + ldxc1 $f8,$2($4)<br>
> + .set mips5<br>
> + luxc1 $f19,$2($4)<br>
> + .set mips32<br>
> + clo $2,$2<br>
> + .set mips32r2<br>
> + rotr $2,15<br>
> + .set mips32r6<br>
> + mod $2, $4, $6<br>
> + .set mips64<br>
> + daddi $2, $2, 10<br>
> + .set mips64r2<br>
> + drotr32 $1,$14,15<br>
> + .set mips64r6<br>
> + mod $2, $4, $6<br>
> +<br>
> +# CHECK: .set noreorder<br>
> +# CHECK: .set mips1<br>
> +# CHECK: add $2, $2, $2<br>
> +# CHECK: .set mips2<br>
> +# CHECK: ll $2, -2($2)<br>
> +# CHECK: .set mips3<br>
> +# CHECK: dadd $2, $2, $2<br>
> +# CHECK: .set mips4<br>
> +# CHECK: ldxc1 $f8, $2($4)<br>
> +# CHECK: .set mips5<br>
> +# CHECK: luxc1 $f19, $2($4)<br>
> +# CHECK: .set mips32<br>
> +# CHECK: clo $2, $2<br>
> +# CHECK: .set mips32r2<br>
> +# CHECK: rotr $2, $2, 15<br>
> +# CHECK: .set mips32r6<br>
> +# CHECK: mod $2, $4, $6<br>
> +# CHECK: .set mips64<br>
> +# CHECK: daddi $2, $2, 10<br>
> +# CHECK: .set mips64r2<br>
> +# CHECK: drotr32 $1, $14, 15<br>
> +# CHECK: .set mips64r6<br>
> +# CHECK: mod $2, $4, $6<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</p>