This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.25-323-gcdd4552


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  cdd45522b6e87369afc341402bda7a95bdf83380 (commit)
       via  81f26b53b5e9a3520fb3cfd0be743339e13dfb56 (commit)
       via  33d523d7f8c8ffdeecd03df452d80bfda3bc25d4 (commit)
       via  fcee5905d341fe975f7786e72c831ada1c8fa78b (commit)
      from  e1d6e08dd6f9298ed7f61ef12c17ca83cb761f37 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=cdd45522b6e87369afc341402bda7a95bdf83380

commit cdd45522b6e87369afc341402bda7a95bdf83380
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Wed Feb 1 17:54:25 2017 -0200

    float128: Enable use of IEEE wrapper templates
    
    The templates for the IEEE functions wrappers implement wrappers that
    do not rely on _LIB_VERSION / matherr / __kernel_standard
    functionality to set errno and fix the return value of the functions.
    The wrappers are ready to be used by all floating-point types, however
    they will first be used by float128, since the old wrappers for float,
    double, and long double need to be first deprecated and versioned.
    
    This commits defines __USE_WRAPPER_TEMPLATE to 1 for float128 files,
    so that the new wrapper templates are used for this type.
    
    	* sysdeps/generic/math-type-macros-float128.h
    	(__USE_WRAPPER_TEMPLATE): Define to 1 to enable use of the
    	wrapper templates.

diff --git a/ChangeLog b/ChangeLog
index d228205..04e88e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-05-14  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+	* sysdeps/generic/math-type-macros-float128.h
+	(__USE_WRAPPER_TEMPLATE): Define to 1 to enable use of the
+	wrapper templates.
+
 2017-05-14  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
 	    Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
 
diff --git a/sysdeps/generic/math-type-macros-float128.h b/sysdeps/generic/math-type-macros-float128.h
index dcb8560..5d734db 100644
--- a/sysdeps/generic/math-type-macros-float128.h
+++ b/sysdeps/generic/math-type-macros-float128.h
@@ -36,4 +36,7 @@
 /* Supply the generic macros.  */
 #include <math-type-macros.h>
 
+/* Use the type-generic wrapper templates.  */
+#define __USE_WRAPPER_TEMPLATE 1
+
 #endif

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=81f26b53b5e9a3520fb3cfd0be743339e13dfb56

commit 81f26b53b5e9a3520fb3cfd0be743339e13dfb56
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Thu May 4 17:00:33 2017 -0300

    float128: Add private _Float128 declarations for libm.
    
    Add the necessary bits to the private headers to support
    building the _Float128 libm functions.
    
    A local override for float.h is provided to include the
    missing *FLT128 macros implied by TS 18661-3 for this
    type when compiling prior to GCC 7.
    
    	* include/complex.h (__kernel_casinhf128): New declaration.
    	* include/float.h: New file.
    	* include/math.h (__finitef128): Add a hidden def.
    	(__isinff128): Likewise.
    	(__isnanf128): Likewise.
    	(__fpclassify): Likewise.
    	(__issignalling): Likewise.
    	(__expf128): Likewise.
    	(__expm1f128): Likewise.
    
    	* sysdeps/generic/fix-fp-int-convert-overflow.h:
    	(FIX_FLT128_LONG_CONVERT_OVERFLOW): New macro.
    	(FIX_FLT128_LLONG_CONVERT_OVERFLOW): Likewise.
    
    	* sysdeps/generic/math-type-macros-float128.h: New file.
    
    	* sysdeps/generic/math_private.h: Include bits/floatn.h and
    	math_private_calls.h for _Float128.
    	(__isinff128): New inline implementation used when GCC < 7.0,
    	since in this case __builtin_isinf_sign is broken.
    	(fabsf128): New inline implementation that calls the builtin.
    	(__EXPR_FLT128): New macro.
    	(min_of_type): Optionally include _Float128 types too.
    
    	* sysdeps/generic/math_private_calls.h (__kernel_sincos):
    	Declare for _Float128.
    	(__kernel_rem_pio2): Likewise.
    
    	* sysdeps/ieee754/ldbl-opt/s_sin.c:
    	(__DECL_SIMD_sincos_disablef128): New macro.

diff --git a/ChangeLog b/ChangeLog
index 75ccb4b..d228205 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+2017-05-14  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
+	    Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+	* include/complex.h (__kernel_casinhf128): New declaration.
+	* include/float.h: New file.
+	* include/math.h (__finitef128): Add a hidden def.
+	(__isinff128): Likewise.
+	(__isnanf128): Likewise.
+	(__fpclassify): Likewise.
+	(__issignalling): Likewise.
+	(__expf128): Likewise.
+	(__expm1f128): Likewise.
+
+	* sysdeps/generic/fix-fp-int-convert-overflow.h:
+	(FIX_FLT128_LONG_CONVERT_OVERFLOW): New macro.
+	(FIX_FLT128_LLONG_CONVERT_OVERFLOW): Likewise.
+
+	* sysdeps/generic/math-type-macros-float128.h: New file.
+
+	* sysdeps/generic/math_private.h: Include bits/floatn.h and
+	math_private_calls.h for _Float128.
+	(__isinff128): New inline implementation used when GCC < 7.0,
+	since in this case __builtin_isinf_sign is broken.
+	(fabsf128): New inline implementation that calls the builtin.
+	(__EXPR_FLT128): New macro.
+	(min_of_type): Optionally include _Float128 types too.
+
+	* sysdeps/generic/math_private_calls.h (__kernel_sincos):
+	Declare for _Float128.
+	(__kernel_rem_pio2): Likewise.
+
+	* sysdeps/ieee754/ldbl-opt/s_sin.c:
+	(__DECL_SIMD_sincos_disablef128): New macro.
+
 2017-05-14  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
 
 	* math/math.h: Include bits/math-finite.h for float128.
diff --git a/include/complex.h b/include/complex.h
index 082e71f..2c86709 100644
--- a/include/complex.h
+++ b/include/complex.h
@@ -8,6 +8,9 @@
 extern complex float __kernel_casinhf (complex float z, int adj);
 extern complex double __kernel_casinh (complex double z, int adj);
 extern complex long double __kernel_casinhl (complex long double z, int adj);
+#  if __HAVE_DISTINCT_FLOAT128
+extern __CFLOAT128 __kernel_casinhf128 (__CFLOAT128 z, int adj);
+#  endif
 # endif
 
 #endif
diff --git a/include/float.h b/include/float.h
new file mode 100644
index 0000000..20c4acb
--- /dev/null
+++ b/include/float.h
@@ -0,0 +1,31 @@
+#ifndef _LIBC_FLOAT_H
+#define _LIBC_FLOAT_H
+
+#ifndef _ISOMAC
+# define __STDC_WANT_IEC_60559_TYPES_EXT__
+#endif
+
+#include_next <float.h>
+
+/* Supplement float.h macros for _Float128 for older compilers
+   which do not yet support the type.  These are described in
+   TS 18661-3.  */
+#ifndef _ISOMAC
+# include <features.h>
+# include <bits/floatn.h>
+# if !__GNUC_PREREQ (7, 0) && __HAVE_DISTINCT_FLOAT128
+#  define FLT128_MANT_DIG	113
+#  define FLT128_DECIMAL_DIG	36
+#  define FLT128_DIG		33
+#  define FLT128_MIN_EXP	(-16381)
+#  define FLT128_MIN_10_EXP	(-4931)
+#  define FLT128_MAX_EXP	16384
+#  define FLT128_MAX_10_EXP	4932
+#  define FLT128_MAX		1.18973149535723176508575932662800702e+4932Q
+#  define FLT128_EPSILON	1.92592994438723585305597794258492732e-34Q
+#  define FLT128_MIN		3.36210314311209350626267781732175260e-4932Q
+#  define FLT128_TRUE_MIN	6.47517511943802511092443895822764655e-4966Q
+# endif
+#endif
+
+#endif /* _LIBC_FLOAT_H */
diff --git a/include/math.h b/include/math.h
index 6ff6783..a069680 100644
--- a/include/math.h
+++ b/include/math.h
@@ -26,6 +26,12 @@ hidden_proto (__finitel)
 hidden_proto (__isinfl)
 hidden_proto (__isnanl)
 #  endif
+
+#  if __HAVE_DISTINCT_FLOAT128
+hidden_proto (__finitef128)
+hidden_proto (__isinff128)
+hidden_proto (__isnanf128)
+#  endif
 # endif
 
 libm_hidden_proto (__fpclassify)
@@ -43,5 +49,12 @@ libm_hidden_proto (__expl)
 libm_hidden_proto (__expm1l)
 # endif
 
+# if __HAVE_DISTINCT_FLOAT128
+libm_hidden_proto (__fpclassifyf128)
+libm_hidden_proto (__issignalingf128)
+libm_hidden_proto (__expf128)
+libm_hidden_proto (__expm1f128)
+# endif
+
 #endif
 #endif
diff --git a/sysdeps/generic/fix-fp-int-convert-overflow.h b/sysdeps/generic/fix-fp-int-convert-overflow.h
index f53eaf0..4b0cd91 100644
--- a/sysdeps/generic/fix-fp-int-convert-overflow.h
+++ b/sysdeps/generic/fix-fp-int-convert-overflow.h
@@ -29,5 +29,7 @@
 #define FIX_DBL_LLONG_CONVERT_OVERFLOW 0
 #define FIX_LDBL_LONG_CONVERT_OVERFLOW 0
 #define FIX_LDBL_LLONG_CONVERT_OVERFLOW 0
+#define FIX_FLT128_LONG_CONVERT_OVERFLOW 0
+#define FIX_FLT128_LLONG_CONVERT_OVERFLOW 0
 
 #endif /* fix-fp-int-convert-overflow.h */
diff --git a/sysdeps/generic/fix-fp-int-convert-overflow.h b/sysdeps/generic/math-type-macros-float128.h
similarity index 50%
copy from sysdeps/generic/fix-fp-int-convert-overflow.h
copy to sysdeps/generic/math-type-macros-float128.h
index f53eaf0..dcb8560 100644
--- a/sysdeps/generic/fix-fp-int-convert-overflow.h
+++ b/sysdeps/generic/math-type-macros-float128.h
@@ -1,5 +1,5 @@
-/* Fix for conversion of floating point to integer overflow.  Generic version.
-   Copyright (C) 2015-2017 Free Software Foundation, Inc.
+/* Helper macros for _Float128 variants of type generic functions of libm.
+   Copyright (C) 2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,18 +16,24 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef FIX_FP_INT_CONVERT_OVERFLOW_H
-#define FIX_FP_INT_CONVERT_OVERFLOW_H	1
-
-/* Define these macros to 1 to workaround conversions of out-of-range
-   floating-point numbers to integer types failing to raise the
-   "invalid" exception, or raising spurious "inexact" or other
-   exceptions.  */
-#define FIX_FLT_LONG_CONVERT_OVERFLOW 0
-#define FIX_FLT_LLONG_CONVERT_OVERFLOW 0
-#define FIX_DBL_LONG_CONVERT_OVERFLOW 0
-#define FIX_DBL_LLONG_CONVERT_OVERFLOW 0
-#define FIX_LDBL_LONG_CONVERT_OVERFLOW 0
-#define FIX_LDBL_LLONG_CONVERT_OVERFLOW 0
-
-#endif /* fix-fp-int-convert-overflow.h */
+#ifndef _MATH_TYPE_MACROS_FLOAT128
+#define _MATH_TYPE_MACROS_FLOAT128
+
+#include <math.h>
+#include <complex.h>
+
+#define M_LIT(c) __f128 (c)
+#define M_PFX FLT128
+#define M_SUF(c) c ## f128
+#define FLOAT _Float128
+#define M_STRTO_NAN __strtof128_nan
+
+#define CFLOAT __CFLOAT128
+
+#define M_MLIT(c) c ## f128
+
+
+/* Supply the generic macros.  */
+#include <math-type-macros.h>
+
+#endif
diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index 4d8a35f..6ea5e25 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -23,6 +23,9 @@
 #include <float.h>
 #include <get-rounding-mode.h>
 
+/* Gather machine dependent _Floatn support.  */
+#include <bits/floatn.h>
+
 /* The original fdlibm code used statements like:
 	n0 = ((*(int*)&one)>>29)^1;		* index of high word *
 	ix0 = *(n0+(int*)&x);			* high word of x *
@@ -211,6 +214,41 @@ do {								\
 #undef _MSUF_
 #undef _Mdouble_
 
+#if __HAVE_DISTINCT_FLOAT128
+# define _Mdouble_ _Float128
+# define _MSUF_ f128
+# define __MATH_DECLARING_FLOATN
+# include <math_private_calls.h>
+# undef __MATH_DECLARING_FLOATN
+# undef _MSUF_
+# undef _Mdouble_
+#endif
+
+#if __HAVE_DISTINCT_FLOAT128
+
+/* __builtin_isinf_sign is broken in GCC < 7 for float128.  */
+# if ! __GNUC_PREREQ (7, 0)
+#  include <ieee754_float128.h>
+extern inline int
+__isinff128 (_Float128 x)
+{
+  int64_t hx, lx;
+  GET_FLOAT128_WORDS64 (hx, lx, x);
+  lx |= (hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL;
+  lx |= -lx;
+  return ~(lx >> 63) & (hx >> 62);
+}
+# endif
+
+extern inline _Float128
+fabsf128 (_Float128 x)
+{
+  return __builtin_fabsf128 (x);
+}
+#endif
+
+
+
 /* fdlibm kernel function */
 extern double __kernel_standard (double,double,int);
 extern float __kernel_standard_f (float,float,int);
@@ -263,13 +301,24 @@ extern void __docos (double __x, double __dx, double __v[]);
    })
 #endif
 
+#if __HAVE_DISTINCT_FLOAT128
+# define __EXPR_FLT128(x, yes, no)				\
+  __builtin_choose_expr (__builtin_types_compatible_p		\
+			 (__typeof (x), long double), no, yes)
+#else
+# define __EXPR_FLT128(x, yes, no) no
+#endif
+
+
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
+
 #define min_of_type(type) __builtin_choose_expr		\
   (__builtin_types_compatible_p (type, float),		\
    FLT_MIN,						\
    __builtin_choose_expr				\
    (__builtin_types_compatible_p (type, double),	\
-    DBL_MIN, LDBL_MIN))
+    DBL_MIN,						\
+    __EXPR_FLT128 (x, FLT128_MIN, LDBL_MIN)))
 
 /* If X (which is not a NaN) is subnormal, force an underflow
    exception.  */
diff --git a/sysdeps/generic/math_private_calls.h b/sysdeps/generic/math_private_calls.h
index 8c1d304..34bbd5e 100644
--- a/sysdeps/generic/math_private_calls.h
+++ b/sysdeps/generic/math_private_calls.h
@@ -64,12 +64,12 @@ extern _Mdouble_ __MSUF (__kernel_sin) (_Mdouble_, _Mdouble_, int);
 extern _Mdouble_ __MSUF (__kernel_cos) (_Mdouble_, _Mdouble_);
 extern _Mdouble_ __MSUF (__kernel_tan) (_Mdouble_, _Mdouble_, int);
 
-#if defined __MATH_DECLARING_LONG_DOUBLE
+#if defined __MATH_DECLARING_LONG_DOUBLE || defined __MATH_DECLARING_FLOATN
 extern void __MSUF (__kernel_sincos) (_Mdouble_, _Mdouble_,
 				      _Mdouble_ *, _Mdouble_ *, int);
 #endif
 
-#if !defined __MATH_DECLARING_LONG_DOUBLE
+#if !defined __MATH_DECLARING_LONG_DOUBLE || defined __MATH_DECLARING_FLOATN
 extern int __MSUF (__kernel_rem_pio2) (_Mdouble_ *, _Mdouble_ *, int,
 				       int, int, const int32_t *);
 #endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_sin.c b/sysdeps/ieee754/ldbl-opt/s_sin.c
index 04e60e2..6932ccc 100644
--- a/sysdeps/ieee754/ldbl-opt/s_sin.c
+++ b/sysdeps/ieee754/ldbl-opt/s_sin.c
@@ -4,6 +4,7 @@
 #define __DECL_SIMD_sincos_disable
 #define __DECL_SIMD_sincos_disablef
 #define __DECL_SIMD_sincos_disablel
+#define __DECL_SIMD_sincos_disablef128
 #include <math_ldbl_opt.h>
 #undef NAN
 #undef sincos

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=33d523d7f8c8ffdeecd03df452d80bfda3bc25d4

commit 33d523d7f8c8ffdeecd03df452d80bfda3bc25d4
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Mon Mar 20 10:07:35 2017 -0300

    float128: Include math-finite.h for _Float128
    
    All the declarations in math-finite.h are macroized by floating-point
    type.  This patch includes it for float128 and protects the
    declarations of functions that need not be declared for float128.
    
    	* math/math.h: Include bits/math-finite.h for float128.
    	(__MATH_DECLARING_FLOATN): Define to control declaration of
    	float128 functions.
    	* math/bits/math-finite.h (pow10): Do not declare for float128.
    	(gamma): Likewise.
    	(scalb): Likewise.

diff --git a/ChangeLog b/ChangeLog
index 2235241..75ccb4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-05-14  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+	* math/math.h: Include bits/math-finite.h for float128.
+	(__MATH_DECLARING_FLOATN): Define to control declaration of
+	float128 functions.
+	* math/bits/math-finite.h (pow10): Do not declare for float128.
+	(gamma): Likewise.
+	(scalb): Likewise.
+
 2017-05-14  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
 	    Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
 
diff --git a/math/bits/math-finite.h b/math/bits/math-finite.h
index 29f2f2e..b07ce31 100644
--- a/math/bits/math-finite.h
+++ b/math/bits/math-finite.h
@@ -83,7 +83,9 @@ __MATH_REDIRCALL (exp, , (_Mdouble_));
 __MATH_REDIRCALL (exp10, , (_Mdouble_));
 
 /* pow10.  */
+# if !__MATH_DECLARING_FLOATN
 __MATH_REDIRCALL_2 (pow10, , (_Mdouble_), exp10);
+# endif
 #endif
 
 #ifdef __USE_ISOC99
@@ -146,7 +148,7 @@ __NTH (__REDIRFROM (lgamma, , _MSUF_) (_Mdouble_ __d))
 #endif
 
 #if ((defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)) \
-     && defined __extern_always_inline)
+     && defined __extern_always_inline) && !__MATH_DECLARING_FLOATN
 /* gamma.  */
 __extern_always_inline _Mdouble_
 __NTH (__REDIRFROM (gamma, , _MSUF_) (_Mdouble_ __d))
@@ -174,10 +176,11 @@ __MATH_REDIRCALL (pow, , (_Mdouble_, _Mdouble_));
 __MATH_REDIRCALL (remainder, , (_Mdouble_, _Mdouble_));
 #endif
 
-#if (__MATH_DECLARING_DOUBLE \
-     && (defined __USE_MISC \
-	 || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8))) \
-    || (!defined __MATH_DECLARE_LDOUBLE && defined __USE_MISC)
+#if ((__MATH_DECLARING_DOUBLE \
+      && (defined __USE_MISC \
+	  || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8))) \
+     || (!defined __MATH_DECLARE_LDOUBLE && defined __USE_MISC)) \
+    && !__MATH_DECLARING_FLOATN
 /* scalb.  */
 __MATH_REDIRCALL (scalb, , (_Mdouble_, _Mdouble_));
 #endif
diff --git a/math/math.h b/math/math.h
index daf58ab..3b0bcad 100644
--- a/math/math.h
+++ b/math/math.h
@@ -626,11 +626,13 @@ extern int matherr (struct exception *__exc);
 # define _Mdouble_ double
 # define __MATH_DECLARING_DOUBLE 1
 # define __MATH_DECLARING_LDOUBLE 0
+# define __MATH_DECLARING_FLOATN 0
 # define _MSUF_
 # include <bits/math-finite.h>
 # undef _Mdouble_
 # undef __MATH_DECLARING_DOUBLE
 # undef __MATH_DECLARING_LDOUBLE
+# undef __MATH_DECLARING_FLOATN
 # undef _MSUF_
 
 /* When __USE_ISOC99 is defined, include math-finite for float and
@@ -641,11 +643,13 @@ extern int matherr (struct exception *__exc);
 #  define _Mdouble_ float
 #  define __MATH_DECLARING_DOUBLE 0
 #  define __MATH_DECLARING_LDOUBLE 0
+#  define __MATH_DECLARING_FLOATN 0
 #  define _MSUF_ f
 #  include <bits/math-finite.h>
 #  undef _Mdouble_
 #  undef __MATH_DECLARING_DOUBLE
 #  undef __MATH_DECLARING_LDOUBLE
+#  undef __MATH_DECLARING_FLOATN
 #  undef _MSUF_
 
 /* Include bits/math-finite.h for long double.  */
@@ -653,15 +657,33 @@ extern int matherr (struct exception *__exc);
 #   define _Mdouble_ long double
 #   define __MATH_DECLARING_DOUBLE 0
 #   define __MATH_DECLARING_LDOUBLE 1
+#   define __MATH_DECLARING_FLOATN 0
 #   define _MSUF_ l
 #   include <bits/math-finite.h>
 #   undef _Mdouble_
 #   undef __MATH_DECLARING_DOUBLE
 #   undef __MATH_DECLARING_LDOUBLE
+#   undef __MATH_DECLARING_FLOATN
 #   undef _MSUF_
 #  endif
 
 # endif /* __USE_ISOC99.  */
+
+/* Include bits/math-finite.h for float128.  */
+# if (__HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC)) \
+      && __GLIBC_USE (IEC_60559_TYPES_EXT)
+#  define _Mdouble_ _Float128
+#  define __MATH_DECLARING_DOUBLE 0
+#  define __MATH_DECLARING_LDOUBLE 0
+#  define __MATH_DECLARING_FLOATN 1
+#  define _MSUF_ f128
+#  include <bits/math-finite.h>
+#  undef _Mdouble_
+#  undef __MATH_DECLARING_DOUBLE
+#  undef __MATH_DECLARING_LDOUBLE
+#  undef __MATH_DECLARING_FLOATN
+#  undef _MSUF_
+# endif
 #endif /* __FINITE_MATH_ONLY__ > 0.  */
 
 #ifdef __USE_ISOC99

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=fcee5905d341fe975f7786e72c831ada1c8fa78b

commit fcee5905d341fe975f7786e72c831ada1c8fa78b
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Wed Jul 20 11:53:36 2016 -0500

    float128: Add public _Float128 declarations to libm.
    
    This introduces the machine-dependent bits/floatn.h to control
    the inclusion of _Float128 ABI.
    
    	* bits/floatn.h: New file.
    	* bits/huge_val_flt128.h: Likewise.
    
    	* bits/libm-simd-decl-stubs.h (__DECL_SIMD_cosf128): New macro.
    	(__DECL_SIMD_sinf128): Likewise.
    	(__DECL_SIMD_sincosf128): Likewise.
    	(__DECL_SIMD_logf128): Likewise.
    	(__DECL_SIMD_expf128): Likewise.
    	(__DECL_SIMD_powf128): Likewise.
    
    	* math/Makefile (headers): Install bits/floatn.h and
    	bits/huge_val_flt128.h.
    
    	* math/bits/cmathcalls.h (_Mdouble_complex_): Only define if not
    	defined.
    
    	* math/bits/mathcalls.h (pow10, isinf, finite, drem, significand)
    	(isnan, gamma, nexttoward, scalb): Only define if not
    	__MATH_DECLARING_FLOATN.
    	(nextdown, nextup, llogb, roundeven, fromfp, ufromfp, fromfpx)
    	(ufromfpx, fmaxmag, fminmag, totalorder, totalordermag)
    	(canonicalize, getpayload, setpayload, setpayloadsig): Declare for
    	_FloatN even if	__STDC_WANT_IEC_60559_BFP_EXT__ is not defined.
    
    	* math/complex.h: Include bits/libc-header-start.h and bits/floatn.h.
    	Include bits/cmathcalls.h to get the declarations of _Float128
    	versions of complex functions.
    	[__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (CMPLXF128):
    	Define macro.
    
    	* math/math.h: Include bits/floatn.h and bits/huge_val_flt128.h.
    	Include bits/mathcalls-helper-functions.h and bits/mathcalls.h to
    	get the declarations of _Float128 versions of math functions.
    	(__MATH_DECLARING_FLOATN): New macro to control declaration of
    	_FloatN types.
    	[__GNUC_PREREQ (6,0)] (signbit): Since GCC 6.0, __builtin_signbit
    	is type-generic, so use it without __MATH_TG.
    	[__HAVE_DISTINCT_FLOAT128] (isinf): This builtin is broken for
    	_Float128 type on GCC < 7.0.  Explicitly call __isinff128 for
    	_Float128 type and GCC < 7.0, otherwise use the builtin.
    	[__HAVE_FLOAT128 && defined __USE_GNU] (M_Ef128, M_LOG2Ef128)
    	(M_LOG10Ef128, M_LN2f128, M_LN10f128, M_PIf128, M_PI_2f128)
    	(M_PI_4f128, M_1_PIf128, M_2_PIf128, M_SQRT2f128, M_SQRT1_2f128):
    	New _GNU_SOURCE enabled macros.

diff --git a/ChangeLog b/ChangeLog
index ece37e9..2235241 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,51 @@
+2017-05-14  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
+	    Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+	* bits/floatn.h: New file.
+	* bits/huge_val_flt128.h: Likewise.
+
+	* bits/libm-simd-decl-stubs.h (__DECL_SIMD_cosf128): New macro.
+	(__DECL_SIMD_sinf128): Likewise.
+	(__DECL_SIMD_sincosf128): Likewise.
+	(__DECL_SIMD_logf128): Likewise.
+	(__DECL_SIMD_expf128): Likewise.
+	(__DECL_SIMD_powf128): Likewise.
+
+	* math/Makefile (headers): Install bits/floatn.h and
+	bits/huge_val_flt128.h.
+
+	* math/bits/cmathcalls.h (_Mdouble_complex_): Only define if not
+	defined.
+
+	* math/bits/mathcalls.h (pow10, isinf, finite, drem, significand)
+	(isnan, gamma, nexttoward, scalb): Only define if not
+	__MATH_DECLARING_FLOATN.
+	(nextdown, nextup, llogb, roundeven, fromfp, ufromfp, fromfpx)
+	(ufromfpx, fmaxmag, fminmag, totalorder, totalordermag)
+	(canonicalize, getpayload, setpayload, setpayloadsig): Declare for
+	_FloatN even if	__STDC_WANT_IEC_60559_BFP_EXT__ is not defined.
+
+	* math/complex.h: Include bits/libc-header-start.h and bits/floatn.h.
+	Include bits/cmathcalls.h to get the declarations of _Float128
+	versions of complex functions.
+	[__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (CMPLXF128):
+	Define macro.
+
+	* math/math.h: Include bits/floatn.h and bits/huge_val_flt128.h.
+	Include bits/mathcalls-helper-functions.h and bits/mathcalls.h to
+	get the declarations of _Float128 versions of math functions.
+	(__MATH_DECLARING_FLOATN): New macro to control declaration of
+	_FloatN types.
+	[__GNUC_PREREQ (6,0)] (signbit): Since GCC 6.0, __builtin_signbit
+	is type-generic, so use it without __MATH_TG.
+	[__HAVE_DISTINCT_FLOAT128] (isinf): This builtin is broken for
+	_Float128 type on GCC < 7.0.  Explicitly call __isinff128 for
+	_Float128 type and GCC < 7.0, otherwise use the builtin.
+	[__HAVE_FLOAT128 && defined __USE_GNU] (M_Ef128, M_LOG2Ef128)
+	(M_LOG10Ef128, M_LN2f128, M_LN10f128, M_PIf128, M_PI_2f128)
+	(M_PI_4f128, M_1_PIf128, M_2_PIf128, M_SQRT2f128, M_SQRT1_2f128):
+	New _GNU_SOURCE enabled macros.
+
 2017-05-12  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/sparc/sparc32/fpu/s_signbit.S (signbit): Remove alias.
diff --git a/bits/floatn.h b/bits/floatn.h
new file mode 100644
index 0000000..a806496
--- /dev/null
+++ b/bits/floatn.h
@@ -0,0 +1,35 @@
+/* Macros to control TS 18661-3 glibc features.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Defined to 1 if the current compiler invocation provides a
+   floating-point type with the IEEE 754 binary128 format, and this glibc
+   includes corresponding *f128 interfaces for it.  */
+#define __HAVE_FLOAT128 0
+
+/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
+   from the default float, double and long double types in this glibc.  */
+#define __HAVE_DISTINCT_FLOAT128 0
+
+/* Defined to concatenate the literal suffix to be used with _Float128
+   types, if __HAVE_FLOAT128 is 1.
+   E.g.: #define __f128(x) x##f128.  */
+#undef __f128
+
+/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.
+   E.g.: #define __CFLOAT128 _Complex _Float128.  */
+#undef __CFLOAT128
diff --git a/bits/huge_val_flt128.h b/bits/huge_val_flt128.h
new file mode 100644
index 0000000..63c258e
--- /dev/null
+++ b/bits/huge_val_flt128.h
@@ -0,0 +1,23 @@
+/* Default `HUGE_VAL_F128' constant.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _MATH_H
+# error "Never use <bits/huge_val_flt128.h> directly; include <math.h> instead."
+#endif
+
+#define HUGE_VAL_F128 (__builtin_huge_valf128 ())
diff --git a/bits/libm-simd-decl-stubs.h b/bits/libm-simd-decl-stubs.h
index 7328eb2..6794b9f 100644
--- a/bits/libm-simd-decl-stubs.h
+++ b/bits/libm-simd-decl-stubs.h
@@ -36,24 +36,30 @@
 #define __DECL_SIMD_cos
 #define __DECL_SIMD_cosf
 #define __DECL_SIMD_cosl
+#define __DECL_SIMD_cosf128
 
 #define __DECL_SIMD_sin
 #define __DECL_SIMD_sinf
 #define __DECL_SIMD_sinl
+#define __DECL_SIMD_sinf128
 
 #define __DECL_SIMD_sincos
 #define __DECL_SIMD_sincosf
 #define __DECL_SIMD_sincosl
+#define __DECL_SIMD_sincosf128
 
 #define __DECL_SIMD_log
 #define __DECL_SIMD_logf
 #define __DECL_SIMD_logl
+#define __DECL_SIMD_logf128
 
 #define __DECL_SIMD_exp
 #define __DECL_SIMD_expf
 #define __DECL_SIMD_expl
+#define __DECL_SIMD_expf128
 
 #define __DECL_SIMD_pow
 #define __DECL_SIMD_powf
 #define __DECL_SIMD_powl
+#define __DECL_SIMD_powf128
 #endif
diff --git a/math/Makefile b/math/Makefile
index 634c619..ff4aa00 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -29,7 +29,8 @@ headers		:= math.h bits/mathcalls.h bits/mathinline.h bits/huge_val.h \
 		   bits/math-finite.h bits/math-vector.h \
 		   bits/libm-simd-decl-stubs.h bits/iscanonical.h \
 		   bits/flt-eval-method.h bits/fp-fast.h bits/fp-logb.h \
-		   bits/long-double.h bits/mathcalls-helper-functions.h
+		   bits/long-double.h bits/mathcalls-helper-functions.h \
+		   bits/floatn.h bits/huge_val_flt128.h
 
 # FPU support code.
 aux		:= setfpucw fpu_control
diff --git a/math/bits/cmathcalls.h b/math/bits/cmathcalls.h
index 6e13930..7f042db 100644
--- a/math/bits/cmathcalls.h
+++ b/math/bits/cmathcalls.h
@@ -44,7 +44,9 @@
 #error "Never use <bits/cmathcalls.h> directly; include <complex.h> instead."
 #endif
 
-#define _Mdouble_complex_ _Mdouble_ _Complex
+#ifndef _Mdouble_complex_
+# define _Mdouble_complex_ _Mdouble_ _Complex
+#endif
 
 
 /* Trigonometric functions.  */
diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h
index 0d341fb..90b9967 100644
--- a/math/bits/mathcalls.h
+++ b/math/bits/mathcalls.h
@@ -115,7 +115,9 @@ __MATHCALL (exp10,, (_Mdouble_ __x));
 #endif
 #ifdef __USE_GNU
 /* Another name occasionally used.  */
+# if !__MATH_DECLARING_FLOATN
 __MATHCALL (pow10,, (_Mdouble_ __x));
+# endif
 #endif
 
 #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
@@ -172,14 +174,16 @@ __MATHCALLX (floor,, (_Mdouble_ __x), (__const__));
 __MATHCALL (fmod,, (_Mdouble_ __x, _Mdouble_ __y));
 
 #ifdef __USE_MISC
-# if (!defined __cplusplus \
-      || __cplusplus < 201103L /* isinf conflicts with C++11.  */ \
-      || __MATH_DECLARING_DOUBLE == 0) /* isinff or isinfl don't.  */
+# if ((!defined __cplusplus \
+       || __cplusplus < 201103L /* isinf conflicts with C++11.  */ \
+       || __MATH_DECLARING_DOUBLE == 0)) /* isinff or isinfl don't.  */ \
+      && !__MATH_DECLARING_FLOATN
 /* Return 0 if VALUE is finite or NaN, +1 if it
    is +Infinity, -1 if it is -Infinity.  */
 __MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
 # endif
 
+# if !__MATH_DECLARING_FLOATN
 /* Return nonzero if VALUE is finite and not NaN.  */
 __MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
 
@@ -189,6 +193,8 @@ __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y));
 
 /* Return the fractional part of X after dividing out `ilogb (X)'.  */
 __MATHCALL (significand,, (_Mdouble_ __x));
+# endif
+
 #endif /* Use misc.  */
 
 #ifdef __USE_ISOC99
@@ -203,9 +209,10 @@ __MATHCALLX (nan,, (const char *__tagb), (__const__));
 
 
 #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
-# if (!defined __cplusplus \
-      || __cplusplus < 201103L /* isnan conflicts with C++11.  */ \
-      || __MATH_DECLARING_DOUBLE == 0) /* isnanf or isnanl don't.  */
+# if ((!defined __cplusplus \
+       || __cplusplus < 201103L /* isnan conflicts with C++11.  */ \
+       || __MATH_DECLARING_DOUBLE == 0)) /* isnanf or isnanl don't.  */ \
+      && !__MATH_DECLARING_FLOATN
 /* Return nonzero if VALUE is not a number.  */
 __MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
 # endif
@@ -235,8 +242,10 @@ __MATHCALL (tgamma,, (_Mdouble_));
 #endif
 
 #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
+# if !__MATH_DECLARING_FLOATN
 /* Obsolete alias for `lgamma'.  */
 __MATHCALL (gamma,, (_Mdouble_));
+# endif
 #endif
 
 #ifdef __USE_MISC
@@ -254,11 +263,11 @@ __MATHCALL (rint,, (_Mdouble_ __x));
 
 /* Return X + epsilon if X < Y, X - epsilon if X > Y.  */
 __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
-# if defined __USE_ISOC99 && !defined __LDBL_COMPAT
+# if defined __USE_ISOC99 && !defined __LDBL_COMPAT && !__MATH_DECLARING_FLOATN
 __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__));
 # endif
 
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+# if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
 /* Return X - epsilon.  */
 __MATHCALL (nextdown,, (_Mdouble_ __x));
 /* Return X + epsilon.  */
@@ -277,7 +286,7 @@ __MATHCALL (scalbn,, (_Mdouble_ __x, int __n));
 __MATHDECL (int,ilogb,, (_Mdouble_ __x));
 #endif
 
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
 /* Like ilogb, but returning long int.  */
 __MATHDECL (long int, llogb,, (_Mdouble_ __x));
 #endif
@@ -332,7 +341,7 @@ __MATHCALLX (fmin,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
 __MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z));
 #endif /* Use ISO C99.  */
 
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
 /* Round X to nearest integer value, rounding halfway cases to even.  */
 __MATHCALLX (roundeven,, (_Mdouble_ __x), (__const__));
 
@@ -385,9 +394,10 @@ __MATHDECL_1 (int, setpayload,, (_Mdouble_ *__x, _Mdouble_ __payload));
 __MATHDECL_1 (int, setpayloadsig,, (_Mdouble_ *__x, _Mdouble_ __payload));
 #endif
 
-#if defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \
-			   && __MATH_DECLARING_DOUBLE	\
-			   && !defined __USE_XOPEN2K8)
+#if (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \
+			    && __MATH_DECLARING_DOUBLE	  \
+			    && !defined __USE_XOPEN2K8))  \
+     && !__MATH_DECLARING_FLOATN
 /* Return X times (2 to the Nth power).  */
 __MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n));
 #endif
diff --git a/math/complex.h b/math/complex.h
index 59ce30e..1ae4ec2 100644
--- a/math/complex.h
+++ b/math/complex.h
@@ -22,11 +22,15 @@
 #ifndef _COMPLEX_H
 #define _COMPLEX_H	1
 
-#include <features.h>
+#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
+#include <bits/libc-header-start.h>
 
 /* Get general and ISO C99 specific information.  */
 #include <bits/mathdef.h>
 
+/* Gather machine-dependent _FloatN type support.  */
+#include <bits/floatn.h>
+
 __BEGIN_DECLS
 
 /* We might need to add support for more compilers here.  But since ISO
@@ -55,6 +59,10 @@ __BEGIN_DECLS
 # define CMPLXL(x, y) __builtin_complex ((long double) (x), (long double) (y))
 #endif
 
+#if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
+# define CMPLXF128(x, y) __builtin_complex ((_Float128) (x), (_Float128) (y))
+#endif
+
 /* The file <bits/cmathcalls.h> contains the prototypes for all the
    actual math functions.  These macros are used for those prototypes,
    so we can easily declare each function as both `name' and `__name',
@@ -84,6 +92,24 @@ __BEGIN_DECLS
 #undef	_Mdouble_
 #undef	__MATH_PRECNAME
 
+#if (__HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC)) \
+     && __GLIBC_USE (IEC_60559_TYPES_EXT)
+# ifndef _Mfloat128_
+#  define _Mfloat128_		_Float128
+# endif
+/* GCC < 7 requires extra convincing to expose a complex float128 type.  */
+# ifdef __CFLOAT128
+#  undef _Mdouble_complex_
+#  define _Mdouble_complex_	__CFLOAT128
+# endif
+# define _Mdouble_		_Mfloat128_
+# define __MATH_PRECNAME(name)	name##f128
+# include <bits/cmathcalls.h>
+# undef _Mdouble_
+# undef __MATH_PRECNAME
+# undef _Mdouble_complex_
+#endif
+
 /* And the long double versions.  It is non-critical to define them
    here unconditionally since `long double' is required in ISO C99.  */
 #if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC)	\
diff --git a/math/math.h b/math/math.h
index cfaed0e..daf58ab 100644
--- a/math/math.h
+++ b/math/math.h
@@ -34,9 +34,17 @@ __BEGIN_DECLS
 /* Get machine-dependent vector math functions declarations.  */
 #include <bits/math-vector.h>
 
+/* Gather machine dependent type support.  */
+#include <bits/floatn.h>
+
 /* Get machine-dependent HUGE_VAL value (returned on overflow).
    On all IEEE754 machines, this is +Infinity.  */
 #include <bits/huge_val.h>
+
+#if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
+# include <bits/huge_val_flt128.h>
+#endif
+
 #ifdef __USE_ISOC99
 # include <bits/huge_valf.h>
 # include <bits/huge_vall.h>
@@ -208,11 +216,13 @@ enum
 #define _Mdouble_		double
 #define __MATH_PRECNAME(name,r)	__CONCAT(name,r)
 #define __MATH_DECLARING_DOUBLE  1
+#define __MATH_DECLARING_FLOATN  0
 #include <bits/mathcalls-helper-functions.h>
 #include <bits/mathcalls.h>
 #undef	_Mdouble_
 #undef	__MATH_PRECNAME
 #undef __MATH_DECLARING_DOUBLE
+#undef __MATH_DECLARING_FLOATN
 
 #ifdef __USE_ISOC99
 
@@ -226,11 +236,13 @@ enum
 # define _Mdouble_		_Mfloat_
 # define __MATH_PRECNAME(name,r) name##f##r
 # define __MATH_DECLARING_DOUBLE  0
+# define __MATH_DECLARING_FLOATN  0
 # include <bits/mathcalls-helper-functions.h>
 # include <bits/mathcalls.h>
 # undef	_Mdouble_
 # undef	__MATH_PRECNAME
 # undef __MATH_DECLARING_DOUBLE
+# undef __MATH_DECLARING_FLOATN
 
 # if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC) \
      || defined __LDBL_COMPAT \
@@ -269,16 +281,42 @@ extern long double __REDIRECT_NTH (nexttowardl,
 #  define _Mdouble_		_Mlong_double_
 #  define __MATH_PRECNAME(name,r) name##l##r
 #  define __MATH_DECLARING_DOUBLE  0
+#  define __MATH_DECLARING_FLOATN  0
 #  define __MATH_DECLARE_LDOUBLE   1
 #  include <bits/mathcalls-helper-functions.h>
 #  include <bits/mathcalls.h>
 #  undef _Mdouble_
 #  undef __MATH_PRECNAME
 #  undef __MATH_DECLARING_DOUBLE
+#  undef __MATH_DECLARING_FLOATN
 
 # endif /* !(__NO_LONG_DOUBLE_MATH && _LIBC) || __LDBL_COMPAT */
 
 #endif	/* Use ISO C99.  */
+
+/* Include the file of declarations again, this time using `_Float128'
+   instead of `double' and appending f128 to each function name.  */
+
+#if __HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC)
+# ifndef _Mfloat128_
+#  define _Mfloat128_		_Float128
+# endif
+# define _Mdouble_		_Mfloat128_
+# define __MATH_PRECNAME(name,r) name##f128##r
+# define __MATH_DECLARING_DOUBLE  0
+# define __MATH_DECLARING_FLOATN  1
+# if __HAVE_DISTINCT_FLOAT128
+#  include <bits/mathcalls-helper-functions.h>
+# endif
+# if __GLIBC_USE (IEC_60559_TYPES_EXT)
+#  include <bits/mathcalls.h>
+# endif
+# undef _Mdouble_
+# undef __MATH_PRECNAME
+# undef __MATH_DECLARING_DOUBLE
+# undef __MATH_DECLARING_FLOATN
+#endif /* __HAVE_DISTINCT_FLOAT128.  */
+
 #undef	__MATHDECL_1
 #undef	__MATHDECL
 #undef	__MATHCALL
@@ -348,7 +386,9 @@ enum
 # endif
 
 /* Return nonzero value if sign of X is negative.  */
-# if __GNUC_PREREQ (4,0)
+# if __GNUC_PREREQ (6,0)
+#  define signbit(x) __builtin_signbit (x)
+# elif __GNUC_PREREQ (4,0)
 #  define signbit(x) __MATH_TG ((x), __builtin_signbit, (x))
 # else
 #  define signbit(x) __MATH_TG ((x), __signbit, (x))
@@ -377,7 +417,13 @@ enum
 # endif
 
 /* Return nonzero value if X is positive or negative infinity.  */
-# if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__
+# if __HAVE_DISTINCT_FLOAT128 && !__GNUC_PREREQ (7,0) \
+     && !defined __SUPPORT_SNAN__
+   /* __builtin_isinf_sign is broken for float128 only before GCC 7.0.  */
+#  define isinf(x) \
+    (__builtin_types_compatible_p (__typeof (x), _Float128) \
+     ? __isinff128 (x) : __builtin_isinf_sign (x))
+# elif __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__
 #  define isinf(x) __builtin_isinf_sign (x)
 # else
 #  define isinf(x) __MATH_TG ((x), __isinf, (x))
@@ -529,6 +575,21 @@ extern int matherr (struct exception *__exc);
 # define M_SQRT1_2l	0.707106781186547524400844362104849039L /* 1/sqrt(2) */
 #endif
 
+#if __HAVE_FLOAT128 && defined __USE_GNU
+# define M_Ef128	__f128 (2.718281828459045235360287471352662498) /* e */
+# define M_LOG2Ef128	__f128 (1.442695040888963407359924681001892137) /* log_2 e */
+# define M_LOG10Ef128	__f128 (0.434294481903251827651128918916605082) /* log_10 e */
+# define M_LN2f128	__f128 (0.693147180559945309417232121458176568) /* log_e 2 */
+# define M_LN10f128	__f128 (2.302585092994045684017991454684364208) /* log_e 10 */
+# define M_PIf128	__f128 (3.141592653589793238462643383279502884) /* pi */
+# define M_PI_2f128	__f128 (1.570796326794896619231321691639751442) /* pi/2 */
+# define M_PI_4f128	__f128 (0.785398163397448309615660845819875721) /* pi/4 */
+# define M_1_PIf128	__f128 (0.318309886183790671537767526745028724) /* 1/pi */
+# define M_2_PIf128	__f128 (0.636619772367581343075535053490057448) /* 2/pi */
+# define M_2_SQRTPIf128	__f128 (1.128379167095512573896158903121545172) /* 2/sqrt(pi) */
+# define M_SQRT2f128	__f128 (1.414213562373095048801688724209698079) /* sqrt(2) */
+# define M_SQRT1_2f128	__f128 (0.707106781186547524400844362104849039) /* 1/sqrt(2) */
+#endif
 
 /* When compiling in strict ISO C compatible mode we must not use the
    inline functions since they, among other things, do not set the

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                     |   97 +++++++++++++++++++++++++
 bits/floatn.h                                 |   35 +++++++++
 bits/huge_val_flt128.h                        |   23 ++++++
 bits/libm-simd-decl-stubs.h                   |    6 ++
 include/complex.h                             |    3 +
 include/float.h                               |   31 ++++++++
 include/math.h                                |   13 ++++
 math/Makefile                                 |    3 +-
 math/bits/cmathcalls.h                        |    4 +-
 math/bits/math-finite.h                       |   13 ++--
 math/bits/mathcalls.h                         |   36 ++++++----
 math/complex.h                                |   28 +++++++-
 math/math.h                                   |   87 ++++++++++++++++++++++-
 sysdeps/generic/fix-fp-int-convert-overflow.h |    2 +
 sysdeps/generic/math-type-macros-float128.h   |   42 +++++++++++
 sysdeps/generic/math_private.h                |   51 +++++++++++++-
 sysdeps/generic/math_private_calls.h          |    4 +-
 sysdeps/ieee754/ldbl-opt/s_sin.c              |    1 +
 18 files changed, 453 insertions(+), 26 deletions(-)
 create mode 100644 bits/floatn.h
 create mode 100644 bits/huge_val_flt128.h
 create mode 100644 include/float.h
 create mode 100644 sysdeps/generic/math-type-macros-float128.h


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]