aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2013-01-23 13:49:43 -0800
committerRichard Henderson <rth@twiddle.net>2013-02-18 15:03:57 -0800
commit2cb4764577f270eec259123955a6396ad6a2f161 (patch)
tree382cf18ddb97ed8ec87699ce1ea3f1a1c96401d6
parent1a5c635947e60167c4626dd274531b8b0eacc2e5 (diff)
target-i386: optimize setbe
This is looking at EFLAGS, but it can do so more efficiently with setcond. Reviewed-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Richard Henderson <rth@twiddle.net>
-rw-r--r--target-i386/translate.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/target-i386/translate.c b/target-i386/translate.c
index c510732765..dab69839a7 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -1060,10 +1060,9 @@ static void gen_setcc_slow(DisasContext *s, int jcc_op, TCGv reg, bool inv)
break;
case JCC_BE:
gen_compute_eflags(s);
- tcg_gen_shri_tl(reg, cpu_cc_src, 6);
- tcg_gen_or_tl(reg, reg, cpu_cc_src);
- tcg_gen_andi_tl(reg, reg, 1);
- break;
+ tcg_gen_andi_tl(reg, cpu_cc_src, CC_Z | CC_C);
+ tcg_gen_setcondi_tl(inv ? TCG_COND_EQ : TCG_COND_NE, reg, reg, 0);
+ return;
case JCC_S:
gen_compute_eflags_s(s, reg, inv);
inv = false;