svn commit: r283694 - head/lib/libc/gen
Andrew Turner
andrew at FreeBSD.org
Fri May 29 09:26:11 UTC 2015
Author: andrew
Date: Fri May 29 09:26:10 2015
New Revision: 283694
URL: https://svnweb.freebsd.org/changeset/base/283694
Log:
Fix __fpclassifyl when double == long double. As with r283693 this is
needed on ARM and PowerPC.
MFC after: 1 Week
Modified:
head/lib/libc/gen/fpclassify.c
Modified: head/lib/libc/gen/fpclassify.c
==============================================================================
--- head/lib/libc/gen/fpclassify.c Fri May 29 09:23:20 2015 (r283693)
+++ head/lib/libc/gen/fpclassify.c Fri May 29 09:26:10 2015 (r283694)
@@ -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);
}
More information about the svn-src-head
mailing list