From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeKmH-000558-Ba for qemu-devel@nongnu.org; Tue, 22 Sep 2015 06:26:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeKmD-0004vd-Cn for qemu-devel@nongnu.org; Tue, 22 Sep 2015 06:26:25 -0400 References: <1442178225-26780-1-git-send-email-aurelien@aurel32.net> <1442178225-26780-3-git-send-email-aurelien@aurel32.net> From: Thomas Huth Message-ID: <56012CC8.8070801@redhat.com> Date: Tue, 22 Sep 2015 12:26:16 +0200 MIME-Version: 1.0 In-Reply-To: <1442178225-26780-3-git-send-email-aurelien@aurel32.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] target-ppc: fix xscmpodp and xscmpudp decoding List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno , qemu-devel@nongnu.org Cc: Tom Musta , David Gibson , qemu-ppc@nongnu.org, Alexander Graf , qemu-stable@nongnu.org On 13/09/15 23:03, Aurelien Jarno wrote: > The xscmpodp and xscmpudp instructions only have the AX, BX bits in > there encoding, the lowest bit (usually TX) is marked as an invalid > bit. We therefore can't decode them with GEN_XX2FORM, which decodes > the two lowest bit. > > Introduce a new form GEN_XX2FORM, which decodes AX and BX and mark > the lowest bit as invalid. > > Cc: Tom Musta > Cc: Alexander Graf > Cc: qemu-stable@nongnu.org > Signed-off-by: Aurelien Jarno > --- > target-ppc/translate.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/target-ppc/translate.c b/target-ppc/translate.c > index 84c5cea..c0eed13 100644 > --- a/target-ppc/translate.c > +++ b/target-ppc/translate.c > @@ -10670,6 +10670,13 @@ GEN_HANDLER2_E(name, #name, 0x3C, opc2 | 1, opc3, 0, PPC_NONE, fl2), \ > GEN_HANDLER2_E(name, #name, 0x3C, opc2 | 2, opc3, 0, PPC_NONE, fl2), \ > GEN_HANDLER2_E(name, #name, 0x3C, opc2 | 3, opc3, 0, PPC_NONE, fl2) > > +#undef GEN_XX2IFORM > +#define GEN_XX2IFORM(name, opc2, opc3, fl2) \ > +GEN_HANDLER2_E(name, #name, 0x3C, opc2 | 0, opc3, 1, PPC_NONE, fl2), \ > +GEN_HANDLER2_E(name, #name, 0x3C, opc2 | 1, opc3, 1, PPC_NONE, fl2), \ > +GEN_HANDLER2_E(name, #name, 0x3C, opc2 | 2, opc3, 1, PPC_NONE, fl2), \ > +GEN_HANDLER2_E(name, #name, 0x3C, opc2 | 3, opc3, 1, PPC_NONE, fl2) > + > #undef GEN_XX3_RC_FORM > #define GEN_XX3_RC_FORM(name, opc2, opc3, fl2) \ > GEN_HANDLER2_E(name, #name, 0x3C, opc2 | 0x00, opc3 | 0x00, 0, PPC_NONE, fl2), \ > @@ -10731,8 +10738,8 @@ GEN_XX3FORM(xsnmaddadp, 0x04, 0x14, PPC2_VSX), > GEN_XX3FORM(xsnmaddmdp, 0x04, 0x15, PPC2_VSX), > GEN_XX3FORM(xsnmsubadp, 0x04, 0x16, PPC2_VSX), > GEN_XX3FORM(xsnmsubmdp, 0x04, 0x17, PPC2_VSX), > -GEN_XX2FORM(xscmpodp, 0x0C, 0x05, PPC2_VSX), > -GEN_XX2FORM(xscmpudp, 0x0C, 0x04, PPC2_VSX), > +GEN_XX2IFORM(xscmpodp, 0x0C, 0x05, PPC2_VSX), > +GEN_XX2IFORM(xscmpudp, 0x0C, 0x04, PPC2_VSX), According to PowerISA 2.07, xscmpodp and xscmpudp are of type XX3, not of type XX2 ... so should this macro maybe rather be named XX3IFORM instead? Thomas