From: Christophe Lyon <christophe.lyon@st.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/4] softfloat: add float32_set_sign(), float32_infinity, float64_half, float64_256 and float64_512.
Date: Fri, 18 Feb 2011 15:49:15 +0100 [thread overview]
Message-ID: <1298040557-6342-3-git-send-email-christophe.lyon@st.com> (raw)
In-Reply-To: <1298040557-6342-1-git-send-email-christophe.lyon@st.com>
These constants and utility function are needed to implement some
helpers. Defining constants avoids the need to re-compute them at
runtime.
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
---
fpu/softfloat.h | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/fpu/softfloat.h b/fpu/softfloat.h
index f34a938..9bd4a50 100644
--- a/fpu/softfloat.h
+++ b/fpu/softfloat.h
@@ -379,9 +379,15 @@ INLINE int float32_is_zero_or_denormal(float32 a)
return (float32_val(a) & 0x7f800000) == 0;
}
+INLINE float32 float32_set_sign(float32 a, int sign)
+{
+ return make_float32((float32_val(a) & 0x7fffffff) | (sign << 31));
+}
+
#define float32_zero make_float32(0)
#define float32_one make_float32(0x3f800000)
#define float32_ln2 make_float32(0x3f317218)
+#define float32_infinity make_float32(0x7f800000)
/*----------------------------------------------------------------------------
@@ -482,6 +488,9 @@ INLINE int float64_is_any_nan(float64 a)
#define float64_zero make_float64(0)
#define float64_one make_float64(0x3ff0000000000000LL)
#define float64_ln2 make_float64(0x3fe62e42fefa39efLL)
+#define float64_half make_float64(0x3fe0000000000000LL)
+#define float64_256 make_float64(0x4070000000000000LL)
+#define float64_512 make_float64(0x4080000000000000LL)
/*----------------------------------------------------------------------------
| The pattern for a default generated double-precision NaN.
--
1.7.2.3
next prev parent reply other threads:[~2011-02-18 14:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-18 14:49 [Qemu-devel] [PATCH v4 0/4] ARM: fix Neon VRECPE and VRSQRTE instructions Christophe Lyon
2011-02-18 14:49 ` [Qemu-devel] [PATCH 1/4] softfloat: move all default NaN definitions to softfloat.h Christophe Lyon
2011-02-20 21:49 ` Aurelien Jarno
2011-02-18 14:49 ` Christophe Lyon [this message]
2011-02-20 21:52 ` [Qemu-devel] [PATCH 2/4] softfloat: add float32_set_sign(), float32_infinity, float64_half, float64_256 and float64_512 Aurelien Jarno
2011-02-20 22:09 ` Peter Maydell
2011-02-20 22:20 ` Aurelien Jarno
2011-02-21 9:59 ` Christophe Lyon
2011-02-18 14:49 ` [Qemu-devel] [PATCH 3/4] target-arm: fix support for VRECPE Christophe Lyon
2011-02-18 14:49 ` [Qemu-devel] [PATCH 4/4] target-arm: fix support for VRSQRTE 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=1298040557-6342-3-git-send-email-christophe.lyon@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).