summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2015-05-29 09:26:10 +0000
committerandrew <andrew@FreeBSD.org>2015-05-29 09:26:10 +0000
commit665a8e93e63df1276d15a72d6027f1568fa4f77b (patch)
tree4f6c8d9e80d48d27e49e0e6c0ebe07b5595f47c0 /lib
parentac994cae1dd37f33737245b73c93680c33390f95 (diff)
downloadFreeBSD-src-665a8e93e63df1276d15a72d6027f1568fa4f77b.zip
FreeBSD-src-665a8e93e63df1276d15a72d6027f1568fa4f77b.tar.gz
Fix __fpclassifyl when double == long double. As with r283693 this is
needed on ARM and PowerPC. MFC after: 1 Week
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/fpclassify.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libc/gen/fpclassify.c b/lib/libc/gen/fpclassify.c
index 754a1df..444b551 100644
--- a/lib/libc/gen/fpclassify.c
+++ b/lib/libc/gen/fpclassify.c
@@ -29,6 +29,8 @@
#include <sys/endian.h>
+#include <machine/float.h>
+
#include <math.h>
#include <stdint.h>
@@ -84,10 +86,18 @@ __fpclassifyl(long double e)
return (FP_SUBNORMAL);
}
mask_nbit_l(u); /* Mask normalization bit if applicable. */
+#if LDBL_MANT_DIG == 53
+ if (u.bits.exp == 2047) {
+ if ((u.bits.manl | u.bits.manh) == 0)
+ return (FP_INFINITE);
+ return (FP_NAN);
+ }
+#else
if (u.bits.exp == 32767) {
if ((u.bits.manl | u.bits.manh) == 0)
return (FP_INFINITE);
return (FP_NAN);
}
+#endif
return (FP_NORMAL);
}
OpenPOWER on IntegriCloud