diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-04-17 21:57:02 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-04-17 21:57:02 +0000 |
commit | c94655b0b53fdc40bb0917612daaeb96f2de3c23 (patch) | |
tree | 617ed08b2d068a72c349cd23eea095fe1eda0a22 /fpu | |
parent | 5c8cdbf833511c1d078642d08bc3248130d7c76f (diff) | |
download | qemu-c94655b0b53fdc40bb0917612daaeb96f2de3c23.zip qemu-c94655b0b53fdc40bb0917612daaeb96f2de3c23.tar.gz qemu-c94655b0b53fdc40bb0917612daaeb96f2de3c23.tar.bz2 |
Updated Solaris isinf support, by Juergen Keil and Ben Taylor.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2696 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'fpu')
-rw-r--r-- | fpu/softfloat-native.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/fpu/softfloat-native.h b/fpu/softfloat-native.h index 8a0d1ad..49cff5d 100644 --- a/fpu/softfloat-native.h +++ b/fpu/softfloat-native.h @@ -33,6 +33,29 @@ #define isunordered(x,y) unordered(x, y) #endif +#if defined(__sun__) && !defined(NEED_LIBSUNMATH) + +#ifndef isnan +# define isnan(x) \ + (sizeof (x) == sizeof (long double) ? isnan_ld (x) \ + : sizeof (x) == sizeof (double) ? isnan_d (x) \ + : isnan_f (x)) +static inline int isnan_f (float x) { return x != x; } +static inline int isnan_d (double x) { return x != x; } +static inline int isnan_ld (long double x) { return x != x; } +#endif + +#ifndef isinf +# define isinf(x) \ + (sizeof (x) == sizeof (long double) ? isinf_ld (x) \ + : sizeof (x) == sizeof (double) ? isinf_d (x) \ + : isinf_f (x)) +static inline int isinf_f (float x) { return isnan (x - x); } +static inline int isinf_d (double x) { return isnan (x - x); } +static inline int isinf_ld (long double x) { return isnan (x - x); } +#endif +#endif + typedef float float32; typedef double float64; #ifdef FLOATX80 |