From patchwork Mon Apr 1 00:33:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 232657 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 658E42C00B7 for ; Mon, 1 Apr 2013 11:33:41 +1100 (EST) Received: from localhost ([::1]:54855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMSgt-0003pL-DC for incoming@patchwork.ozlabs.org; Sun, 31 Mar 2013 20:33:39 -0400 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 Received: from [2001:470:d4ed:0:ea11:32ff:fea1:831a] (helo=ohm.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UMSgZ-0002uU-9f; Mon, 01 Apr 2013 02:33:19 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.80) (envelope-from ) id 1UMSgY-0005cw-69; Mon, 01 Apr 2013 02:33:18 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2013 02:33:16 +0200 Message-Id: <1364776396-21581-1-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:470:1f15:c4f::1 Cc: Alexander Graf , Aurelien Jarno , Richard Henderson Subject: [Qemu-devel] [PATCH v2] target-ppc: fix nego and subf*o instructions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Reviewed-by: Richard Henderson --- 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);