From: Julian Seward Date: Mon, 31 Mar 2008 01:51:57 +0000 (+0000) Subject: Specialise CondNS after SUBB. The lack of this was causing Memcheck to X-Git-Tag: svn/VALGRIND_3_4_1^2~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96877098dbac3850213078e6fe448f4df13164c7;p=thirdparty%2Fvalgrind.git Specialise CondNS after SUBB. The lack of this was causing Memcheck to report false positives in some tricky bitfield code in OOo 2.4 (writer) when loading MS Word docs. git-svn-id: svn://svn.valgrind.org/vex/trunk@1816 --- diff --git a/VEX/priv/guest-x86/ghelpers.c b/VEX/priv/guest-x86/ghelpers.c index b5d0ad5b8f..fb54968011 100644 --- a/VEX/priv/guest-x86/ghelpers.c +++ b/VEX/priv/guest-x86/ghelpers.c @@ -968,6 +968,19 @@ IRExpr* guest_x86_spechelper ( HChar* function_name, mkU32(1)); } + if (isU32(cc_op, X86G_CC_OP_SUBB) && isU32(cond, X86CondNS) + && isU32(cc_dep2, 0)) { + /* byte sub/cmp of zero, then NS --> test !(dst-0 test !(dst (UInt) !dst[7] + */ + return binop(Iop_Xor32, + binop(Iop_And32, + binop(Iop_Shr32,cc_dep1,mkU8(7)), + mkU32(1)), + mkU32(1)); + } + /*---------------- LOGICL ----------------*/ if (isU32(cc_op, X86G_CC_OP_LOGICL) && isU32(cond, X86CondZ)) {