Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LJ70x-00004z-NP for qemu-devel@nongnu.org; Sat, 03 Jan 2009 08:58:07 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LJ70w-0008WT-BJ for qemu-devel@nongnu.org; Sat, 03 Jan 2009 08:58:06 -0500 Received: from [199.232.76.173] (port=33544 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJ70w-0008WQ-4w for qemu-devel@nongnu.org; Sat, 03 Jan 2009 08:58:06 -0500 Received: from hall.aurel32.net ([88.191.82.174]:54259) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LJ70v-0002Bf-Gw for qemu-devel@nongnu.org; Sat, 03 Jan 2009 08:58:05 -0500 Date: Sat, 3 Jan 2009 14:58:03 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH 07/40] Add GEN_VXRFORM{, 1} macros for subsequent instructions. Message-ID: <20090103135803.GJ8871@hall.aurel32.net> References: <1230693022-18380-1-git-send-email-froydnj@codesourcery.com> <1230693022-18380-8-git-send-email-froydnj@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1230693022-18380-8-git-send-email-froydnj@codesourcery.com> Sender: Aurelien Jarno Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nathan Froyd Cc: qemu-devel@nongnu.org On Tue, Dec 30, 2008 at 07:09:49PM -0800, Nathan Froyd wrote: > > Signed-off-by: Nathan Froyd > --- > target-ppc/translate.c | 27 +++++++++++++++++++++++++++ > 1 files changed, 27 insertions(+), 0 deletions(-) > > diff --git a/target-ppc/translate.c b/target-ppc/translate.c > index 56d5c51..967d9da 100644 > --- a/target-ppc/translate.c > +++ b/target-ppc/translate.c > @@ -6206,6 +6206,33 @@ GEN_VXFORM(vavgsb, 1, 20); > GEN_VXFORM(vavgsh, 1, 21); > GEN_VXFORM(vavgsw, 1, 22); > > +#define GEN_VXRFORM1(opname, name, str, opc2, opc3) \ > + GEN_HANDLER2(name, str, 0x4, opc2, opc3, 0x00000000, PPC_ALTIVEC) \ > + { \ > + TCGv_ptr ra, rb, rd; \ > + TCGv_i32 result; \ > + if (unlikely(!ctx->altivec_enabled)) { \ > + gen_exception(ctx, POWERPC_EXCP_VPU); \ > + return; \ > + } \ > + ra = gen_avr_ptr(rA(ctx->opcode)); \ > + rb = gen_avr_ptr(rB(ctx->opcode)); \ > + rd = gen_avr_ptr(rD(ctx->opcode)); \ > + result = tcg_temp_new_i32(); \ > + gen_helper_##opname (result, rd, ra, rb); \ > + if (opc3 & 0x1) { \ This should be opc3 & (0x1 << 4). > + tcg_gen_mov_i32(cpu_crf[6], result); \ > + } \ By the way, given those functions are using helpers, it may be better to have one helper for normal functions and one helper for '.' functions which directly write env->crf[6]. It would probably be a bit faster. Note that the other PowerPC instructions are maybe not the best templates for that, given they have been translated from dyngen. I am planning to fold part of the TCG code directly into the helper for some of them. > + tcg_temp_free_ptr(ra); \ > + tcg_temp_free_ptr(rb); \ > + tcg_temp_free_ptr(rd); \ > + tcg_temp_free_i32(result); \ > + } > + > +#define GEN_VXRFORM(name, opc2, opc3) \ > + GEN_VXRFORM1(name, name, #name, opc2, opc3) \ > + GEN_VXRFORM1(name, name##_, #name ".", opc2, (opc3 | (0x1 << 4))) > + > /*** SPE extension ***/ > /* Register moves */ > > -- > 1.6.0.5 > > > > -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net