Received: from eggs.gnu.org ([2001:4830:134:3::10]:39780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buig5-0007Om-CT for qemu-devel@nongnu.org; Thu, 13 Oct 2016 12:16:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buifz-0003p2-6r for qemu-devel@nongnu.org; Thu, 13 Oct 2016 12:16:16 -0400 Received: from mailapp02.imgtec.com ([217.156.133.132]:42661 helo=mailapp01.imgtec.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buifz-0003oT-0S for qemu-devel@nongnu.org; Thu, 13 Oct 2016 12:16:11 -0400 References: <20161013021727.24944-1-r@hev.cc> From: Yongbok Kim Message-ID: <3555d323-e22e-e5dd-18be-8902e2f2fdd8@imgtec.com> Date: Thu, 13 Oct 2016 17:16:08 +0100 MIME-Version: 1.0 In-Reply-To: <20161013021727.24944-1-r@hev.cc> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] target-mips: Fix Loongson pandn instruction. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Heiher , qemu-devel@nongnu.org Cc: aurelien@aurel32.net, Heiher , Fuxin Zhang On 13/10/2016 03:17, Heiher wrote: > From: Heiher > > pandn FD, FS, FT > Operation: FD = ((NOT FS) AND FT) > > Signed-off-by: Heiher > Signed-off-by: Fuxin Zhang > --- > target-mips/translate.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/target-mips/translate.c b/target-mips/translate.c > index 55c2ca0..ed67180 100644 > --- a/target-mips/translate.c > +++ b/target-mips/translate.c > @@ -3880,6 +3880,8 @@ static void gen_loongson_multimedia(DisasContext *ctx, int rd, int rs, int rt) > case OPC_##UP: gen_helper_##LO(t0, t0); break > #define LMI_DIRECT(UP, LO, OP) \ > case OPC_##UP: tcg_gen_##OP##_i64(t0, t0, t1); break > +#define LMI_DIRECT_SWAP(UP, LO, OP) \ > + case OPC_##UP: tcg_gen_##OP##_i64(t0, t1, t0); break It is used only once. No need to make it as a macro. > > switch (opc) { > LMI_HELPER(PADDSH, paddsh); > @@ -3945,8 +3947,8 @@ static void gen_loongson_multimedia(DisasContext *ctx, int rd, int rs, int rt) > LMI_DIRECT(XOR_CP2, xor, xor); > LMI_DIRECT(NOR_CP2, nor, nor); > LMI_DIRECT(AND_CP2, and, and); > - LMI_DIRECT(PANDN, pandn, andc); > LMI_DIRECT(OR, or, or); > + LMI_DIRECT_SWAP(PANDN, pandn, andc); case OPC_PANDN: tcg_gen_andc_i64(t0, t1, t0); break; Would it be sufficient? > > case OPC_PINSRH_0: > tcg_gen_deposit_i64(t0, t0, t1, 0, 16); > Thanks for the fix. Regards, Yongbok