[PATCH] [Mips][Disassembler][R6] Disassembler crashes on compact jump instructions for r6

Daniel Sanders daniel.sanders at imgtec.com
Tue Jan 13 05:45:14 PST 2015


Please include the full context as per the instructions at http://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface.


================
Comment at: lib/Target/Mips/Disassembler/MipsDisassembler.cpp:415-416
@@ +414,4 @@
+static DecodeStatus DecodeCompactJump(MCInst &Inst, unsigned Insn,
+                                           uint64_t Address,
+                                           const void *Decoder);
+
----------------
Nit: indentation

================
Comment at: lib/Target/Mips/Disassembler/MipsDisassembler.cpp:1771-1773
@@ +1770,5 @@
+static DecodeStatus DecodeCompactJump(MCInst &Inst,
+  unsigned Insn,
+  uint64_t Address,
+  const void *Decoder) {
+  unsigned Base = fieldFromInstruction(Insn, 16, 5);
----------------
Nit: indentation

================
Comment at: lib/Target/Mips/Mips32r6InstrInfo.td:382
@@ -381,3 +381,3 @@
   bit hasDelaySlot = 0;
-  string DecoderMethod = "DecodeSimm16";
+  string DecoderMethod = "DecodeCompactJump";
 }
----------------
I'm not sure this one needs a DecoderMethod since there's nothing particularly special about the operands and the new DecodeCompactJump() isn't doing anything tricky. In particular, there aren't any ins/outs that have multiple corresponding MCOperands. It seems like the problem is just innappropriate use of DecodeSimm16.

Could you try deleting this line and see if that fixes the problem too?

================
Comment at: test/MC/Disassembler/Mips/mips64r6/valid-mips64r6.txt:168
@@ +167,2 @@
+0xd8 0x05 0x01 0x00    # CHECK: jic $5, 256
+
----------------
Nit: delete extra blank line

http://reviews.llvm.org/D6817

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list