From mboxrd@z Thu Jan 1 00:00:00 1970 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 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) Message-ID: <4D595CB8.4020901@st.com> Date: Mon, 14 Feb 2011 17:47:52 +0100 From: Christophe Lyon MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] softfloat: export float32_nan and float32_infinity. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@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. -- 1.7.2.3