]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add spec rules for Z and NZ after LOGICW.
authorJulian Seward <jseward@acm.org>
Wed, 25 Apr 2012 14:33:03 +0000 (14:33 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 25 Apr 2012 14:33:03 +0000 (14:33 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@2314

VEX/priv/guest_amd64_helpers.c

index 80b5a74bcd2b08e2b554e3afeacd3876d0024231..c749c397b8467b9ea4aec7fcf8d47b1de13731e2 100644 (file)
@@ -1198,6 +1198,23 @@ IRExpr* guest_amd64_spechelper ( HChar* function_name,
                 mkU64(1));
       }
 
+      /*---------------- LOGICW ----------------*/
+
+      if (isU64(cc_op, AMD64G_CC_OP_LOGICW) && isU64(cond, AMD64CondZ)) {
+         /* word and/or/xor, then Z --> test dst==0 */
+         return unop(Iop_1Uto64,
+                     binop(Iop_CmpEQ64,
+                           binop(Iop_And64, cc_dep1, mkU64(0xFFFF)),
+                           mkU64(0)));
+      }
+      if (isU64(cc_op, AMD64G_CC_OP_LOGICW) && isU64(cond, AMD64CondNZ)) {
+         /* word and/or/xor, then NZ --> test dst!=0 */
+         return unop(Iop_1Uto64,
+                     binop(Iop_CmpNE64,
+                           binop(Iop_And64, cc_dep1, mkU64(0xFFFF)),
+                           mkU64(0)));
+      }
+
       /*---------------- LOGICB ----------------*/
 
       if (isU64(cc_op, AMD64G_CC_OP_LOGICB) && isU64(cond, AMD64CondZ)) {