From: Julian Seward Date: Sun, 28 Feb 2010 04:51:02 +0000 (+0000) Subject: Fix incorrect spec rule for LE after INCB, for end-of range cases (arg = 0x7F). X-Git-Tag: svn/VALGRIND_3_6_1^2~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4c68bac0ef851d3af0e52ecfaf23aa65b121cd6;p=thirdparty%2Fvalgrind.git Fix incorrect spec rule for LE after INCB, for end-of range cases (arg = 0x7F). git-svn-id: svn://svn.valgrind.org/vex/trunk@1962 --- diff --git a/VEX/priv/guest_amd64_helpers.c b/VEX/priv/guest_amd64_helpers.c index e087650cf0..01d774517d 100644 --- a/VEX/priv/guest_amd64_helpers.c +++ b/VEX/priv/guest_amd64_helpers.c @@ -1189,11 +1189,12 @@ IRExpr* guest_amd64_spechelper ( HChar* function_name, /*---------------- INCB ----------------*/ if (isU64(cc_op, AMD64G_CC_OP_INCB) && isU64(cond, AMD64CondLE)) { - /* 8-bit inc, then LE --> test result <=s 0 */ - return unop(Iop_1Uto64, - binop(Iop_CmpLE64S, - binop(Iop_Shl64,cc_dep1,mkU8(56)), - mkU64(0))); + /* 8-bit inc, then LE --> sign bit of the arg */ + return binop(Iop_And64, + binop(Iop_Shr64, + binop(Iop_Sub64, cc_dep1, mkU64(1)), + mkU8(7)), + mkU64(1)); } /*---------------- INCW ----------------*/