From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KYrbA-0003jC-SD for qemu-devel@nongnu.org; Thu, 28 Aug 2008 20:12:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KYrb9-0003iz-0Y for qemu-devel@nongnu.org; Thu, 28 Aug 2008 20:12:20 -0400 Received: from [199.232.76.173] (port=44186 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KYrb8-0003iw-Rz for qemu-devel@nongnu.org; Thu, 28 Aug 2008 20:12:18 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:60269) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KYrb8-00015L-HM for qemu-devel@nongnu.org; Thu, 28 Aug 2008 20:12:18 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [5100] SH4: Convert register moves to TCG Date: Fri, 29 Aug 2008 01:12:12 +0100 References: <200808282313.42947.paul@codesourcery.com> <20080828232353.GA10605@volta.aurel32.net> In-Reply-To: <20080828232353.GA10605@volta.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200808290112.13308.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Aurelien Jarno On Friday 29 August 2008, Aurelien Jarno wrote: > On Thu, Aug 28, 2008 at 11:13:42PM +0100, Paul Brook wrote: > > On Thursday 28 August 2008, Aurelien Jarno wrote: > > > +static always_inline void gen_movl_T_rN (TCGv t, int reg) > > > +{ > > > + =A0 =A0tcg_gen_st_tl(t, cpu_env, offsetof(CPUState, gregs[reg])); > > > > The preferred way of doing this is to have TCG variables for common > > (possibly all?) registers. See e.g. m68k or sparc. > > Until now I have used MIPS as an example, it copies CPU registers to TCG > variables. As you pointed, m68k and sparc use direct access to CPU > registers through TCG variables. > > I wonder in which way what your propose is better? It seems easier to > write, but what about the runtime speed? I'm guessing that with current tcg there's not a lot of difference. Using=20 variables (like sparc/m68k) gives scope for better/easier code generation i= n=20 the future, and makes debug dumps look prettier. Paul