From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [6059] softfloat-native: improve correctness of floatXX_is_neg()
Date: Mon, 15 Dec 2008 22:07:50 +0000 [thread overview]
Message-ID: <E1LCLbS-0007Kd-NX@cvs.savannah.gnu.org> (raw)
Revision: 6059
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6059
Author: aurel32
Date: 2008-12-15 22:07:50 +0000 (Mon, 15 Dec 2008)
Log Message:
-----------
softfloat-native: improve correctness of floatXX_is_neg()
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Modified Paths:
--------------
trunk/fpu/softfloat-native.h
Modified: trunk/fpu/softfloat-native.h
===================================================================
--- trunk/fpu/softfloat-native.h 2008-12-15 21:48:27 UTC (rev 6058)
+++ trunk/fpu/softfloat-native.h 2008-12-15 22:07:50 UTC (rev 6059)
@@ -265,7 +265,9 @@
INLINE float32 float32_is_neg(float32 a)
{
- return a < 0.0;
+ float32u u;
+ u.f = a;
+ return u.i >> 31;
}
INLINE float32 float32_is_zero(float32 a)
@@ -372,7 +374,9 @@
INLINE float64 float64_is_neg(float64 a)
{
- return a < 0.0;
+ float64u u;
+ u.f = a;
+ return u.i >> 63;
}
INLINE float64 float64_is_zero(float64 a)
@@ -474,7 +478,9 @@
INLINE floatx80 floatx80_is_neg(floatx80 a)
{
- return a < 0.0;
+ floatx80u u;
+ u.f = a;
+ return u.i.high >> 15;
}
INLINE floatx80 floatx80_is_zero(floatx80 a)
reply other threads:[~2008-12-15 22:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=E1LCLbS-0007Kd-NX@cvs.savannah.gnu.org \
--to=aurelien@aurel32.net \
--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).