* [Qemu-devel] [6049] softfloat-native: fix *nan()
@ 2008-12-15 17:14 Aurelien Jarno
0 siblings, 0 replies; only message in thread
From: Aurelien Jarno @ 2008-12-15 17:14 UTC (permalink / raw)
To: qemu-devel
Revision: 6049
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6049
Author: aurel32
Date: 2008-12-15 17:14:12 +0000 (Mon, 15 Dec 2008)
Log Message:
-----------
softfloat-native: fix *nan()
Fix float64_is_nan()
Fix floatx80_is_signaling_nan()
Add floatx80_is_nan()
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Modified Paths:
--------------
trunk/fpu/softfloat-native.c
trunk/fpu/softfloat-native.h
Modified: trunk/fpu/softfloat-native.c
===================================================================
--- trunk/fpu/softfloat-native.c 2008-12-15 17:14:05 UTC (rev 6048)
+++ trunk/fpu/softfloat-native.c 2008-12-15 17:14:12 UTC (rev 6049)
@@ -431,7 +431,7 @@
u.f = a1;
a = u.i;
- return ( LIT64( 0xFFE0000000000000 ) < (bits64) ( a<<1 ) );
+ return ( LIT64( 0xFFF0000000000000 ) < (bits64) ( a<<1 ) );
}
@@ -507,7 +507,20 @@
int floatx80_is_signaling_nan( floatx80 a1)
{
floatx80u u;
+ uint64_t aLow;
u.f = a1;
+
+ aLow = u.i.low & ~ LIT64( 0x4000000000000000 );
+ return
+ ( ( u.i.high & 0x7FFF ) == 0x7FFF )
+ && (bits64) ( aLow<<1 )
+ && ( u.i.low == aLow );
+}
+
+int floatx80_is_nan( floatx80 a1 )
+{
+ floatx80u u;
+ u.f = a1;
return ( ( u.i.high & 0x7FFF ) == 0x7FFF ) && (bits64) ( u.i.low<<1 );
}
Modified: trunk/fpu/softfloat-native.h
===================================================================
--- trunk/fpu/softfloat-native.h 2008-12-15 17:14:05 UTC (rev 6048)
+++ trunk/fpu/softfloat-native.h 2008-12-15 17:14:12 UTC (rev 6049)
@@ -425,6 +425,7 @@
int floatx80_compare( floatx80, floatx80 STATUS_PARAM );
int floatx80_compare_quiet( floatx80, floatx80 STATUS_PARAM );
int floatx80_is_signaling_nan( floatx80 );
+int floatx80_is_nan( floatx80 );
INLINE floatx80 floatx80_abs(floatx80 a)
{
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-12-15 17:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-15 17:14 [Qemu-devel] [6049] softfloat-native: fix *nan() Aurelien Jarno
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).