Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 May 2015 09:26:11 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r283694 - head/lib/libc/gen
Message-ID:  <201505290926.t4T9QBVE030151@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505290926.t4T9QBVE030151>