Received: from eggs.gnu.org ([2001:4830:134:3::10]:35456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzcFI-0008K9-I9 for qemu-devel@nongnu.org; Thu, 27 Oct 2016 00:24:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzcFG-0007Fy-8Q for qemu-devel@nongnu.org; Thu, 27 Oct 2016 00:24:52 -0400 Date: Thu, 27 Oct 2016 13:10:02 +1100 From: David Gibson Message-ID: <20161027021002.GE19918@umbus.fritz.box> References: <1476589070-5792-1-git-send-email-rth@twiddle.net> <1476589070-5792-15-git-send-email-rth@twiddle.net> <20161026025947.GU11052@umbus.fritz.box> <9458bd08-bc49-dfc6-131a-e66093bff251@twiddle.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0H629O+sVkh21xTi" Content-Disposition: inline In-Reply-To: <9458bd08-bc49-dfc6-131a-e66093bff251@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-ppc@nongnu.org, qemu-devel@nongnu.org --0H629O+sVkh21xTi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 26, 2016 at 08:38:06AM -0700, Richard Henderson wrote: > On 10/25/2016 07:59 PM, David Gibson wrote: > > On Sat, Oct 15, 2016 at 08:37:49PM -0700, Richard Henderson wrote: > >> Use the new primitives for RDWINM and RLDICL. > >> > >> Cc: qemu-ppc@nongnu.org > >> Signed-off-by: Richard Henderson > >> --- > >> target-ppc/translate.c | 9 ++++----- > >> 1 file changed, 4 insertions(+), 5 deletions(-) > >> > >> 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) { > >=20 > > 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. > >=20 > > 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. >=20 > It was confusing to me too, which is why I rearranged this in the v2 of t= his > patchset. To which thread you also responded yesterday, so... Ah, sorry. Because I missed it originally, I only had your ping, not the actual v2 series in my inbox. When I went back through my archive to find it, I accidentally picked up v1 instead of v2. >=20 > Anyway, in v2 this looks like >=20 > if (sh !=3D 0 && len > 0 && me =3D=3D (31 - sh)) { > tcg_gen_deposit_z_tl(t_ra, t_rs, sh, len); > } else if (me =3D=3D 31 && rsh + len <=3D 32) { > tcg_gen_extract_tl(t_ra, t_rs, rsh, len); > } else { >=20 > Basically, we're trying to match those combinations of rotate+mask that c= an be > implemented with shifts instead of real rotations. That is, the mask doe= sn't > follow the rotate around the end of the word. Ok, that looks correct, the change frm sh to rsh is the fix, I think. --=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 --0H629O+sVkh21xTi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYEWH6AAoJEGw4ysog2bOSHAwQAIgu9M2mXM5NJvgOk8pqRBRO JobWoeHX+h2UcASPyPrNKfHSWs4O5Dsps9HIeStKILEWp3PMymjbMjSpk3XmD3RT egODxHna6JZxWDOO6eUCg6V9BCIgDB6sN0moUnatlV6TtZfSMkQUgI3lKl6OUyki neK6MXFBn8T9PGi5CrwjimJCsrnqwfA0cj+caYe86U6tKrkxyG8n/AmjxHUAWBgP kAl06/XW0yytZGBH+Tn+BbmKOoQaXi+72GoGMuNBzTcWO7K0RI4zy3ZkN4Hd6och xdvgdOAvEPVu2mKzQ+TSNzyV1rhDZW9iTneQ3jqeR4KQQ/EtCdwIsg2nwkGuWatc 49TvKqLR2vw6enpEJqfKLoZeiJbGJ1T5dYt7SUQsDMGkuLV97EzVi3TLJt9I5N6c xRmhddEofQgvKESl+pui2X1RS1smcFLT6t1vQD9Z1weyWZjm7TzZcJfiEPgd/8ss CSDd6FnBS8EPzn3lL68QW2tfug5gHmwqiygJIfhuOPcj1X0Z+IH7haEOcSiCgdbj 52W8GO9Sd2VNMxFOqnWP5ZiFS4/mY6V+SD2+0iRgFy6HTgeVTaMr/Dnxp/qMlIkG 0ZNzKK7pdQ2kMpWYCRZCOELlZ81jZ2XpjjUjGfMp9YGxKsBEYa1gdC8X1KbrK2sC eaeT/NsoxstdNTMXf0nY =EmQ8 -----END PGP SIGNATURE----- --0H629O+sVkh21xTi--