summaryrefslogtreecommitdiffstats
path: root/fpu/softfloat-native.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin2011-05-05 15:39:47 +0200
committerMichael S. Tsirkin2011-05-05 15:39:47 +0200
commit5300f1a5487f67f0bde8ee1081b799108668cb1d (patch)
tree5274ff496f2665487736a4eec23bf76601e4da44 /fpu/softfloat-native.c
parentCPUPhysMemoryClient: Pass guest physical address not region offset (diff)
parentNBD: Avoid leaking a couple of strings when the NBD device is closed (diff)
downloadqemu-5300f1a5487f67f0bde8ee1081b799108668cb1d.tar.gz
qemu-5300f1a5487f67f0bde8ee1081b799108668cb1d.tar.xz
qemu-5300f1a5487f67f0bde8ee1081b799108668cb1d.zip
Merge remote branch 'origin/master' into pci
Conflicts: exec.c
Diffstat (limited to 'fpu/softfloat-native.c')
-rw-r--r--fpu/softfloat-native.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/fpu/softfloat-native.c b/fpu/softfloat-native.c
index 50355a4c3f..88486511ee 100644
--- a/fpu/softfloat-native.c
+++ b/fpu/softfloat-native.c
@@ -263,6 +263,15 @@ int float32_is_quiet_nan( float32 a1 )
return ( 0xFF800000 < ( a<<1 ) );
}
+int float32_is_any_nan( float32 a1 )
+{
+ float32u u;
+ uint32_t a;
+ u.f = a1;
+ a = u.i;
+ return (a & ~(1 << 31)) > 0x7f800000U;
+}
+
/*----------------------------------------------------------------------------
| Software IEC/IEEE double-precision conversion routines.
*----------------------------------------------------------------------------*/
@@ -422,6 +431,16 @@ int float64_is_quiet_nan( float64 a1 )
}
+int float64_is_any_nan( float64 a1 )
+{
+ float64u u;
+ uint64_t a;
+ u.f = a1;
+ a = u.i;
+
+ return (a & ~(1ULL << 63)) > LIT64 (0x7FF0000000000000 );
+}
+
#ifdef FLOATX80
/*----------------------------------------------------------------------------
@@ -511,4 +530,11 @@ int floatx80_is_quiet_nan( floatx80 a1 )
return ( ( u.i.high & 0x7FFF ) == 0x7FFF ) && (uint64_t) ( u.i.low<<1 );
}
+int floatx80_is_any_nan( floatx80 a1 )
+{
+ floatx80u u;
+ u.f = a1;
+ return ((u.i.high & 0x7FFF) == 0x7FFF) && ( u.i.low<<1 );
+}
+
#endif