Fix taddcctv and tsubcctv (David Matthews)
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 10 Oct 2007 19:11:54 +0000 (19:11 +0000)
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 10 Oct 2007 19:11:54 +0000 (19:11 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3379 c046a42c-6fe2-441c-8c8c-71466251a162

target-sparc/op.c
target-sparc/translate.c

index 613bcb09abce5571c2194927c90a5c7ce44f1f1f..e12347df1f73fcb59973124d46bfae2f2bd43481 100644 (file)
@@ -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
 
index 1a6d56ac40ba62b68423da5aa15710100b54a413..27c22ede598ab3d460b40381f6fd7622260e7d75 100644 (file)
@@ -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;