From: Julian Seward Date: Fri, 25 Aug 2006 12:52:19 +0000 (+0000) Subject: More reduction rules, which further reduce memcheck's false error X-Git-Tag: svn/VALGRIND_3_3_1^2~101 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a4ca68f0a8ba615f951ad012ac42728a94278e0c;p=thirdparty%2Fvalgrind.git More reduction rules, which further reduce memcheck's false error rate on optimised x86 and amd64 code. git-svn-id: svn://svn.valgrind.org/vex/trunk@1642 --- diff --git a/VEX/priv/guest-amd64/ghelpers.c b/VEX/priv/guest-amd64/ghelpers.c index d500d765ba..19b40ac78c 100644 --- a/VEX/priv/guest-amd64/ghelpers.c +++ b/VEX/priv/guest-amd64/ghelpers.c @@ -958,12 +958,6 @@ IRExpr* guest_amd64_spechelper ( HChar* function_name, binop(Iop_Shl64,cc_dep2,mkU8(32)))); } -//.. if (isU32(cc_op, AMD64G_CC_OP_SUBL) && isU32(cond, X86CondNZ)) { -//.. /* long sub/cmp, then NZ --> test dst!=src */ -//.. return unop(Iop_1Uto32, -//.. binop(Iop_CmpNE32, cc_dep1, cc_dep2)); -//.. } - if (isU64(cc_op, AMD64G_CC_OP_SUBL) && isU64(cond, AMD64CondL)) { /* long sub/cmp, then L (signed less than) --> test dst test dst test src test dst!=src */ + return unop(Iop_1Uto64, + binop(Iop_CmpNE8, + unop(Iop_64to8,cc_dep1), + unop(Iop_64to8,cc_dep2))); + } + if (isU64(cc_op, AMD64G_CC_OP_SUBB) && isU64(cond, AMD64CondS) && isU64(cc_dep2, 0)) { /* byte sub/cmp of zero, then S --> test (dst-0 test dst == 0 */ + return unop(Iop_1Uto32, + binop(Iop_CmpEQ32, + binop(Iop_Shl32,cc_dep1,mkU8(16)), + mkU32(0))); + } + /*---------------- INCW ----------------*/ if (isU32(cc_op, X86G_CC_OP_INCW) && isU32(cond, X86CondZ)) {