diff options
author | Calin Juravle <calin@google.com> | 2014-04-17 18:17:32 +0100 |
---|---|---|
committer | Calin Juravle <calin@google.com> | 2014-04-23 19:03:06 +0100 |
commit | 1abc9ff6a5b5f8a9925f1b8d9d333bc5bc7d407f (patch) | |
tree | 3ea8e2f0f7288d7019004b397847228678d29843 /libc/bionic/fpclassify.cpp | |
parent | 4ff967f3301087ea6ccaa17cfb1f04a034448a68 (diff) | |
download | bionic-1abc9ff6a5b5f8a9925f1b8d9d333bc5bc7d407f.zip bionic-1abc9ff6a5b5f8a9925f1b8d9d333bc5bc7d407f.tar.gz bionic-1abc9ff6a5b5f8a9925f1b8d9d333bc5bc7d407f.tar.bz2 |
Clean-up _fpmath and fake_long_doubles
- promoted IEEEld2bits to fpmath since most of the where the same for
diffrent archs
- removed _fpmath
- reinstated weak_references
- moved isfinite and isnormal to libc
- clean up fake_long_doubles
- clean up some useless ifdefs
- added missing nexttoward* tests
Bug: 14134235
Change-Id: I95639c4885653fe47fd7dc0570ee5bb3389bbc6b
Diffstat (limited to 'libc/bionic/fpclassify.cpp')
-rw-r--r-- | libc/bionic/fpclassify.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libc/bionic/fpclassify.cpp b/libc/bionic/fpclassify.cpp index 82e1b03..21ff946 100644 --- a/libc/bionic/fpclassify.cpp +++ b/libc/bionic/fpclassify.cpp @@ -90,6 +90,28 @@ int __isnanf(float f) { } __strong_alias(isnanf, __isnanf); +int __isfinite(double d) { + int type = __fpclassifyd(d); + return ((type != FP_NAN) && (type != FP_INFINITE)); +} +__strong_alias(isfinite, __isfinite); + +int __isfinitef(float f) { + int type = __fpclassifyf(f); + return ((type != FP_NAN) && (type != FP_INFINITE)); +} +__strong_alias(isfinitef, __isfinitef); + +int __isnormal(double d) { + return (__fpclassifyd(d) == FP_NORMAL); +} +__strong_alias(isnormal, __isnormal); + +int __isnormalf(float f) { + return (__fpclassifyf(f) == FP_NORMAL); +} +__strong_alias(isnormalf, __isnormalf); + #if __LP64__ // LP64 uses 128-bit long doubles. @@ -121,6 +143,15 @@ int __isnanl(long double ld) { return (__fpclassifyl(ld) == FP_NAN); } +int __isfinitel(long double ld) { + int type = __fpclassifyl(ld); + return ((type != FP_NAN) && (type != FP_INFINITE)); +} + +int __isnormall(long double ld) { + return (__fpclassifyl(ld) == FP_NORMAL); +} + #else // LP32 uses double as long double. @@ -128,8 +159,12 @@ int __isnanl(long double ld) { __strong_alias(__fpclassifyl, __fpclassify); __strong_alias(__isinfl, __isinf); __strong_alias(__isnanl, __isnan); +__strong_alias(__isfinitel, __isfinite); +__strong_alias(__isnormall, __isnormal); #endif __strong_alias(isinfl, __isinfl); __strong_alias(isnanl, __isnanl); +__strong_alias(isfinitel, __isfinitel); +__strong_alias(isnormall, __isnormall); |