From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tfzo8-0005Bl-7s for qemu-devel@nongnu.org; Tue, 04 Dec 2012 16:13:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tfzo7-0007XO-7R for qemu-devel@nongnu.org; Tue, 04 Dec 2012 16:13:36 -0500 Received: from cantor2.suse.de ([195.135.220.15]:42136 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tfzo7-0007XI-0k for qemu-devel@nongnu.org; Tue, 04 Dec 2012 16:13:35 -0500 Message-ID: <50BE6778.8090404@suse.de> Date: Tue, 04 Dec 2012 22:13:28 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1354632583-22403-1-git-send-email-petar.jovanovic@rt-rk.com>, <874D219413C17C42B1D2E0432B92BE5CBBE2890C@exchdb03.mips.com> In-Reply-To: <874D219413C17C42B1D2E0432B92BE5CBBE2890C@exchdb03.mips.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] target-mips: Fix incorrect shift for SHILO and SHILOV List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Jovanovic, Petar" Cc: Blue Swirl , "qemu-devel@nongnu.org" , "aurelien@aurel32.net" Am 04.12.2012 20:48, schrieb Jovanovic, Petar: >> diff --git a/target-mips/dsp_helper.c b/target-mips/dsp_helper.c >> index e7949c2..f8a7a9f 100644 >> --- a/target-mips/dsp_helper.c >> +++ b/target-mips/dsp_helper.c >> @@ -3814,17 +3814,17 @@ void helper_shilo(target_ulong ac, target_ulon= g rs, CPUMIPSState *env) >> >> rs5_0 =3D rs & 0x3F; >> rs5_0 =3D (int8_t)(rs5_0 << 2) >> 2; >> - rs5_0 =3D MIPSDSP_ABS(rs5_0); >> + >> + if (rs5_0 =3D=3D 0) >> + return; >=20 >> The check should be moved to translation time so that the call to this >> helper is not generated at all. >=20 > This case is not likely so generation of unnecessary call is unlikely t= oo. > Let me know what you think. FWIW you could use our unlikely() macro then to aid branch prediction. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg