Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2010-02-12 00:03:51 +0300
committerJeff Johnston <jjohnstn@redhat.com>2010-02-12 00:03:51 +0300
commit45c8c6469a00491b9f908d0d24a1affe88e0f0e3 (patch)
tree32a5b0b8e45843aca3409aba03bb47579a1f220d
parent451a8eb09ae2bb2484ffc76da5854ea9983dd643 (diff)
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.
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/include/machine/ieeefp.h9
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))