From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KewMd-0007bl-KK for qemu-devel@nongnu.org; Sun, 14 Sep 2008 14:30:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KewMc-0007ad-MQ for qemu-devel@nongnu.org; Sun, 14 Sep 2008 14:30:27 -0400 Received: from [199.232.76.173] (port=40343 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KewMc-0007aU-D2 for qemu-devel@nongnu.org; Sun, 14 Sep 2008 14:30:26 -0400 Received: from hall.aurel32.net ([91.121.138.14]:52475) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KewMb-0006rY-UI for qemu-devel@nongnu.org; Sun, 14 Sep 2008 14:30:26 -0400 Received: from volta.aurel32.net ([2002:52e8:2fb:1:21e:8cff:feb0:693b]) by hall.aurel32.net with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1KewMY-0001l8-JZ for qemu-devel@nongnu.org; Sun, 14 Sep 2008 20:30:23 +0200 Received: from aurel32 by volta.aurel32.net with local (Exim 4.69) (envelope-from ) id 1KewMX-0006nx-Rj for qemu-devel@nongnu.org; Sun, 14 Sep 2008 20:30:21 +0200 Date: Sun, 14 Sep 2008 20:30:21 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH 1/2] ppc: Convert ctr, lr moves to TCG Message-ID: <20080914183021.GI22422@volta.aurel32.net> References: <0485E6FE-5D41-4E23-88F7-514FA3A25C4C@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0485E6FE-5D41-4E23-88F7-514FA3A25C4C@web.de> 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 On Sun, Sep 14, 2008 at 01:06:05PM +0200, Andreas Färber wrote: > Introduce TCG variables cpu_{ctr,lr} and replace > op_{load,store}_{lr,ctr} with tcg_gen_mov_tl. > > Signed-off-by: Andreas Faerber Applied, thanks. > --- > Hello, > > A quick inbox search for ppc did not reveal new patches, so I hope > these two still apply. > > Andreas > > target-ppc/op.c | 24 ------------------------ > target-ppc/translate.c | 8 ++++++++ > target-ppc/translate_init.c | 8 ++++---- > 3 files changed, 12 insertions(+), 28 deletions(-) > > diff --git a/target-ppc/op.c b/target-ppc/op.c > index 01b944b..95ab8b9 100644 > --- a/target-ppc/op.c > +++ b/target-ppc/op.c > @@ -233,30 +233,6 @@ void OPPROTO op_mask_spr (void) > RETURN(); > } > > -void OPPROTO op_load_lr (void) > -{ > - T0 = env->lr; > - RETURN(); > -} > - > -void OPPROTO op_store_lr (void) > -{ > - env->lr = T0; > - RETURN(); > -} > - > -void OPPROTO op_load_ctr (void) > -{ > - T0 = env->ctr; > - RETURN(); > -} > - > -void OPPROTO op_store_ctr (void) > -{ > - env->ctr = T0; > - RETURN(); > -} > - > void OPPROTO op_load_tbl (void) > { > T0 = cpu_ppc_load_tbl(env); > diff --git a/target-ppc/translate.c b/target-ppc/translate.c > index 6561304..cc1f836 100644 > --- a/target-ppc/translate.c > +++ b/target-ppc/translate.c > @@ -61,6 +61,8 @@ static TCGv cpu_fpr[32]; > static TCGv cpu_avrh[32], cpu_avrl[32]; > static TCGv cpu_crf[8]; > static TCGv cpu_nip; > +static TCGv cpu_ctr; > +static TCGv cpu_lr; > > /* dyngen register indexes */ > static TCGv cpu_T[3]; > @@ -168,6 +170,12 @@ void ppc_translate_init(void) > cpu_nip = tcg_global_mem_new(TCG_TYPE_TL, TCG_AREG0, > offsetof(CPUState, nip), "nip"); > > + cpu_ctr = tcg_global_mem_new(TCG_TYPE_TL, TCG_AREG0, > + offsetof(CPUState, ctr), "ctr"); > + > + cpu_lr = tcg_global_mem_new(TCG_TYPE_TL, TCG_AREG0, > + offsetof(CPUState, lr), "lr"); > + > /* register helpers */ > #undef DEF_HELPER > #define DEF_HELPER(ret, name, params) tcg_register_helper(name, #name); > diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c > index 9393e3b..3e103dd 100644 > --- a/target-ppc/translate_init.c > +++ b/target-ppc/translate_init.c > @@ -110,23 +110,23 @@ static void spr_write_xer (void *opaque, int sprn) > /* LR */ > static void spr_read_lr (void *opaque, int sprn) > { > - gen_op_load_lr(); > + tcg_gen_mov_tl(cpu_T[0], cpu_lr); > } > > static void spr_write_lr (void *opaque, int sprn) > { > - gen_op_store_lr(); > + tcg_gen_mov_tl(cpu_lr, cpu_T[0]); > } > > /* CTR */ > static void spr_read_ctr (void *opaque, int sprn) > { > - gen_op_load_ctr(); > + tcg_gen_mov_tl(cpu_T[0], cpu_ctr); > } > > static void spr_write_ctr (void *opaque, int sprn) > { > - gen_op_store_ctr(); > + tcg_gen_mov_tl(cpu_ctr, cpu_T[0]); > } > > /* User read access to SPR */ > -- > 1.5.5.1 > -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net