diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2011-01-06 18:34:43 +0000 |
---|---|---|
committer | Riku Voipio <riku.voipio@iki.fi> | 2011-01-07 17:35:48 +0200 |
commit | 2bed652fc596dee09f27dd7ab20528cf5eaf9203 (patch) | |
tree | a86728ad4abbf27f35b5be18ebd3794105efc5fa | |
parent | 285da2b9a83353703d07e141fdb447e82944146c (diff) | |
download | qemu-2bed652fc596dee09f27dd7ab20528cf5eaf9203.zip qemu-2bed652fc596dee09f27dd7ab20528cf5eaf9203.tar.gz qemu-2bed652fc596dee09f27dd7ab20528cf5eaf9203.tar.bz2 |
softfloat: Implement floatx80_is_any_nan() and float128_is_any_nan()
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>
-rw-r--r-- | fpu/softfloat.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fpu/softfloat.h b/fpu/softfloat.h index 15052cc..a6d0f16 100644 --- a/fpu/softfloat.h +++ b/fpu/softfloat.h @@ -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 */ |