summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-02-11 17:37:21 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-02-11 17:37:21 +0000
commit5d53cce4c05d1f4f730cce080233dc959f773059 (patch)
tree1946111a30890c20efd571d5f9228c0f1fc55158 /libc
parenteb856014a03f49e132d852d6f1627db64d3abd7a (diff)
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, \