Skip to content

Commit

Permalink
target-i386: Discard CC_OP computation in set_cc_op also
Browse files Browse the repository at this point in the history
The shift and rotate insns use movcond to set CC_OP, and thus
achieve a conditional EFLAGS setting.  By discarding CC_OP in
a later flags setting insn, we can discard that movcond.

Signed-off-by: Richard Henderson <rth@twiddle.net>
  • Loading branch information
rth7680 committed Feb 20, 2013
1 parent 34d80a5 commit e2f515c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions target-i386/translate.c
Expand Up @@ -239,10 +239,18 @@ static void set_cc_op(DisasContext *s, CCOp op)
tcg_gen_discard_tl(cpu_cc_srcT);
}

if (op == CC_OP_DYNAMIC) {
/* The DYNAMIC setting is translator only, and should never be
stored. Thus we always consider it clean. */
s->cc_op_dirty = false;
} else {
/* Discard any computed CC_OP value (see shifts). */
if (s->cc_op == CC_OP_DYNAMIC) {
tcg_gen_discard_i32(cpu_cc_op);
}
s->cc_op_dirty = true;
}
s->cc_op = op;
/* The DYNAMIC setting is translator only, and should never be
stored. Thus we always consider it clean. */
s->cc_op_dirty = (op != CC_OP_DYNAMIC);
}

static void gen_update_cc_op(DisasContext *s)
Expand Down

0 comments on commit e2f515c

Please sign in to comment.