Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HU8Qi-0007eT-58 for qemu-devel@nongnu.org; Wed, 21 Mar 2007 17:33:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HU8Qg-0007bl-OZ for qemu-devel@nongnu.org; Wed, 21 Mar 2007 17:33:11 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HU8Qg-0007bc-II for qemu-devel@nongnu.org; Wed, 21 Mar 2007 16:33:10 -0500 Received: from farad.aurel32.net ([82.232.2.251] helo=mail.aurel32.net) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HU8Ox-0007qh-2i for qemu-devel@nongnu.org; Wed, 21 Mar 2007 17:31:23 -0400 Date: Wed, 21 Mar 2007 22:31:20 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [SPARC] Branch condition problems Message-ID: <20070321213119.GA32700@amd64.aurel32.net> References: <460196E6.5010507@aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <460196E6.5010507@aurel32.net> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org On Wed, Mar 21, 2007 at 09:34:46PM +0100, Aurelien Jarno wrote: > Blue Swirl a écrit : > >>From my tests, it seems that std in a delayed branch slot occurs a > >> hundred of time during a boot, so not a lot. Adding a new field to the > >> CPU structure would probably decrease the performances (except on > >> hosts with a lot of registers). Therefore I am proposing something like > >> that (currently for std only): > > > > Can you test if this works instead? > > > > The first hunk works well, and is indeed better than my patch. The > second hunk applies, but does not compile. > The patch below (that includes the first hunk of your patch) also fixes stda. There is probably a smarter way to do that for the second hunk, but that imply more changes. Index: target-sparc/translate.c =================================================================== RCS file: /sources/qemu/qemu/target-sparc/translate.c,v retrieving revision 1.34 diff -u -d -p -r1.34 translate.c --- target-sparc/translate.c 23 Oct 2006 21:37:34 -0000 1.34 +++ target-sparc/translate.c 21 Mar 2007 21:23:18 -0000 @@ -2454,8 +2454,8 @@ static void disas_sparc_insn(DisasContex gen_op_ldst(sth); break; case 0x7: - flush_T2(dc); - gen_movl_reg_T2(rd + 1); + gen_op_ldst(st); + gen_movl_reg_T1(rd + 1); gen_op_ldst(std); break; #if !defined(CONFIG_USER_ONLY) || defined(TARGET_SPARC64) @@ -2485,9 +2485,11 @@ static void disas_sparc_insn(DisasContex if (!supervisor(dc)) goto priv_insn; #endif - flush_T2(dc); - gen_movl_reg_T2(rd + 1); - gen_op_stda(insn, 0, 8, 0); + gen_op_stda(insn, 0, 4, 0); + gen_op_movl_T1_im(4); + gen_op_add_T1_T0(); + gen_movl_reg_T1(rd + 1); + gen_op_stda(insn, 0, 4, 0); break; #endif #ifdef TARGET_SPARC64 -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net