Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JP5lC-0003Lh-Se for qemu-devel@nongnu.org; Tue, 12 Feb 2008 19:46:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JP5lC-0003Kh-1l for qemu-devel@nongnu.org; Tue, 12 Feb 2008 19:46:02 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JP5lB-0003KI-Tg for qemu-devel@nongnu.org; Tue, 12 Feb 2008 19:46:01 -0500 Received: from hall.aurel32.net ([88.191.38.19]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JP5lA-0001RN-BH for qemu-devel@nongnu.org; Tue, 12 Feb 2008 19:46:01 -0500 Date: Wed, 13 Feb 2008 01:45:55 +0100 From: Aurelien Jarno Message-ID: <20080213004555.GB22344@hall.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Sender: "aurel32,,," Subject: [Qemu-devel] [PATCH 2/3] [PPC] Math functions helper for CONFIG_SOFTFLOAT=yes 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: Jocelyn Mayer The patch below adds isfinite() and isnormal() functions which can work with float64 type, used when CONFIG_SOFTFLOAT=yes. Signed-off-by: Aurelien Jarno --- target-ppc/op_helper.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 7136e51..544d906 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -492,6 +492,27 @@ static always_inline int isinfinity (float64 d) (u.ll & 0x000FFFFFFFFFFFFFULL) == 0; } +#ifdef CONFIG_SOFTFLOAT +static always_inline int isfinite (float64 d) +{ + CPU_DoubleU u; + + u.d = d; + + return (((u.ll >> 52) & 0x7FF) != 0x7FF); +} + +static always_inline int isnormal (float64 d) +{ + CPU_DoubleU u; + + u.d = d; + + uint32_t exp = (u.ll >> 52) & 0x7FF; + return ((0 < exp) && (exp < 0x7FF)); +} +#endif + void do_compute_fprf (int set_fprf) { int isneg; -- 1.5.3.8 -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net