All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe Lyon <christophe.lyon@st.com>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] softfloat: export float32_nan and float32_infinity.
Date: Mon, 14 Feb 2011 17:47:52 +0100	[thread overview]
Message-ID: <4D595CB8.4020901@st.com> (raw)


These two special values are needed to implement some helper functions, which return these values in some cases.

Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
---
 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

             reply	other threads:[~2011-02-14 16:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-14 16:47 Christophe Lyon [this message]
2011-02-16 11:53 ` [Qemu-devel] [PATCH] softfloat: export float32_nan and float32_infinity Peter Maydell
2011-02-16 13:02   ` Christophe Lyon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D595CB8.4020901@st.com \
    --to=christophe.lyon@st.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.