From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkfBZ-0005t5-31 for qemu-devel@nongnu.org; Fri, 09 Oct 2015 17:26:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkfBM-0002VN-3F for qemu-devel@nongnu.org; Fri, 09 Oct 2015 17:26:41 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:26678 helo=imgpgp01.kl.imgtec.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkfBK-0002OI-TW for qemu-devel@nongnu.org; Fri, 09 Oct 2015 17:26:27 -0400 Date: Fri, 9 Oct 2015 22:26:22 +0100 From: James Hogan Message-ID: <20151009212622.GN29862@jhogan-linux.le.imgtec.org> References: <1443788657-14537-1-git-send-email-james.hogan@imgtec.com> <1443788657-14537-7-git-send-email-james.hogan@imgtec.com> <20151008163132.GA7436@aurel32.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5xr6Gr0irOxp3+3c" Content-Disposition: inline In-Reply-To: <20151008163132.GA7436@aurel32.net> Subject: Re: [Qemu-devel] [PATCH v3 6/6] tcg/mips: Support r6 SEL{NE, EQ}Z instead of MOVN/MOVZ List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Leon Alrae , Richard Henderson --5xr6Gr0irOxp3+3c Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 08, 2015 at 06:31:32PM +0200, Aurelien Jarno wrote: > On 2015-10-02 13:24, James Hogan wrote: > > Extend MIPS movcond implementation to support the SELNEZ/SELEQZ > > instructions introduced in MIPS r6 (where MOVN/MOVZ have been removed). > >=20 > > Whereas the "MOVN/MOVZ rd, rs, rt" instructions have the following > > semantics: > > rd =3D [!]rt ? rs : rd > >=20 > > The "SELNEZ/SELEQZ rd, rs, rt" instructions are slightly different: > > rd =3D [!]rt ? rs : 0 > >=20 > > First we ensure that if one of the movcond input values is zero that it > > comes last (we can swap the input arguments if we invert the condition). > > This is so that it can exactly match one of the SELNEZ/SELEQZ > > instructions and avoid the need to emit the other one. > >=20 > > Otherwise we emit the opposite instruction first into a temporary > > register, and OR that into the result: > > SELNEZ/SELEQZ TMP1, v2, c1 > > SELEQZ/SELNEZ ret, v1, c1 > > OR ret, ret, TMP1 > >=20 > > Which does the following: > > ret =3D cond ? v1 : v2 > >=20 > > Signed-off-by: James Hogan > > Cc: Richard Henderson > > Cc: Aurelien Jarno > > --- > > Changes in v3: > > - Switch to using bool eqz to indicate whether to use SELEQZ / MOVZ > > instead of SELNEZ / MOVN (Richard). > > - Add tcg_debug_assert(v2 =3D=3D ret) for pre-r6 case with comment to r= emind > > reader that it should be guaranteed via constraints (Richard). > >=20 > > Changes in v2: > > - Combine with patch 6 from v1, and drop functional changes to movcond > > implementation pre-r6. We now provide different constraints for > > movcond depending on presence of r6. (thanks Richard for feedback). > > --- > > tcg/mips/tcg-target.c | 43 +++++++++++++++++++++++++++++++++++++------ > > 1 file changed, 37 insertions(+), 6 deletions(-) >=20 > Reviewed-by: Aurelien Jarno Thanks for the reviews Aurelien! Cheers James --5xr6Gr0irOxp3+3c Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWGDD+AAoJEGwLaZPeOHZ6hqcQAL57n5qlWJ+blIhXQ3LQBvo6 p+KGWEFBeKG/lapF5GDf8yNX7nF8MU9T3r/NR3AmKgbp0T27bWCF/EsAFpPNjeKB 5Z+pYQy5egN5RX9L2NScIktugF18pGR2sD/NwetuciO5LVFAj374Krr2biNJ5rTU cywZlldqt/zqAFUkUxBLw3XEaYAT3QpQPp2wONJC9fuc84H3hXydGUEG34Nfjdng jbHQZ3Uau7ygPVz8YUET6W4aUndjOD+ADKTbBTwi4rOXpTwjef+OuW7puCPNLW/7 oMQMraykV97tAEKkfC1as5pCmcvpM8G/uO2/hqAL+EowU6jJMAQWpxE8/GeB7T2Y f5lW16T/59ZAZKxWcHDFxsKkwpfr3TtMb7ZpET/p3pS3YUOyR/1La77fFmJ4JLAu RWaTLA8ceA4c7MiUD7tTZj9Ljwqq3GyhI+fc+7VPOM13ebGKXKOs+cvmlEdocsKR prIxGKAT45sLPgoRb6cqRdBVPPKCnDAPHvpmr7N3esVBvUg4thIpyO8gfAlhQOJc 7LE6Hle0HB65JD+Pab+YhYo9RPLHL6/U4smFrEDi0/HlGUqr78uMhUpOe4Wcgsxv nrxeEnmjuqNrbSEgDktXQPWMutQ/ozPxeCctDfk62ji4lWghDELTYXbmw2/hg0J1 td5Ifn5eKd4i4siKcJak =XlWk -----END PGP SIGNATURE----- --5xr6Gr0irOxp3+3c--