From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcfVz-0006Cz-KE for qemu-devel@nongnu.org; Fri, 01 Jul 2011 11:20:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QcfVx-0006YX-Q8 for qemu-devel@nongnu.org; Fri, 01 Jul 2011 11:20:19 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:57423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcfVx-0006YP-Gv for qemu-devel@nongnu.org; Fri, 01 Jul 2011 11:20:17 -0400 Received: by qwj8 with SMTP id 8so1985585qwj.4 for ; Fri, 01 Jul 2011 08:20:16 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <4E0CE6A7.10901@jermar.eu> <4E0D9527.7010106@jermar.eu> <4E0DC450.4000700@jermar.eu> Date: Fri, 1 Jul 2011 17:20:16 +0200 Message-ID: From: Laurent Desnogues Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [HelenOS-devel] [sparc64] Miscomputed minimum of a group of numbers in sparc64 emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Artyom Tarasenko Cc: Jakub Jermar , HelenOS development mailing list , qemu-devel@nongnu.org On Fri, Jul 1, 2011 at 5:03 PM, Artyom Tarasenko wrot= e: [...] >> I find it odd that udivx is using cpu_cc_src and cpu_cc_src2. =A0Using >> dedicated local temps seems to fix the issue. > > Do we need to copy cpu_src* to further temps at all? IMHO > > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tcg_gen_mov_tl(cpu_cc_sr= c, cpu_src1); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tcg_gen_mov_tl(cpu_cc_sr= c2, cpu_src2); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0gen_trap_ifdivzero_tl(cp= u_cc_src2); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tcg_gen_divu_i64(cpu_dst= , cpu_cc_src, cpu_cc_src2); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0gen_trap_ifdivzero_tl(cp= u_src2); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tcg_gen_divu_i64(cpu_dst= , cpu_src1, cpu_src2); > > should do it. Or cpu_src is what you mean by dedicated? You have to use two local temps here to store cpu_src1 and cpu_src2 because gen_trap_ifdivzero_tl uses tcg_gen_brcondi_tl (cf tcg/README comment about local usage and jumps). Note you'll have to do something similar in gen_op_sdivx. Laurent