[PATCH] D12628: [mips][microMIPS] Implement PAUSE, RDHWR, RDPGPR, SDBBP, SSNOP, SYNC, SYNCI and WAIT instructions

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 10:32:48 PDT 2015


dsanders accepted this revision.
dsanders added a comment.
This revision is now accepted and ready to land.

Thanks. Just one small change and it will LGTM


================
Comment at: test/MC/Mips/micromips-control-instructions.s:14
@@ -13,6 +13,3 @@
 # CHECK-EL:    sdbbp 34                   # encoding: [0x22,0x00,0x7c,0xdb]
-# CHECK-EL:    .set push
-# CHECK-EL:    .set mips32r2
-# CHECK-EL:    rdhwr $5, $29
-# CHECK-EL:    .set pop                   # encoding: [0xbd,0x00,0x3c,0x6b]
+# CHECK-EL:    rdhwr $5, $29              # encoding: [0xbd,0x00,0x3c,0x6b]
 # CHECK-EL:    cache 1, 8($5)             # encoding: [0x25,0x20,0x08,0x60]
----------------
hvarga wrote:
> According to https://dmz-portal.mips.com/bugz/show_bug.cgi?id=459, mips32r2 version of RDHWR emits those directives in mips32 mode. I had a disscussion with zoran.jovanovic quite some time ago and we agreed that there is no need for micromips version of RDHWR to emit those instructions.
> 
> This also helped me to implement the RDHWR for micromips32r6 just by setting NotInMicroMips in AdditionalPredicates for RDHWR definition in lib/Target/Mips/MipsInstrInfo.td. So by setting this I also removed directives that were expected for RDHWR assembler test in test/MC/Mips/micromips-control-instructions.s
> I had a disscussion with zoran.jovanovic quite some time ago and we agreed that there is no need for micromips version of RDHWR to emit those instructions.

That's correct. In fact it goes a bit further than that since they aren't really required for any MIPS ISA on Linux (and possibly others). Although the instruction isn't strictly part of the older ISA's the Linux kernel will emulate it. The reason they're there is that the integrated assembler is currently too accurate in the predicates for RDHWR.


I see why they aren't emitted in this case now. It's simply that they are added to RDHWR and RDHWR64 in MipsInstPrinter.cpp. The conversion to microMIPS means that it's neither of those.

Please add CHECK-NOT's to ensure that they aren't emitted.


http://reviews.llvm.org/D12628





More information about the llvm-commits mailing list