From: Julian Seward Date: Wed, 22 Nov 2006 17:39:51 +0000 (+0000) Subject: Even more flag-spec rules: SUBL-CondNL, SUBL-CondNBE, SUBL-NB and redo X-Git-Tag: svn/VALGRIND_3_3_1^2~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d88d0322d4af3cd065c373f553431012854db264;p=thirdparty%2Fvalgrind.git Even more flag-spec rules: SUBL-CondNL, SUBL-CondNBE, SUBL-NB and redo SUBL-CondNS. git-svn-id: svn://svn.valgrind.org/vex/trunk@1682 --- diff --git a/VEX/priv/guest-x86/ghelpers.c b/VEX/priv/guest-x86/ghelpers.c index 04a626d69e..ef9273dd02 100644 --- a/VEX/priv/guest-x86/ghelpers.c +++ b/VEX/priv/guest-x86/ghelpers.c @@ -846,6 +846,15 @@ IRExpr* guest_x86_spechelper ( HChar* function_name, binop(Iop_CmpLT32S, cc_dep1, cc_dep2)); } + if (isU32(cc_op, X86G_CC_OP_SUBL) && isU32(cond, X86CondNL)) { + /* long sub/cmp, then NL (signed greater than or equal) + --> test !(dst test dst <=s src */ @@ -870,6 +879,15 @@ IRExpr* guest_x86_spechelper ( HChar* function_name, binop(Iop_CmpLE32U, cc_dep1, cc_dep2)); } + if (isU32(cc_op, X86G_CC_OP_SUBL) && isU32(cond, X86CondNBE)) { + /* long sub/cmp, then BE (unsigned greater than) + --> test !(dst <=u src) */ + return binop(Iop_Xor32, + unop(Iop_1Uto32, + binop(Iop_CmpLE32U, cc_dep1, cc_dep2)), + mkU32(1)); + } + if (isU32(cc_op, X86G_CC_OP_SUBL) && isU32(cond, X86CondB)) { /* long sub/cmp, then B (unsigned less than) --> test dst test !(dst test (dst-src test (dst-src test !(dst-src test 0 <=s (dst-src) */ - return unop(Iop_1Uto32, - binop(Iop_CmpLE32S, - mkU32(0), - binop(Iop_Sub32, cc_dep1, cc_dep2))); + /* long sub/cmp, then NS (not negative) --> test !(dst-src