From 363d3679218c2897a00e48d21fb63e63180c7f9f Mon Sep 17 00:00:00 2001 From: blueswir1 Date: Wed, 10 Oct 2007 19:11:53 +0000 Subject: [PATCH] Fix taddcctv and tsubcctv (David Matthews) --- target-sparc/op.c | 2 +- target-sparc/translate.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/target-sparc/op.c b/target-sparc/op.c index 613bcb09ab..e12347df1f 100644 --- a/target-sparc/op.c +++ b/target-sparc/op.c @@ -534,7 +534,7 @@ void OPPROTO op_tadd_T1_T0_ccTV(void) ((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31)) raise_exception(TT_TOVF); #else - if ((src1 & 0x03) || (T1 & 0x03)) + if (((src1 ^ T1 ^ -1) & (src1 ^ T0)) & (1 << 31)) raise_exception(TT_TOVF); #endif diff --git a/target-sparc/translate.c b/target-sparc/translate.c index 1a6d56ac40..27c22ede59 100644 --- a/target-sparc/translate.c +++ b/target-sparc/translate.c @@ -2027,10 +2027,12 @@ static void disas_sparc_insn(DisasContext * dc) gen_movl_T0_reg(rd); break; case 0x22: /* taddcctv */ + save_state(dc); gen_op_tadd_T1_T0_ccTV(); gen_movl_T0_reg(rd); break; case 0x23: /* tsubcctv */ + save_state(dc); gen_op_tsub_T1_T0_ccTV(); gen_movl_T0_reg(rd); break; -- 2.11.4.GIT