From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMSWG-0000rA-GB for qemu-devel@nongnu.org; Sun, 31 Mar 2013 20:22:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UMSWA-000154-Dk for qemu-devel@nongnu.org; Sun, 31 Mar 2013 20:22:40 -0400 Received: from hall.aurel32.net ([2001:470:1f15:c4f::1]:49363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMSWA-00014v-6b for qemu-devel@nongnu.org; Sun, 31 Mar 2013 20:22:34 -0400 Date: Mon, 1 Apr 2013 02:22:31 +0200 From: Aurelien Jarno Message-ID: <20130401002231.GD6467@hall.aurel32.net> References: <1364687686-6006-1-git-send-email-aurelien@aurel32.net> <5158C491.4010509@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <5158C491.4010509@twiddle.net> Sender: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] target-ppc: fix nego and subf*o instructions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, Alexander Graf On Sun, Mar 31, 2013 at 04:19:45PM -0700, Richard Henderson wrote: > On 2013-03-30 16:54, Aurelien Jarno wrote: > >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 > >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..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); > > } > > I'm a bit confused. This is the exact same algorithm that's used on > ARM and i386. And as far as I can determine, all three platforms > have the same definition of "overflow". > I based my patch on the previous version of the code, which swaps *both* the brcond conditions testing the results of the xor. As far I understand the brcond are replaced by the and/andc in your patch. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net