[PATCH] Fix for PR18921.

Renato Golin renato.golin at linaro.org
Thu Apr 3 07:59:09 PDT 2014


  One of the issues in the bug report is that ldrd/strd in Thumb mode accepts the offset up to 1020 (in multiples of 4), and in ARM only 0-255, so not only the encoding is different, but the ranges are different.

  I'm assuming this should be supported somewhere else, but would be good to add some of the tests from the bug just to show that they are now accepted.


================
Comment at: lib/Target/ARM/AsmParser/ARMAsmParser.cpp:5419
@@ -5418,1 +5418,3 @@
+      if (isThumb() && Op2->getReg() == ARM::R12)
+        Error(Op2->getStartLoc(), "r12:SP pair is not allowed in Thumb mode");
 
----------------
can you add a negative test for this?

================
Comment at: lib/Target/ARM/AsmParser/ARMAsmParser.cpp:5410
@@ +5409,3 @@
+    ARMOperand *Op3 = static_cast<ARMOperand *>(Operands[3]);
+    if (Op3->isMem()) {
+      assert(Op2->isReg() && "expected register argument");
----------------
can you add tests for both formats?


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



More information about the llvm-commits mailing list