Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LL02D-0005Rb-KG for qemu-devel@nongnu.org; Thu, 08 Jan 2009 13:55:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LL029-0005QB-Mo for qemu-devel@nongnu.org; Thu, 08 Jan 2009 13:55:10 -0500 Received: from [199.232.76.173] (port=56730 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LL028-0005Pp-6q for qemu-devel@nongnu.org; Thu, 08 Jan 2009 13:55:08 -0500 Received: from hall.aurel32.net ([88.191.82.174]:33241) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LL027-0007tR-GV for qemu-devel@nongnu.org; Thu, 08 Jan 2009 13:55:07 -0500 Date: Thu, 8 Jan 2009 19:55:05 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH 07/40] Add GEN_VXRFORM{, 1} macros for subsequent instructions. Message-ID: <20090108185505.GG22095@hall.aurel32.net> References: <1230693022-18380-1-git-send-email-froydnj@codesourcery.com> <1230693022-18380-8-git-send-email-froydnj@codesourcery.com> <20090103135803.GJ8871@hall.aurel32.net> <20090107212211.GB28711@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20090107212211.GB28711@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 Wed, Jan 07, 2009 at 01:22:11PM -0800, Nathan Froyd wrote: > On Sat, Jan 03, 2009 at 02:58:03PM +0100, Aurelien Jarno wrote: > > On Tue, Dec 30, 2008 at 07:09:49PM -0800, Nathan Froyd wrote: > > > + if (opc3 & 0x1) { \ > > > > This should be opc3 & (0x1 << 4). > > I knew I would screw that up, thanks for catching it. > > > > + 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. > > I'm ambivalent on this; I think that executing vcmp* instructions > happens infrequently enough that it's probably not worth optimizing them > by computing/writing the result when the record bit is set. But the > patch below (and subsequent incoming patch for the vcmp* instructions) > implements your suggestion. > > -Nathan > > Use separate helpers for recording and non-recording instructions. > > Signed-off-by: Nathan Froyd Thanks, applied. > --- > target-ppc/translate.c | 21 +++++++++++++++++++++ > 1 files changed, 21 insertions(+), 0 deletions(-) > > diff --git a/target-ppc/translate.c b/target-ppc/translate.c > index 03dac58..ee3c747 100644 > --- a/target-ppc/translate.c > +++ b/target-ppc/translate.c > @@ -6359,6 +6359,27 @@ GEN_VXFORM(vsum4shs, 4, 25); > GEN_VXFORM(vsum2sws, 4, 26); > GEN_VXFORM(vsumsws, 4, 30); > > +#define GEN_VXRFORM1(opname, name, str, opc2, opc3) \ > + GEN_HANDLER2(name, str, 0x4, opc2, opc3, 0x00000000, PPC_ALTIVEC) \ > + { \ > + TCGv_ptr ra, rb, rd; \ > + 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)); \ > + gen_helper_##opname (rd, ra, rb); \ > + tcg_temp_free_ptr(ra); \ > + tcg_temp_free_ptr(rb); \ > + tcg_temp_free_ptr(rd); \ > + } > + > +#define GEN_VXRFORM(name, opc2, opc3) \ > + GEN_VXRFORM1(name, name, #name, opc2, opc3) \ > + GEN_VXRFORM1(name##_dot, name##_, #name ".", opc2, (opc3 | (0x1 << 4))) > + > #define GEN_VXFORM_NOA(name, opc2, opc3) \ > GEN_HANDLER(name, 0x04, opc2, opc3, 0x001f0000, PPC_ALTIVEC) \ > { \ > -- > 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