]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add a spec rule for SUBQ/NLE.
authorJulian Seward <jseward@acm.org>
Wed, 7 Aug 2013 09:45:08 +0000 (09:45 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 7 Aug 2013 09:45:08 +0000 (09:45 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@2738

VEX/priv/guest_amd64_helpers.c

index c3cf1e20b501e10c0d0053a467da5401c01e14fd..a173ec197c24bcead1bac2bd772a65555dda7c9f 100644 (file)
@@ -1027,6 +1027,16 @@ IRExpr* guest_amd64_spechelper ( const HChar* function_name,
                      binop(Iop_CmpLE64U, cc_dep2, cc_dep1));
       }
 
+      if (isU64(cc_op, AMD64G_CC_OP_SUBQ) && isU64(cond, AMD64CondNLE)) {
+         /* long sub/cmp, then NLE (signed greater than) 
+            --> test !(dst <=s src)
+            --> test (dst >s src)
+            --> test (src <s dst) */
+         return unop(Iop_1Uto64,
+                     binop(Iop_CmpLT64S, cc_dep2, cc_dep1));
+
+      }
+
       if (isU64(cc_op, AMD64G_CC_OP_SUBQ) && isU64(cond, AMD64CondBE)) {
          /* long long sub/cmp, then BE (unsigned less than or equal)
             --> test dst <=u src */