Commit c94655b0b53fdc40bb0917612daaeb96f2de3c23
1 parent
5c8cdbf8
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
Showing
1 changed file
with
23 additions
and
0 deletions
fpu/softfloat-native.h
... | ... | @@ -33,6 +33,29 @@ |
33 | 33 | #define isunordered(x,y) unordered(x, y) |
34 | 34 | #endif |
35 | 35 | |
36 | +#if defined(__sun__) && !defined(NEED_LIBSUNMATH) | |
37 | + | |
38 | +#ifndef isnan | |
39 | +# define isnan(x) \ | |
40 | + (sizeof (x) == sizeof (long double) ? isnan_ld (x) \ | |
41 | + : sizeof (x) == sizeof (double) ? isnan_d (x) \ | |
42 | + : isnan_f (x)) | |
43 | +static inline int isnan_f (float x) { return x != x; } | |
44 | +static inline int isnan_d (double x) { return x != x; } | |
45 | +static inline int isnan_ld (long double x) { return x != x; } | |
46 | +#endif | |
47 | + | |
48 | +#ifndef isinf | |
49 | +# define isinf(x) \ | |
50 | + (sizeof (x) == sizeof (long double) ? isinf_ld (x) \ | |
51 | + : sizeof (x) == sizeof (double) ? isinf_d (x) \ | |
52 | + : isinf_f (x)) | |
53 | +static inline int isinf_f (float x) { return isnan (x - x); } | |
54 | +static inline int isinf_d (double x) { return isnan (x - x); } | |
55 | +static inline int isinf_ld (long double x) { return isnan (x - x); } | |
56 | +#endif | |
57 | +#endif | |
58 | + | |
36 | 59 | typedef float float32; |
37 | 60 | typedef double float64; |
38 | 61 | #ifdef FLOATX80 | ... | ... |