From 665a8e93e63df1276d15a72d6027f1568fa4f77b Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 29 May 2015 09:26:10 +0000 Subject: Fix __fpclassifyl when double == long double. As with r283693 this is needed on ARM and PowerPC. MFC after: 1 Week --- lib/libc/gen/fpclassify.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/libc') 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 +#include + #include #include @@ -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); } -- cgit v1.1