From: Julian Seward Date: Mon, 8 Nov 2004 18:20:23 +0000 (+0000) Subject: Un-break eflag helper specialiser. X-Git-Tag: svn/VALGRIND_3_0_1^2~807 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61741b0263be399877110ae7373b3976946517f0;p=thirdparty%2Fvalgrind.git Un-break eflag helper specialiser. git-svn-id: svn://svn.valgrind.org/vex/trunk@527 --- diff --git a/VEX/priv/guest-x86/ghelpers.c b/VEX/priv/guest-x86/ghelpers.c index 533b649b85..47bc775945 100644 --- a/VEX/priv/guest-x86/ghelpers.c +++ b/VEX/priv/guest-x86/ghelpers.c @@ -739,7 +739,7 @@ IRExpr* x86guest_spechelper ( Char* function_name, } if (isU32(cc_op, CC_OP_SUBB) && isU32(cond, CondNZ)) { - /* byte sub/cmp, then Z --> test dst!=src */ + /* byte sub/cmp, then NZ --> test dst!=src */ return unop(Iop_1Uto32, binop(Iop_CmpNE8, unop(Iop_32to8,cc_dep1), @@ -748,10 +748,11 @@ IRExpr* x86guest_spechelper ( Char* function_name, if (isU32(cc_op, CC_OP_SUBB) && isU32(cond, CondNBE)) { /* long sub/cmp, then NBE (unsigned greater than) --> test src <=u dst */ + /* Note, args are opposite way round from the usual */ return unop(Iop_1Uto32, binop(Iop_CmpLT32U, - binop(Iop_And32,cc_dep1,mkU32(0xFF)), - binop(Iop_And32,cc_dep2,mkU32(0xFF)))); + binop(Iop_And32,cc_dep2,mkU32(0xFF)), + binop(Iop_And32,cc_dep1,mkU32(0xFF)))); } /*---------------- LOGICL ----------------*/