diff options
author | Richard Henderson <rth@twiddle.net> | 2013-02-19 14:48:43 -0800 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2013-02-19 23:05:19 -0800 |
commit | e2f515cf2f3795b9edb68eee42262e7c5f88fe98 (patch) | |
tree | 360eaa846145bb8e7b46726c9df88984446751c9 /target-i386/translate.c | |
parent | 34d80a55ff8517fd37bcfea5063b9797e2bd9132 (diff) |
target-i386: Discard CC_OP computation in set_cc_op also
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>
Diffstat (limited to 'target-i386/translate.c')
-rw-r--r-- | target-i386/translate.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/target-i386/translate.c b/target-i386/translate.c index 6b109e853b..b9a2692991 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -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) |