summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-02-11 17:37:41 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-02-11 17:37:41 +0000
commit4f8b47a11d499b3d4c9a6ce9694a5422514756ad (patch)
treefcd24a3863ebe869a711b6f05e69ad54d3db8b04 /libc
parentef09af9911279d787bee842f4834138c33c98b52 (diff)
downloaduClibc-alpine-4f8b47a11d499b3d4c9a6ce9694a5422514756ad.tar.bz2
uClibc-alpine-4f8b47a11d499b3d4c9a6ce9694a5422514756ad.tar.xz
docs/probe_math_exception.c:
update example libc/sysdeps/linux/i386/bits/mathinline.h: improve __finite() macro, add __finitef macro (why they aren't always macros? why aren't they arch independent?) libm/math_private.h: much better comments on math_opt_barrier() and math_force_eval() libm/s_finite[f].c: improve out-of-line __finite[f]() too (one byte less, yay...)
Diffstat (limited to 'libc')
-rw-r--r--libc/sysdeps/linux/i386/bits/mathinline.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/libc/sysdeps/linux/i386/bits/mathinline.h b/libc/sysdeps/linux/i386/bits/mathinline.h
index ca7277d76..5caf73353 100644
--- a/libc/sysdeps/linux/i386/bits/mathinline.h
+++ b/libc/sysdeps/linux/i386/bits/mathinline.h
@@ -713,11 +713,22 @@ __inline_mathcodeNP2 (drem, __x, __y, \
__MATH_INLINE int
__NTH (__finite (double __x))
{
- return (__extension__
- (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1]
- | 0x800fffffu) + 1) >> 31));
+ union { double __d; int __i[2]; } u;
+ u.__d = __x;
+ /* Finite numbers have at least one zero bit in exponent. */
+ /* All other numbers will result in 0xffffffff after OR: */
+ return (u.__i[1] | 0x800fffff) != 0xffffffff;
}
+__MATH_INLINE int
+__NTH (__finitef (float __x))
+{
+ union { float __d; int __i; } u;
+ u.__d = __x;
+ return (u.__i | 0x807fffff) != 0xffffffff;
+}
+
+
/* Miscellaneous functions */
# ifdef __FAST_MATH__
__inline_mathcode (__coshm1, __x, \