diff options
author | Edgar E. Iglesias <edgar.iglesias@petalogix.com> | 2010-07-24 21:51:51 +0200 |
---|---|---|
committer | Edgar E. Iglesias <edgar.iglesias@gmail.com> | 2010-07-24 21:51:51 +0200 |
commit | b2565c694a1e9377a57594aa74f1778f7aa9a5e8 (patch) | |
tree | 5df0e861b886df2804f7a8af35f83e30dc167124 /target-microblaze/translate.c | |
parent | 61204ce8ec39bd59d4107466ef608787e117119f (diff) |
microblaze: Use setcond for conditional branches
Use setcond for evaluating the condition for branches.
In the future, we could do better for branches without
delay slots.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
Diffstat (limited to 'target-microblaze/translate.c')
-rw-r--r-- | target-microblaze/translate.c | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c index 5d2a0e6dee..3a766d8fea 100644 --- a/target-microblaze/translate.c +++ b/target-microblaze/translate.c @@ -912,50 +912,24 @@ static void dec_store(DisasContext *dc) static inline void eval_cc(DisasContext *dc, unsigned int cc, TCGv d, TCGv a, TCGv b) { - int l1; - switch (cc) { case CC_EQ: - l1 = gen_new_label(); - tcg_gen_movi_tl(env_btaken, 1); - tcg_gen_brcond_tl(TCG_COND_EQ, a, b, l1); - tcg_gen_movi_tl(env_btaken, 0); - gen_set_label(l1); + tcg_gen_setcond_tl(TCG_COND_EQ, d, a, b); break; case CC_NE: - l1 = gen_new_label(); - tcg_gen_movi_tl(env_btaken, 1); - tcg_gen_brcond_tl(TCG_COND_NE, a, b, l1); - tcg_gen_movi_tl(env_btaken, 0); - gen_set_label(l1); + tcg_gen_setcond_tl(TCG_COND_NE, d, a, b); break; case CC_LT: - l1 = gen_new_label(); - tcg_gen_movi_tl(env_btaken, 1); - tcg_gen_brcond_tl(TCG_COND_LT, a, b, l1); - tcg_gen_movi_tl(env_btaken, 0); - gen_set_label(l1); + tcg_gen_setcond_tl(TCG_COND_LT, d, a, b); break; case CC_LE: - l1 = gen_new_label(); - tcg_gen_movi_tl(env_btaken, 1); - tcg_gen_brcond_tl(TCG_COND_LE, a, b, l1); - tcg_gen_movi_tl(env_btaken, 0); - gen_set_label(l1); + tcg_gen_setcond_tl(TCG_COND_LE, d, a, b); break; case CC_GE: - l1 = gen_new_label(); - tcg_gen_movi_tl(env_btaken, 1); - tcg_gen_brcond_tl(TCG_COND_GE, a, b, l1); - tcg_gen_movi_tl(env_btaken, 0); - gen_set_label(l1); + tcg_gen_setcond_tl(TCG_COND_GE, d, a, b); break; case CC_GT: - l1 = gen_new_label(); - tcg_gen_movi_tl(env_btaken, 1); - tcg_gen_brcond_tl(TCG_COND_GT, a, b, l1); - tcg_gen_movi_tl(env_btaken, 0); - gen_set_label(l1); + tcg_gen_setcond_tl(TCG_COND_GT, d, a, b); break; default: cpu_abort(dc->env, "Unknown condition code %x.\n", cc); |