From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZRjl-0000u0-Jq for qemu-devel@nongnu.org; Thu, 24 Oct 2013 16:42:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZRjd-0000NM-7N for qemu-devel@nongnu.org; Thu, 24 Oct 2013 16:42:33 -0400 Message-ID: <5269862B.4090701@gmail.com> Date: Thu, 24 Oct 2013 15:42:19 -0500 From: Tom Musta MIME-Version: 1.0 References: <526947CA.4020504@gmail.com> <52694896.5040304@gmail.com> <52696C48.9040505@twiddle.net> In-Reply-To: <52696C48.9040505@twiddle.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 03/19] General Support for VSX Helpers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , QEMU Developers Cc: "qemu-ppc@nongnu.org" On 10/24/2013 1:51 PM, Richard Henderson wrote: > On 10/24/2013 09:19 AM, Tom Musta wrote: >> >> +#define GEN_VSX_HELPER_2(name, op1, op2, inval, type) \ >> +static void gen_##name(DisasContext * ctx) \ >> +{ \ >> + TCGv_i32 opc; \ >> + if (unlikely(!ctx->vsx_enabled)) { \ >> + gen_exception(ctx, POWERPC_EXCP_VSXU); \ >> + return; \ >> + } \ >> + /* NIP cannot be restored if the memory exception comes from an helper */ \ >> + gen_update_nip(ctx, ctx->nip - 4); \ >> + opc = tcg_const_i32(ctx->opcode); \ >> + gen_helper_##name(cpu_env, opc); \ >> + tcg_temp_free_i32(opc); \ >> +} > > I'm not a fan of delaying decode to the helpers... > > You're mostly doing this to avoid passing 3-4 arguments > for the register numbers? Because the VSRs are 128 bits wide and because there is an interesting relationship with the FPRs and AVRs, passing 6 or more arguments would typically be required (2 per VSR). And, they would need to be stitched back together into a single structure in order to use the loops in the vector routines. I did prototype something like this and didn't like it. Unless you are suggesting that the decoded VSR index (0..63) be passed to the helper?