From patchwork Mon Feb 14 16:47:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 83137 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9018FB71AA for ; Tue, 15 Feb 2011 03:50:48 +1100 (EST) Received: from localhost ([127.0.0.1]:59756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pp1dM-0001kJ-2X for incoming@patchwork.ozlabs.org; Mon, 14 Feb 2011 11:50:44 -0500 Received: from [140.186.70.92] (port=37860 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pp1af-0000V1-I8 for qemu-devel@nongnu.org; Mon, 14 Feb 2011 11:47:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pp1ae-00036N-49 for qemu-devel@nongnu.org; Mon, 14 Feb 2011 11:47:57 -0500 Received: from eu1sys200aog117.obsmtp.com ([207.126.144.143]:49441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pp1ad-00035u-MD for qemu-devel@nongnu.org; Mon, 14 Feb 2011 11:47:56 -0500 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob117.postini.com ([207.126.147.11]) with SMTP ID DSNKTVlcurL5piYwjo0O02hxqo6MJ5ZMyNmJ@postini.com; Mon, 14 Feb 2011 16:47:55 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CDCA0196 for ; Mon, 14 Feb 2011 16:47:53 +0000 (GMT) Received: from Webmail-eu.st.com (safex1hubcas6.st.com [10.75.90.73]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id ABE442C63 for ; Mon, 14 Feb 2011 16:47:53 +0000 (GMT) Received: from [164.129.122.40] (164.129.122.40) by webmail-eu.st.com (10.75.90.13) with Microsoft SMTP Server (TLS) id 8.2.234.1; Mon, 14 Feb 2011 17:47:53 +0100 Message-ID: <4D595CB8.4020901@st.com> Date: Mon, 14 Feb 2011 17:47:52 +0100 From: Christophe Lyon User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: "qemu-devel@nongnu.org" X-Enigmail-Version: 1.1.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 207.126.144.143 Subject: [Qemu-devel] [PATCH] softfloat: export float32_nan and float32_infinity. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org These two special values are needed to implement some helper functions, which return these values in some cases. Signed-off-by: Christophe Lyon --- fpu/softfloat-specialize.h | 9 +++++++++ fpu/softfloat.h | 2 ++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/fpu/softfloat-specialize.h b/fpu/softfloat-specialize.h index 2d025bf..d5d8c63 100644 --- a/fpu/softfloat-specialize.h +++ b/fpu/softfloat-specialize.h @@ -201,6 +201,15 @@ int float32_is_signaling_nan( float32 a_ ) } /*---------------------------------------------------------------------------- +| Returns the default NaN. +*----------------------------------------------------------------------------*/ + +float32 float32_nan(void) +{ + return float32_default_nan; +} + +/*---------------------------------------------------------------------------- | Returns a quiet NaN if the single-precision floating point value `a' is a | signaling NaN; otherwise returns `a'. *----------------------------------------------------------------------------*/ diff --git a/fpu/softfloat.h b/fpu/softfloat.h index e57ee1e..610f245 100644 --- a/fpu/softfloat.h +++ b/fpu/softfloat.h @@ -319,6 +319,7 @@ int float32_compare_quiet( float32, float32 STATUS_PARAM ); int float32_is_quiet_nan( float32 ); int float32_is_signaling_nan( float32 ); float32 float32_maybe_silence_nan( float32 ); +float32 float32_nan(void); float32 float32_scalbn( float32, int STATUS_PARAM ); INLINE float32 float32_abs(float32 a) @@ -365,6 +366,7 @@ INLINE int float32_is_zero_or_denormal(float32 a) #define float32_zero make_float32(0) #define float32_one make_float32(0x3f800000) #define float32_ln2 make_float32(0x3f317218) +#define float32_infinity make_float32(0x7f800000) /*---------------------------------------------------------------------------- | Software IEC/IEEE double-precision conversion routines.