From db9f2597722d5d8bc5f2330f186288d893114338 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 23 Jan 2013 16:10:49 -0800 Subject: target-i386: Make helper_cc_compute_{all,c} const Pass the data in explicitly, rather than indirectly via env. This avoids all sorts of unnecessary register spillage. Signed-off-by: Richard Henderson --- target-i386/cc_helper.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'target-i386/cc_helper.c') diff --git a/target-i386/cc_helper.c b/target-i386/cc_helper.c index 61427ddeac..a5d8181804 100644 --- a/target-i386/cc_helper.c +++ b/target-i386/cc_helper.c @@ -75,10 +75,8 @@ const uint8_t parity_table[256] = { #endif -uint32_t helper_cc_compute_all(CPUX86State *env, int op) +target_ulong helper_cc_compute_all(target_ulong dst, target_ulong src1, int op) { - target_ulong dst = CC_DST, src1 = CC_SRC; - switch (op) { default: /* should never happen */ return 0; @@ -183,13 +181,11 @@ uint32_t helper_cc_compute_all(CPUX86State *env, int op) uint32_t cpu_cc_compute_all(CPUX86State *env, int op) { - return helper_cc_compute_all(env, op); + return helper_cc_compute_all(CC_DST, CC_SRC, op); } -uint32_t helper_cc_compute_c(CPUX86State *env, int op) +target_ulong helper_cc_compute_c(target_ulong dst, target_ulong src1, int op) { - target_ulong dst = CC_DST, src1 = CC_SRC; - switch (op) { default: /* should never happen */ case CC_OP_LOGICB: @@ -281,7 +277,7 @@ target_ulong helper_read_eflags(CPUX86State *env) { uint32_t eflags; - eflags = helper_cc_compute_all(env, CC_OP); + eflags = cpu_cc_compute_all(env, CC_OP); eflags |= (DF & DF_MASK); eflags |= env->eflags & ~(VM_MASK | RF_MASK); return eflags; -- cgit v1.2.1