From: Julian Seward Date: Sun, 19 Sep 2004 12:00:15 +0000 (+0000) Subject: Get rid of old condition-code handling stuff, that was unused. X-Git-Tag: svn/VALGRIND_3_0_1^2~1061 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ff62d9d1e6b031ffa380237c7a90eb8b8113fa90;p=thirdparty%2Fvalgrind.git Get rid of old condition-code handling stuff, that was unused. git-svn-id: svn://svn.valgrind.org/vex/trunk@273 --- diff --git a/VEX/priv/guest-x86/toIR.c b/VEX/priv/guest-x86/toIR.c index 3751f73cb4..f3d323d00f 100644 --- a/VEX/priv/guest-x86/toIR.c +++ b/VEX/priv/guest-x86/toIR.c @@ -621,95 +621,6 @@ static Condcode positiveIse_Condcode ( Condcode cond, } -#if 0 -/* UNUSED -- DELETE */ -/* Get some particular flag to the lowest bit in a word. It's not - masked, tho. */ -static IRExpr* flag_to_bit0 ( UInt ccmask, IRTemp eflags ) -{ - Int shifts = 0; - vassert(ccmask == CC_MASK_C || ccmask == CC_MASK_P - || ccmask == CC_MASK_A || ccmask == CC_MASK_Z - || ccmask == CC_MASK_S || ccmask == CC_MASK_O); - while ((ccmask & 1) == 0) { - ccmask >>= 1; - shifts++; - vassert(ccmask != 0); - } - if (shifts == 0) - return mkexpr(eflags); - else - return binop(Iop_Shr32, mkexpr(eflags), mkU8(shifts)); -} - - -/* Calculate the eflags, and hence return a 1-bit expression - which is 1 iff the given condition-code test would succeed. - Returns a value :: Ity_Bit. -*/ -static IRExpr* calculate_condition ( Condcode cond ) -{ - IRExpr *e; - IRTemp eflags = newTemp(Ity_I32); - Bool invert = (cond & 1) == 1; - - assign( eflags, cond == CondB ? mk_calculate_eflags_c() - : mk_calculate_eflags_all() ); - - switch (cond) { - case CondNO: - case CondO: /* OF == 1 */ - e = flag_to_bit0( CC_MASK_O, eflags ); - break; - case CondNZ: - case CondZ: /* ZF == 1 */ - e = flag_to_bit0( CC_MASK_Z, eflags ); - break; - case CondNB: - case CondB: /* CF == 1 */ - e = flag_to_bit0( CC_MASK_C, eflags ); - break; - case CondNBE: - case CondBE: /* (CF or ZF) == 1 */ - e = binop(Iop_Or32, - flag_to_bit0(CC_MASK_C,eflags), - flag_to_bit0(CC_MASK_Z,eflags) ); - break; - case CondNS: - case CondS: /* SF == 1 */ - e = flag_to_bit0( CC_MASK_S, eflags ); - break; - case CondNP: - case CondP: /* PF == 1 */ - e = flag_to_bit0( CC_MASK_P, eflags ); - break; - case CondNL: - case CondL: /* (SF xor OF) == 1 */ - e = binop(Iop_Xor32, - flag_to_bit0(CC_MASK_S,eflags), - flag_to_bit0(CC_MASK_O,eflags) - ); - break; - case CondNLE: - case CondLE: /* ((SF xor OF) or ZF) == 1 */ - e = binop(Iop_Or32, - binop(Iop_Xor32, - flag_to_bit0(CC_MASK_S,eflags), - flag_to_bit0(CC_MASK_O,eflags) - ), - flag_to_bit0(CC_MASK_Z,eflags)); - break; - default: - vex_printf("calculate_condition(%d)\n", (Int)cond); - vpanic("calculate_condition(x86)"); - } - return - invert ? unop(Iop_32to1, unop(Iop_Not32, e)) - : unop(Iop_32to1, e); -} -#endif - - /* -------------- Helpers for ADD/SUB with carry. -------------- */ /* Given ta1, ta2 and tdst, compute tdst = ADC(ta1,ta2) and set flags