From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv7kc-0000PZ-8B for qemu-devel@nongnu.org; Wed, 20 May 2015 13:25:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yv7kY-0003ok-3a for qemu-devel@nongnu.org; Wed, 20 May 2015 13:25:50 -0400 Received: from mail-qk0-x22c.google.com ([2607:f8b0:400d:c09::22c]:33281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv7kX-0003of-Kt for qemu-devel@nongnu.org; Wed, 20 May 2015 13:25:45 -0400 Received: by qkgv12 with SMTP id v12so36422088qkg.0 for ; Wed, 20 May 2015 10:25:45 -0700 (PDT) Sender: Richard Henderson Message-ID: <555CC394.5080501@twiddle.net> Date: Wed, 20 May 2015 10:25:40 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1432134765-7680-1-git-send-email-yongbok.kim@imgtec.com> <1432134765-7680-4-git-send-email-yongbok.kim@imgtec.com> In-Reply-To: <1432134765-7680-4-git-send-email-yongbok.kim@imgtec.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 3/3] target-mips: Misaligned memory accesses for MSA List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yongbok Kim , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, leon.alrae@imgtec.com, afaerber@suse.de On 05/20/2015 08:12 AM, Yongbok Kim wrote: > +#define MSA_LD_DF(DF, TYPE, LD_INSN, ...) \ > +void helper_msa_ld_ ## TYPE(CPUMIPSState *env, uint32_t wd, uint32_t rs,\ > + int32_t s10) \ > +{ \ > + wr_t *pwd = &(env->active_fpu.fpr[wd].wr); \ > + wr_t wx; \ > + target_ulong addr = env->active_tc.gpr[rs] + (s10 << DF); \ It would be nice to clean this up a bit more. For instance, don't pass the register number and offset. Instead, compute the address properly during translation and pass that down. > + int i; \ > + for (i = 0; i < DF_ELEMENTS(DF); i++) { \ > + wx.TYPE[i] = LD_INSN(env, addr + (i << DF), ##__VA_ARGS__); \ Why the varargs? They're the same all the time. > +MSA_LD_DF(DF_BYTE, b, helper_ret_ldub_mmu, \ > + make_memop_idx(MO_UNALN, cpu_mmu_index(env)), GETRA()) I would prefer it if you'd pass the full and proper TCGMemOp. I.e. MO_TE | MO_{8,16,32,64} | MO_UNALN. And you might as well hoist that out of the load/store loops. r~