From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOxyN-0006Ct-NO for qemu-devel@nongnu.org; Sun, 17 Jul 2016 22:07:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bOxyJ-0004cD-Bz for qemu-devel@nongnu.org; Sun, 17 Jul 2016 22:07:55 -0400 Date: Mon, 18 Jul 2016 11:55:56 +1000 From: David Gibson Message-ID: <20160718015556.GI16769@voom.fritz.box> References: <1468346602-20700-1-git-send-email-nikunj@linux.vnet.ibm.com> <1468346602-20700-4-git-send-email-nikunj@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xQR6quUbZ63TTuTU" Content-Disposition: inline In-Reply-To: <1468346602-20700-4-git-send-email-nikunj@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [RFC 3/6] target-ppc: adding addpcis instruction 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 --xQR6quUbZ63TTuTU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 12, 2016 at 11:33:19PM +0530, Nikunj A Dadhania wrote: > ISA 3.0 instruction for adding immediate value with next instruction > address and return the result in the target register. >=20 > Signed-off-by: Nikunj A Dadhania Reviewed-by: David Gibson > --- > target-ppc/translate.c | 27 +++++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) >=20 > diff --git a/target-ppc/translate.c b/target-ppc/translate.c > index 92030b6..93c7c66 100644 > --- a/target-ppc/translate.c > +++ b/target-ppc/translate.c > @@ -432,6 +432,20 @@ static inline uint32_t name(uint32_t opcode) = \ > return (((opcode >> (shift1)) & ((1 << (nb1)) - 1)) << nb2) | = \ > ((opcode >> (shift2)) & ((1 << (nb2)) - 1)); = \ > } > + > +#define EXTRACT_HELPER_DXFORM(name, = \ > + d0_bits, shift_op_d0, shift_d0, = \ > + d1_bits, shift_op_d1, shift_d1, = \ > + d2_bits, shift_op_d2, shift_d2) = \ > +static inline int16_t name(uint32_t opcode) = \ > +{ = \ > + return = \ > + (((opcode >> (shift_op_d0)) & ((1 << (d0_bits)) - 1)) << (shift_= d0)) | \ > + (((opcode >> (shift_op_d1)) & ((1 << (d1_bits)) - 1)) << (shift_= d1)) | \ > + (((opcode >> (shift_op_d2)) & ((1 << (d2_bits)) - 1)) << (shift_= d2)); \ > +} > + > + > /* Opcode part 1 */ > EXTRACT_HELPER(opc1, 26, 6); > /* Opcode part 2 */ > @@ -501,6 +515,9 @@ EXTRACT_HELPER(FPL, 25, 1); > EXTRACT_HELPER(FPFLM, 17, 8); > EXTRACT_HELPER(FPW, 16, 1); > =20 > +/* addpcis */ > +EXTRACT_HELPER_DXFORM(DX, 10, 6, 6, 5, 16, 1, 1, 0, 0) > + > /*** Jump target decoding = ***/ > /* Immediate address */ > static inline target_ulong LI(uint32_t opcode) > @@ -984,6 +1001,15 @@ static void gen_addis(DisasContext *ctx) > } > } > =20 > +/* addpcis */ > +static void gen_addpcis(DisasContext *ctx) > +{ > + target_long d =3D DX(ctx->opcode); > + > + tcg_gen_movi_tl(cpu_gpr[rD(ctx->opcode)], ctx->nip); > + tcg_gen_addi_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rD(ctx->opcode)], = d); > +} > + > static inline void gen_op_arith_divw(DisasContext *ctx, TCGv ret, TCGv a= rg1, > TCGv arg2, int sign, int compute_ov) > { > @@ -9877,6 +9903,7 @@ GEN_HANDLER(addi, 0x0E, 0xFF, 0xFF, 0x00000000, PPC= _INTEGER), > GEN_HANDLER(addic, 0x0C, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), > GEN_HANDLER2(addic_, "addic.", 0x0D, 0xFF, 0xFF, 0x00000000, PPC_INTEGER= ), > GEN_HANDLER(addis, 0x0F, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), > +GEN_HANDLER_E(addpcis, 0x13, 0x2, 0xFF, 0x00000000, PPC_NONE, PPC2_ISA30= 0), > GEN_HANDLER(mulhw, 0x1F, 0x0B, 0x02, 0x00000400, PPC_INTEGER), > GEN_HANDLER(mulhwu, 0x1F, 0x0B, 0x00, 0x00000400, PPC_INTEGER), > GEN_HANDLER(mullw, 0x1F, 0x0B, 0x07, 0x00000000, PPC_INTEGER), --=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 --xQR6quUbZ63TTuTU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXjDcsAAoJEGw4ysog2bOSXI8QALNAdNiL/hexrJE38H/QnPhI X82b4vEpu7VZP0VzE/Z9oyNtK4ly01vuYc4DEn63rVucrHM+92kgw5S4KiqyqfZ1 HpM3EYpsJQw/vzpm/GNnGBhhIAcweb/u4xmz2F7/aX58GEdCWMiuL3ylqAyHJW8F hTMccnyhbp66tu9W5tVZD3sOxjPmdCL3wj2bhFFLI1bVypGpPJKfoWEdcgz/BxXF K4cgdVB06LK95sMt2qWwzCrS+CeMCJsKNse9uyll0haI+bt5BjnHcS/1Par8ec21 8UkIRVUE0Yg975WMTHIXBanWOSvqh9/OrlbJtjJCueT2sZdzi3Nc3B2zk0bILSIc lzZ3HpOGzugCvmNbfTy2TkMS+l8vGNWmRdi/k7oQplst8Jz78UPRE4HTFYdHqlTe aSD07qcWsTRNEIjgaw8ai8ckttf5TM9/EW0cXI5s6aqTe7Pg8JwXdPDIG9rMX+aE tZu88DRwRfEKj6iMesZEedZoXLEvaaFSSuVkBDYNz7p+553IfGFqOcmpCj7LB+jP /MrSVoPK4A/cTRZtwNCfMQrTi1//bO4af5/ranbwth+7Rc+bNTPXglaGxfZLLFEa K0y+Bc/8I4zwQxmdTBHv2UscXrhF+BPjpl+rq5befAU9tfY1ZQuYLll1o3R4HUjG RSGWyyQcVAOkRAF3exWZ =0Dp7 -----END PGP SIGNATURE----- --xQR6quUbZ63TTuTU--