]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Specialise CondNZ after SUBW for both x86 and amd64.
authorJulian Seward <jseward@acm.org>
Fri, 2 May 2008 22:15:12 +0000 (22:15 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 2 May 2008 22:15:12 +0000 (22:15 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@1833

VEX/priv/guest-amd64/ghelpers.c
VEX/priv/guest-x86/ghelpers.c

index 2f2bf7e04799bff154d05184d14c9784dc0f9457..d3140f9c4ba1b3cbae3119caf13d1adef357c413 100644 (file)
@@ -1001,6 +1001,13 @@ IRExpr* guest_amd64_spechelper ( HChar* function_name,
                            unop(Iop_64to16,cc_dep1),
                            unop(Iop_64to16,cc_dep2)));
       }
+      if (isU64(cc_op, AMD64G_CC_OP_SUBW) && isU64(cond, AMD64CondNZ)) {
+         /* word sub/cmp, then NZ --> test dst!=src */
+         return unop(Iop_1Uto64,
+                     binop(Iop_CmpNE16, 
+                           unop(Iop_64to16,cc_dep1),
+                           unop(Iop_64to16,cc_dep2)));
+      }
 
       if (isU64(cc_op, AMD64G_CC_OP_SUBW) && isU64(cond, AMD64CondLE)) {
          /* word sub/cmp, then LE (signed less than or equal) 
index db4e3d2602b8825b316e5bc26ab5ede67b686837..808e9f989048af5573fe4a0edc9c153434206f9f 100644 (file)
@@ -925,6 +925,13 @@ IRExpr* guest_x86_spechelper ( HChar* function_name,
                            unop(Iop_32to16,cc_dep1), 
                            unop(Iop_32to16,cc_dep2)));
       }
+      if (isU32(cc_op, X86G_CC_OP_SUBW) && isU32(cond, X86CondNZ)) {
+         /* word sub/cmp, then NZ --> test dst!=src */
+         return unop(Iop_1Uto32,
+                     binop(Iop_CmpNE16, 
+                           unop(Iop_32to16,cc_dep1), 
+                           unop(Iop_32to16,cc_dep2)));
+      }
 
       /*---------------- SUBB ----------------*/