svn commit: r322435 - head/lib/msun/src

Ryan Libby rlibby at FreeBSD.org
Sat Aug 12 18:28:03 UTC 2017


Author: rlibby
Date: Sat Aug 12 18:28:02 2017
New Revision: 322435
URL: https://svnweb.freebsd.org/changeset/base/322435

Log:
  Revert r322418, LDBL_MAX_EXP unsuitable for macro pasting on some arches
  
  Either need a different way to spell HALF_LDBL_MAX, or a different way
  to spell LDBL_MAX_EXP, or a different approach.
  
  Reported by:	ian

Modified:
  head/lib/msun/src/catrigl.c
  head/lib/msun/src/math_private.h
  head/lib/msun/src/s_csqrtl.c

Modified: head/lib/msun/src/catrigl.c
==============================================================================
--- head/lib/msun/src/catrigl.c	Sat Aug 12 18:11:41 2017	(r322434)
+++ head/lib/msun/src/catrigl.c	Sat Aug 12 18:28:02 2017	(r322435)
@@ -307,7 +307,7 @@ clog_for_large_values(long double complex z)
 		ay = t;
 	}
 
-	if (ax >= HALF_LDBL_MAX)
+	if (ax > LDBL_MAX / 2)
 		return (CMPLXL(logl(hypotl(x / m_e, y / m_e)) + 1,
 		    atan2l(y, x)));
 

Modified: head/lib/msun/src/math_private.h
==============================================================================
--- head/lib/msun/src/math_private.h	Sat Aug 12 18:11:41 2017	(r322434)
+++ head/lib/msun/src/math_private.h	Sat Aug 12 18:28:02 2017	(r322435)
@@ -272,15 +272,6 @@ do {								\
 #define	LD80C(m, ex, v)	{ .e = (v), }
 #endif
 
-/*
- * XXX LDBL_MAX is broken on i386.  If the precise value of LDBL_MAX is not
- * needed, this may be worked around by instead referring to a proxy, such
- * as HALF_LDBL_MAX, below.  HALF_LDBL_MAX is approximately LDBL_MAX / 2,
- * actually just greater than.  Note that 2 * HALF_LDBL_MAX will always
- * overflow to infinity, regardless of the precision and rounding modes.
- */
-#define	HALF_LDBL_MAX	__CONCAT(__CONCAT(0x0.8p, LDBL_MAX_EXP), L)
-
 #ifdef FLT_EVAL_METHOD
 /*
  * Attempt to get strict C99 semantics for assignment with non-C99 compilers.

Modified: head/lib/msun/src/s_csqrtl.c
==============================================================================
--- head/lib/msun/src/s_csqrtl.c	Sat Aug 12 18:11:41 2017	(r322434)
+++ head/lib/msun/src/s_csqrtl.c	Sat Aug 12 18:28:02 2017	(r322435)
@@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$");
 #pragma	STDC CX_LIMITED_RANGE	ON
 
 /* We risk spurious overflow for components >= LDBL_MAX / (1 + sqrt(2)). */
-#define	THRESH	(HALF_LDBL_MAX / 1.207106781186547524400844362104849L)
+#define	THRESH	(LDBL_MAX / 2.414213562373095048801688724209698L)
 
 long double complex
 csqrtl(long double complex z)


More information about the svn-src-all mailing list