The overflow computation of nego and subf*o instructions has been broken
in commit ffe30937. This patch fixes it.

With this change the PPC emulation passes the Gwenole Beauchesne
testsuite again.

Cc: Alexander Graf <[email protected]>
Cc: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
---
 target-ppc/translate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 5e741d1..062493a 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -749,7 +749,7 @@ static inline void gen_op_arith_compute_ov(DisasContext 
*ctx, TCGv arg0,
     tcg_gen_xor_tl(cpu_ov, arg0, arg1);
     tcg_gen_xor_tl(t0, arg1, arg2);
     if (sub) {
-        tcg_gen_and_tl(cpu_ov, cpu_ov, t0);
+        tcg_gen_andc_tl(cpu_ov, t0, cpu_ov);
     } else {
         tcg_gen_andc_tl(cpu_ov, cpu_ov, t0);
     }
-- 
1.7.10.4


Reply via email to