]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add a couple of spec rules for MI and PL after LOGIC. These are
authorJulian Seward <jseward@acm.org>
Fri, 23 Sep 2011 15:04:29 +0000 (15:04 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 23 Sep 2011 15:04:29 +0000 (15:04 +0000)
important for avoiding false positives in Android syscall handlers.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2206

VEX/priv/guest_arm_helpers.c

index 8aae1b34fb4ac6a28b1a7da36ee65bf3e50f7827..f5ed31038fc8320cbaf72273ab89cd904928a992 100644 (file)
@@ -676,6 +676,21 @@ IRExpr* guest_arm_spechelper ( HChar*   function_name,
                      binop(Iop_CmpNE32, cc_dep1, mkU32(0)));
       }
 
+      if (isU32(cond_n_op, (ARMCondPL << 4) | ARMG_CC_OP_LOGIC)) {
+         /* PL after LOGIC --> test (res >> 31) == 0 */
+         return unop(Iop_1Uto32,
+                     binop(Iop_CmpEQ32,
+                           binop(Iop_Shr32, cc_dep1, mkU8(31)),
+                           mkU32(0)));
+      }
+      if (isU32(cond_n_op, (ARMCondMI << 4) | ARMG_CC_OP_LOGIC)) {
+         /* MI after LOGIC --> test (res >> 31) == 1 */
+         return unop(Iop_1Uto32,
+                     binop(Iop_CmpEQ32,
+                           binop(Iop_Shr32, cc_dep1, mkU8(31)),
+                           mkU32(1)));
+      }
+
       /*----------------- AL -----------------*/
 
       /* A critically important case for Thumb code.