aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2012-10-05 16:54:58 -0700
committerBlue Swirl <blauwirbel@gmail.com>2012-10-07 16:39:31 +0000
commit3a49e7598b78bca019e35c42590914faab2a817a (patch)
tree67d8d681c452d37ce3b7348653c23857878e08e8
parent416fcaea1ef7e9a71ccb0a968de594618ed7675e (diff)
downloadqemu-3a49e7598b78bca019e35c42590914faab2a817a.zip
qemu-3a49e7598b78bca019e35c42590914faab2a817a.tar.gz
qemu-3a49e7598b78bca019e35c42590914faab2a817a.tar.bz2
target-sparc: Use DisasCompare in Tcc
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r--target-sparc/translate.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index d61a9a0..fa9a057 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -2613,25 +2613,28 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn)
gen_helper_raise_exception(cpu_env, cpu_tmp32);
} else if (cond != 0) {
- TCGv r_cond = tcg_temp_new();
+ DisasCompare cmp;
int l1;
#ifdef TARGET_SPARC64
/* V9 icc/xcc */
int cc = GET_FIELD_SP(insn, 11, 12);
save_state(dc);
- if (cc == 0)
- gen_cond(r_cond, 0, cond, dc);
- else if (cc == 2)
- gen_cond(r_cond, 1, cond, dc);
- else
+ if (cc == 0) {
+ gen_compare(&cmp, 0, cond, dc);
+ } else if (cc == 2) {
+ gen_compare(&cmp, 1, cond, dc);
+ } else {
goto illegal_insn;
+ }
#else
save_state(dc);
- gen_cond(r_cond, 0, cond, dc);
+ gen_compare(&cmp, 0, cond, dc);
#endif
l1 = gen_new_label();
- tcg_gen_brcondi_tl(TCG_COND_EQ, r_cond, 0, l1);
+ tcg_gen_brcond_tl(tcg_invert_cond(cmp.cond),
+ cmp.c1, cmp.c2, l1);
+ free_compare(&cmp);
if ((dc->def->features & CPU_FEATURE_HYPV) &&
supervisor(dc))
@@ -2643,7 +2646,6 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn)
gen_helper_raise_exception(cpu_env, cpu_tmp32);
gen_set_label(l1);
- tcg_temp_free(r_cond);
}
gen_op_next_insn();
tcg_gen_exit_tb(0);