From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KtpRv-0001hu-AG for qemu-devel@nongnu.org; Sat, 25 Oct 2008 16:09:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KtpRt-0001hE-R6 for qemu-devel@nongnu.org; Sat, 25 Oct 2008 16:09:27 -0400 Received: from [199.232.76.173] (port=37547 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KtpRt-0001hB-Nu for qemu-devel@nongnu.org; Sat, 25 Oct 2008 16:09:25 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:42334) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KtpRt-0004Xc-9s for qemu-devel@nongnu.org; Sat, 25 Oct 2008 16:09:25 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH] ppc: Convert op_405_check_{sat,satu} to TCG Date: Sat, 25 Oct 2008 21:09:17 +0100 References: <83999635-3F2E-4BB9-B14B-57088A1B1A8D@web.de> In-Reply-To: <83999635-3F2E-4BB9-B14B-57088A1B1A8D@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200810252109.18477.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Andreas =?iso-8859-1?q?F=E4rber?= , =?iso-8859-1?q?Aur=E9lien_Jarno?= On Saturday 25 October 2008, Andreas F=E4rber wrote: > + =A0 =A0 =A0 =A0 =A0 =A0tcg_gen_shri_tl(tmp, tmp, 31); > + =A0 =A0 =A0 =A0 =A0 =A0tcg_gen_brcondi_tl(TCG_COND_EQ, tmp, 0, endLabel= ); Is this really right for ppc64? You can easily test the high bit using TCG_COND_LT. > + =A0 =A0 =A0 =A0 =A0 =A0tcg_gen_shri_tl(tmp, cpu_T[2], 31); > + =A0 =A0 =A0 =A0 =A0 =A0tcg_gen_brcondi_tl(TCG_COND_EQ, tmp, 0, innerLab= el); > + > + =A0 =A0 =A0 =A0 =A0 =A0tcg_gen_movi_tl(cpu_T[0], INT32_MIN); > + =A0 =A0 =A0 =A0 =A0 =A0tcg_gen_br(endLabel); > + > + =A0 =A0 =A0 =A0 =A0 =A0gen_set_label(innerLabel); > + =A0 =A0 =A0 =A0 =A0 =A0tcg_gen_movi_tl(cpu_T[0], INT32_MAX); ((signed)x >> 31) ^ 0x7fffffff) is a much more efficient way of implementing this. Paul