From: Julian Seward Date: Fri, 2 May 2008 22:15:12 +0000 (+0000) Subject: Specialise CondNZ after SUBW for both x86 and amd64. X-Git-Tag: svn/VALGRIND_3_4_1^2~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb283b95c122caef83a4ab7f58b08123424a7791;p=thirdparty%2Fvalgrind.git Specialise CondNZ after SUBW for both x86 and amd64. git-svn-id: svn://svn.valgrind.org/vex/trunk@1833 --- diff --git a/VEX/priv/guest-amd64/ghelpers.c b/VEX/priv/guest-amd64/ghelpers.c index 2f2bf7e047..d3140f9c4b 100644 --- a/VEX/priv/guest-amd64/ghelpers.c +++ b/VEX/priv/guest-amd64/ghelpers.c @@ -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) diff --git a/VEX/priv/guest-x86/ghelpers.c b/VEX/priv/guest-x86/ghelpers.c index db4e3d2602..808e9f9890 100644 --- a/VEX/priv/guest-x86/ghelpers.c +++ b/VEX/priv/guest-x86/ghelpers.c @@ -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 ----------------*/