diff options
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/ChangeLog | 5 | ||||
-rw-r--r-- | newlib/libc/include/machine/ieeefp.h | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 8e9df8139..f962a3c8f 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,4 +1,9 @@ 2010-02-11 Craig Howland <howland@LGSInnovations.com> + + * libc/include/machine/ieeefp.h: isfinite macro modified to run faster + by only calling fpclassify once instead of possibly twice. + +2010-02-11 Craig Howland <howland@LGSInnovations.com> * libm/common/s_ilogb.c: Adjust documentation to reflect new returns (see next items) and that ilogb() and ilogbf() are C99/POSIX. diff --git a/newlib/libc/include/machine/ieeefp.h b/newlib/libc/include/machine/ieeefp.h index b3ce76a24..c174c2127 100644 --- a/newlib/libc/include/machine/ieeefp.h +++ b/newlib/libc/include/machine/ieeefp.h @@ -80,10 +80,11 @@ #ifdef __SPU__ #define __IEEE_BIG_ENDIAN -#define isfinite(y) \ - (__extension__ ({__typeof__(y) __y = (y); \ - (sizeof (__y) == sizeof (float)) ? (1) : \ - fpclassify(__y) != FP_INFINITE && fpclassify(__y) != FP_NAN;})) +#define isfinite(__y) \ + (__extension__ ({int __cy; \ + (sizeof (__y) == sizeof (float)) ? (1) : \ + (__cy = fpclassify(__y)) != FP_INFINITE && __cy != FP_NAN;})) + #define isinf(__x) ((sizeof (__x) == sizeof (float)) ? (0) : __isinfd(__x)) #define isnan(__x) ((sizeof (__x) == sizeof (float)) ? (0) : __isnand(__x)) |