]> git.proxmox.com Git - qemu.git/commitdiff
softfloat: Implement floatx80_is_any_nan() and float128_is_any_nan()
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 6 Jan 2011 18:34:43 +0000 (18:34 +0000)
committerRiku Voipio <riku.voipio@iki.fi>
Fri, 7 Jan 2011 15:35:48 +0000 (17:35 +0200)
Implement versions of float*_is_any_nan() for the floatx80 and
float128 types.

Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
fpu/softfloat.h

index 15052cc4701acaba8273887fa914df3f255aaa1b..a6d0f16b42815aeda4ae06d321e357b56a61d33b 100644 (file)
@@ -489,6 +489,11 @@ INLINE int floatx80_is_zero(floatx80 a)
     return (a.high & 0x7fff) == 0 && a.low == 0;
 }
 
+INLINE int floatx80_is_any_nan(floatx80 a)
+{
+    return ((a.high & 0x7fff) == 0x7fff) && (a.low<<1);
+}
+
 #endif
 
 #ifdef FLOAT128
@@ -556,6 +561,12 @@ INLINE int float128_is_zero(float128 a)
     return (a.high & 0x7fffffffffffffffLL) == 0 && a.low == 0;
 }
 
+INLINE int float128_is_any_nan(float128 a)
+{
+    return ((a.high >> 48) & 0x7fff) == 0x7fff &&
+        ((a.low != 0) || ((a.high & 0xffffffffffffLL) != 0));
+}
+
 #endif
 
 #else /* CONFIG_SOFTFLOAT */