From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKfqz-0007lV-Qg for qemu-devel@nongnu.org; Wed, 07 Jan 2009 16:22:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKfqy-0007kp-3M for qemu-devel@nongnu.org; Wed, 07 Jan 2009 16:22:17 -0500 Received: from [199.232.76.173] (port=43576 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKfqx-0007kh-Q8 for qemu-devel@nongnu.org; Wed, 07 Jan 2009 16:22:15 -0500 Received: from mx20.gnu.org ([199.232.41.8]:30106) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LKfqx-0003kp-JI for qemu-devel@nongnu.org; Wed, 07 Jan 2009 16:22:15 -0500 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LKfqv-0006qc-U9 for qemu-devel@nongnu.org; Wed, 07 Jan 2009 16:22:14 -0500 Date: Wed, 7 Jan 2009 13:22:11 -0800 From: Nathan Froyd Subject: Re: [Qemu-devel] [PATCH 07/40] Add GEN_VXRFORM{, 1} macros for subsequent instructions. Message-ID: <20090107212211.GB28711@codesourcery.com> References: <1230693022-18380-1-git-send-email-froydnj@codesourcery.com> <1230693022-18380-8-git-send-email-froydnj@codesourcery.com> <20090103135803.GJ8871@hall.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090103135803.GJ8871@hall.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: qemu-devel@nongnu.org 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 --- 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