From: Julian Seward Date: Sat, 22 Jan 2005 11:00:42 +0000 (+0000) Subject: Another speedup case resulting from profiled runs of bzip2. X-Git-Tag: svn/VALGRIND_3_0_1^2~596 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f63b956be6d8782879715f156fee599151e3cdc;p=thirdparty%2Fvalgrind.git Another speedup case resulting from profiled runs of bzip2. git-svn-id: svn://svn.valgrind.org/vex/trunk@738 --- diff --git a/VEX/priv/guest-x86/ghelpers.c b/VEX/priv/guest-x86/ghelpers.c index e983cbad4e..6e1b746ff0 100644 --- a/VEX/priv/guest-x86/ghelpers.c +++ b/VEX/priv/guest-x86/ghelpers.c @@ -544,14 +544,14 @@ UInt x86g_calculate_eflags_c ( UInt cc_op, case X86G_CC_OP_SUBL: return ((UInt)cc_dep1) < ((UInt)cc_dep2) ? X86G_CC_MASK_C : 0; -#if 0 case X86G_CC_OP_SUBB: return ((UInt)(cc_dep1 & 0xFF)) < ((UInt)(cc_dep2 & 0xFF)) ? X86G_CC_MASK_C : 0; -#endif -#if 0 + case X86G_CC_OP_INCL: case X86G_CC_OP_DECL: - return cc_src; + return cc_ndep & X86G_CC_MASK_C; +#if 0 + /* unclear if these are correct or not */ case X86G_CC_OP_ADDL: return ( ((UInt)cc_src + (UInt)cc_dst) < ((UInt)cc_src) ) ? X86G_CC_MASK_C : 0; @@ -703,6 +703,13 @@ IRExpr* guest_x86_spechelper ( Char* function_name, return unop(Iop_1Uto32, binop(Iop_CmpLT32U, cc_dep1, cc_dep2)); } + if (isU32(cc_op, X86G_CC_OP_SUBB)) { + /* C after sub denotes unsigned less than */ + return unop(Iop_1Uto32, + binop(Iop_CmpLT32U, + binop(Iop_And32,cc_dep1,mkU32(0xFF)), + binop(Iop_And32,cc_dep2,mkU32(0xFF)))); + } if (isU32(cc_op, X86G_CC_OP_LOGICL)) { /* cflag after logic is zero */ return mkU32(0);