Received: from eggs.gnu.org ([208.118.235.92]:50832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMSgd-0003p5-AO for qemu-devel@nongnu.org; Sun, 31 Mar 2013 20:33:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UMSga-0003cC-Ps for qemu-devel@nongnu.org; Sun, 31 Mar 2013 20:33:23 -0400 Received: from hall.aurel32.net ([2001:470:1f15:c4f::1]:49397) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMSga-0003c5-Jm for qemu-devel@nongnu.org; Sun, 31 Mar 2013 20:33:20 -0400 From: Aurelien Jarno Date: Mon, 1 Apr 2013 02:33:16 +0200 Message-Id: <1364776396-21581-1-git-send-email-aurelien@aurel32.net> Subject: [Qemu-devel] [PATCH v2] target-ppc: fix nego and subf*o instructions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexander Graf , Aurelien Jarno , Richard Henderson The overflow computation of nego and subf*o instructions has been broken in commit ffe30937. Contrary to other targets, the instruction is subtract from an not subtract on PowerPC. This patch fixes the issue by using the correct argument in the xor computation. Thanks to Peter Maydell for the hint. With this change the PPC emulation passes the Gwenole Beauchesne testsuite again. Cc: Alexander Graf Cc: Richard Henderson Signed-off-by: Aurelien Jarno --- 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..294ab58 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -746,7 +746,7 @@ static inline void gen_op_arith_compute_ov(DisasContext *ctx, TCGv arg0, { TCGv t0 = tcg_temp_new(); - tcg_gen_xor_tl(cpu_ov, arg0, arg1); + tcg_gen_xor_tl(cpu_ov, arg0, arg2); tcg_gen_xor_tl(t0, arg1, arg2); if (sub) { tcg_gen_and_tl(cpu_ov, cpu_ov, t0); -- 1.7.10.4