diff mbox

vex: arm->IR: unhandled instruction SUB (SP minus immediate/register)

Message ID 201103211927.p2LJR0fF000980@d06av02.portsmouth.uk.ibm.com
State Accepted
Headers show

Commit Message

Ulrich Weigand March 21, 2011, 7:27 p.m. UTC
[https://bugs.kde.org/show_bug.cgi?id=269078]
diff mbox

Patch

Index: VEX/priv/guest_arm_toIR.c
===================================================================
--- VEX/priv/guest_arm_toIR.c	(revision 2104)
+++ VEX/priv/guest_arm_toIR.c	(working copy)
@@ -16010,8 +16010,8 @@ 
       UInt rN    = INSN0(3,0);
       UInt rD    = INSN1(11,8);
       Bool valid = !isBadRegT(rN) && !isBadRegT(rD);
-      /* but allow "sub.w sp, sp, #constT" */
-      if (!valid && !isRSB && rN == 13 && rD == 13)
+      /* but allow "sub.w reg, sp, #constT" */
+      if (!valid && !isRSB && rN == 13 && rD != 15)
          valid = True;
       if (valid) {
          IRTemp argL  = newTemp(Ity_I32);
@@ -16163,9 +16163,9 @@ 
           && rN == 13 && imm5 == 0 && how == 0) {
          valid = True;
       }
-      /* also allow "sub.w sp, sp, reg   w/ no shift */
+      /* also allow "sub.w reg, sp, reg   w/ no shift */
       if (!valid && INSN0(8,5) == BITS4(1,1,0,1) // add
-          && rD == 13 && rN == 13 && imm5 == 0 && how == 0) {
+          && rD != 15 && rN == 13 && imm5 == 0 && how == 0) {
          valid = True;
       }
       if (valid) {