From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQU6B-0005e6-Ba for qemu-devel@nongnu.org; Fri, 22 Jul 2016 02:38:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQU69-0006ki-3P for qemu-devel@nongnu.org; Fri, 22 Jul 2016 02:38:14 -0400 Date: Fri, 22 Jul 2016 16:08:13 +1000 From: David Gibson Message-ID: <20160722060813.GS15941@voom.fritz.box> References: <1468861517-2508-1-git-send-email-nikunj@linux.vnet.ibm.com> <1468861517-2508-14-git-send-email-nikunj@linux.vnet.ibm.com> <20160722050714.GR15941@voom.fritz.box> <877fce9qv9.fsf@abhimanyu.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Er1qpsOqk0l6oMce" Content-Disposition: inline In-Reply-To: <877fce9qv9.fsf@abhimanyu.i-did-not-set--mail-host-address--so-tickle-me> Subject: Re: [Qemu-devel] [RFC v1 13/13] target-ppc: introduce opc4 for Expanded Opcode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikunj A Dadhania Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, aneesh.kumar@linux.vnet.ibm.com, benh@kernel.crashing.org --Er1qpsOqk0l6oMce Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 22, 2016 at 11:05:54AM +0530, Nikunj A Dadhania wrote: > David Gibson writes: >=20 > > [ Unknown signature status ] > > On Mon, Jul 18, 2016 at 10:35:17PM +0530, Nikunj A Dadhania wrote: > >> ISA 3.0 has introduced EO - Expanded Opcode. Introduce third level > >> indirect opcode table and corresponding parsing routines. > >>=20 > >> EO (11:12) Expanded opcode field > >> Formats: XX1 > >>=20 > >> EO (11:15) Expanded opcode field > >> Formats: VX, X, XX2 > >>=20 > >> Signed-off-by: Nikunj A Dadhania > >> --- > >> target-ppc/translate.c | 73 +++++++++++++++++++++++++------ > >> target-ppc/translate_init.c | 103 ++++++++++++++++++++++++++++++++---= --------- > >> 2 files changed, 136 insertions(+), 40 deletions(-) > >>=20 > >> diff --git a/target-ppc/translate.c b/target-ppc/translate.c > >> index 6c5a4a6..733d68d 100644 > >> --- a/target-ppc/translate.c > >> +++ b/target-ppc/translate.c > >> @@ -40,6 +40,7 @@ > >> /* Include definitions for instructions classes and implementations f= lags */ > >> //#define PPC_DEBUG_DISAS > >> //#define DO_PPC_STATISTICS > >> +//#define PPC_DUMP_CPU > >> =20 > >> #ifdef PPC_DEBUG_DISAS > >> # define LOG_DISAS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARG= S__) > >> @@ -367,12 +368,15 @@ GEN_OPCODE2(name, onam, opc1, opc2, opc3, inval,= type, PPC_NONE) > >> #define GEN_HANDLER2_E(name, onam, opc1, opc2, opc3, inval, type, typ= e2) \ > >> GEN_OPCODE2(name, onam, opc1, opc2, opc3, inval, type, type2) > >> =20 > >> +#define GEN_HANDLER_E_2(name, opc1, opc2, opc3, opc4, inval, type, ty= pe2) \ > >> +GEN_OPCODE3(name, opc1, opc2, opc3, opc4, inval, type, type2) > >> + > >> typedef struct opcode_t { > >> - unsigned char opc1, opc2, opc3; > >> + unsigned char opc1, opc2, opc3, opc4; > >> #if HOST_LONG_BITS =3D=3D 64 /* Explicitly align to 64 bits */ > >> - unsigned char pad[5]; > >> + unsigned char pad[4]; > >> #else > >> - unsigned char pad[1]; > >> + unsigned char pad[4]; /* 4-byte pad to maintain pad in opcode tab= le */ > > > > IIUC the point here is to align entries to the wordsize. If the > > worsize is 32-bit you shouldn't need any extra padding here. >=20 > You are right, the reason I had added this here is to keep the code > clean in the GEN_OPCODEx >=20 > #define GEN_OPCODE(name, op1, op2, op3, op4, invl, _typ, _typ2) \ > { \ > .opc1 =3D op1, \ > .opc2 =3D op2, \ > .opc3 =3D op3, \ > .opc4 =3D 0xff, \ > #if HOST_LONG_BITS =3D=3D 64 \ > .pad =3D { 0, }, \ > #endif \ Hrm.. you're using C99 designated initializers, which means I'm pretty sure you can just leave out the pad field, since you don't care about it's value. That should avoid the need for an ifdef. > .handler =3D { \ > .inval1 =3D invl, \ > .type =3D _typ, \ > .type2 =3D _typ2, \ > .handler =3D &gen_##name, \ > .oname =3D stringify(name), \ > }, \ > .oname =3D stringify(name), \ > } >=20 > I am fine with both the approach, but thought of the current one as > cleaner, we would waste 4byte per opcode in 32-bit case. >=20 > Regards > Nikunj >=20 --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --Er1qpsOqk0l6oMce Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXkbhNAAoJEGw4ysog2bOSUA8P+gNi8kO4eqdcMQyeFs3y/aGV af1gqSouIRVW6RA4t4K4cZnvbMULu/BrfOc+u6SaYN6RXxHxWwiHSCU+QPVHH5to xLexl2yr2xV88NBKB5AH/T4dOetaVzh5NyVxWR1WGnJalSqbKFlBAsSFEaBcbiad 9G6fDe+KLabhyiF1IVjLHy2UItQYjh0y+XjWAPBqJfndTocKE4aNX+H/JJ3oaL8c 9dKwICvV45QqwL4iarbWdSXEbE1K0wYst/4WDA94TIEfNraXNg3NLspmthVizmhB QtL0Vtc4n/g4cWf9+jE50mwEbHwed1M34mvUyQMJCKlivbsDUkA1JCt4it4gdmyk HhPwELHuho13pmxX/jtwSK6Z6X/zu7yHVLE5nstFan1ht1rqY3Op6Ad+Qi8IeSi4 Daz+v7lCiZN0KbPGb0KA72RRhmvz/ismgyxLDgU2LNzD/aHm+F4VqjSe+kgwyA4+ qZCruQwLBk9Jj7viEaLr5S1SvnzPyzOSYQ20U0x8Khhipc2y/2ZHcOJV6yR2bmSB pVFA3S5q2qklmBWDjspZWlM443T7GL1x+9M9yXgF5UoFssb1J0lhEUw4+lWzheLl Gmbx6sc0x9GWISkDqPwpL/BPL4W4mRSAmy9wsFucXCW4hGyI9bX2FoOu8kAFdzM7 IJkuW+XUHQUWRHdZDo9f =f1y4 -----END PGP SIGNATURE----- --Er1qpsOqk0l6oMce--