target-sparc: Use DisasCompare in Tcc

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Richard Henderson 2012-10-05 16:54:58 -07:00 committed by Blue Swirl
parent 416fcaea1e
commit 3a49e7598b

View File

@ -2613,25 +2613,28 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn)
gen_helper_raise_exception(cpu_env, cpu_tmp32); gen_helper_raise_exception(cpu_env, cpu_tmp32);
} else if (cond != 0) { } else if (cond != 0) {
TCGv r_cond = tcg_temp_new(); DisasCompare cmp;
int l1; int l1;
#ifdef TARGET_SPARC64 #ifdef TARGET_SPARC64
/* V9 icc/xcc */ /* V9 icc/xcc */
int cc = GET_FIELD_SP(insn, 11, 12); int cc = GET_FIELD_SP(insn, 11, 12);
save_state(dc); save_state(dc);
if (cc == 0) if (cc == 0) {
gen_cond(r_cond, 0, cond, dc); gen_compare(&cmp, 0, cond, dc);
else if (cc == 2) } else if (cc == 2) {
gen_cond(r_cond, 1, cond, dc); gen_compare(&cmp, 1, cond, dc);
else } else {
goto illegal_insn; goto illegal_insn;
}
#else #else
save_state(dc); save_state(dc);
gen_cond(r_cond, 0, cond, dc); gen_compare(&cmp, 0, cond, dc);
#endif #endif
l1 = gen_new_label(); 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) && if ((dc->def->features & CPU_FEATURE_HYPV) &&
supervisor(dc)) 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_helper_raise_exception(cpu_env, cpu_tmp32);
gen_set_label(l1); gen_set_label(l1);
tcg_temp_free(r_cond);
} }
gen_op_next_insn(); gen_op_next_insn();
tcg_gen_exit_tb(0); tcg_gen_exit_tb(0);