[PATCH] ARM: fix pc-relative thumb loads decoding (literal loads)

Renato Golin renato.golin at linaro.org
Mon Jun 17 01:53:01 PDT 2013


  The rest looks good to me.


================
Comment at: lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp:339
@@ +338,3 @@
+      << markup(">");
+  }
+  O << "]" << markup(">");
----------------
I would have kept only the formatImm() inside the if/else block. Or even inverted its sign before the output, so to have only one.

if (OffImm == INT32_MIN)
  OffImm = 0;
else if (isSub)
  OffImm = -OffImm;

O << ...

================
Comment at: lib/Target/ARM/Disassembler/ARMDisassembler.cpp:3372
@@ +3371,3 @@
+    Inst.setOpcode(ARM::t2PLDi12);
+    Inst.addOperand(MCOperand::CreateReg(ARM::PC));
+  } else {
----------------
Re-writing my comment: shouldn't you make sure that you have the correct number of operands here, before appending a new one?

================
Comment at: lib/Target/ARM/Disassembler/ARMDisassembler.cpp:3208
@@ -3208,1 +3207,3 @@
+        break;
+      case ARM::t2PLDs: {
         Inst.setOpcode(ARM::t2PLDi12);
----------------
It seems weird to lower PLDs here and all other instructions on DecodeT2LoadLabel(). Maybe that's what your FIXME is all about?

Unless I'm mistaken, it doesn't seem particularly complicated to implement it there right now, and avoid introducing another FIXME. But if not, I'm fine with leaving it there, maybe creating a bug to fix it?


http://llvm-reviews.chandlerc.com/D973



More information about the llvm-commits mailing list