From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzERm-0008QJ-5L for qemu-devel@nongnu.org; Tue, 25 Oct 2016 23:00:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzERj-0004Lt-4B for qemu-devel@nongnu.org; Tue, 25 Oct 2016 23:00:10 -0400 Date: Wed, 26 Oct 2016 13:59:47 +1100 From: David Gibson Message-ID: <20161026025947.GU11052@umbus.fritz.box> References: <1476589070-5792-1-git-send-email-rth@twiddle.net> <1476589070-5792-15-git-send-email-rth@twiddle.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5fM1MC9alg+yIaL4" Content-Disposition: inline In-Reply-To: <1476589070-5792-15-git-send-email-rth@twiddle.net> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 14/15] target-ppc: Use tcg_gen_extract_* List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org --5fM1MC9alg+yIaL4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 15, 2016 at 08:37:49PM -0700, Richard Henderson wrote: > Use the new primitives for RDWINM and RLDICL. >=20 > Cc: qemu-ppc@nongnu.org > Signed-off-by: Richard Henderson > --- > target-ppc/translate.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) >=20 > diff --git a/target-ppc/translate.c b/target-ppc/translate.c > index bfc1301..724d95c 100644 > --- a/target-ppc/translate.c > +++ b/target-ppc/translate.c > @@ -1977,9 +1977,8 @@ static void gen_rlwinm(DisasContext *ctx) > if (mb =3D=3D 0 && me =3D=3D (31 - sh)) { > tcg_gen_shli_tl(t_ra, t_rs, sh); > tcg_gen_ext32u_tl(t_ra, t_ra); > - } else if (sh !=3D 0 && me =3D=3D 31 && sh =3D=3D (32 - mb)) { > - tcg_gen_ext32u_tl(t_ra, t_rs); > - tcg_gen_shri_tl(t_ra, t_ra, mb); > + } else if (me =3D=3D 31 && (me - mb + 1) + sh <=3D 32) { I'm having trouble figuring out what the second part of this condition is supposed to be checking for, and it seems like it's too restrictive. For example, everything except the LSB of a word would be: rlwnim rT,rA,31,1,31 which would fail the test, but it should be fine to implement that with an extract op. > + tcg_gen_extract_tl(t_ra, t_rs, sh, me - mb + 1); > } else { > target_ulong mask; > #if defined(TARGET_PPC64) > @@ -2094,8 +2093,8 @@ static void gen_rldinm(DisasContext *ctx, int mb, i= nt me, int sh) > =20 > if (sh !=3D 0 && mb =3D=3D 0 && me =3D=3D (63 - sh)) { > tcg_gen_shli_tl(t_ra, t_rs, sh); > - } else if (sh !=3D 0 && me =3D=3D 63 && sh =3D=3D (64 - mb)) { > - tcg_gen_shri_tl(t_ra, t_rs, mb); > + } else if (me =3D=3D 63 && (me - mb + 1) + sh <=3D 64) { > + tcg_gen_extract_tl(t_ra, t_rs, sh, me - mb + 1); > } else { > tcg_gen_rotli_tl(t_ra, t_rs, sh); > tcg_gen_andi_tl(t_ra, t_ra, MASK(mb, me)); --=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 --5fM1MC9alg+yIaL4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYEBwhAAoJEGw4ysog2bOSDEAP/iO/TtUVvnCLEXa2DhdPDusb VEQOrBCHUum2Uv6+1mD8mfwxe7aslQYqWfu031A46Dsc5rj3a+8R16PZPtLiDilA zWo6Bq0JgXF8w9tO7qh2Wa705zxZiB5SruEAP1EgaGcnS2OE2MYmaNMDbo8g8R4f IKXy2t2LdX4WTNNhktcQwW+suUY+fRWeC5bs28GziWPxyh5SPm8DJx/XpXsoyN7k iV+B4mZbOiMD1bw3x906/C2yw6UF9mLbgZvYdvDrxqNy2NRilrbhhVWKDHr0fHiR WN9oy3bHA7hp7dR5QS4TV7vr69WD9wEs9UhnUD44jwu8wk+bDbIrPLWhKnzgWir4 YpjTEUYBEYtr72iUGw1D3emklapSMSjw7W69U14nshdBGCiY3EwHZHTx/MZtpN8x DUlDMx2Zjc5rnCUrIDar/SPe8Fp6dOd/kc+xn35MnB5Nhex3rVwdUCeeAf/8xNCo /JKM0/tpu2d0QwKY/8JImY+lvMG5X/2BX9FYKAH82SGa1GxpAH1gnZMe4dP5SwN6 0bCaYAR6je5b5EXlHvkB2HnB4xun+kPwQ38sBNEp+H1pT4NGCHTGwiH4kPTEm74m 68g3Cd1vmcP5zgHhCSnLnJhjVeT6J00syBRGW+3FH5rh7yIf/y8q8z4EULZly937 oXQQ3/qAJuYSvkfkZsRO =Tsrz -----END PGP SIGNATURE----- --5fM1MC9alg+yIaL4--