public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 0/8] Add float128 functions and declarations to libm
@ 2017-04-28 21:35 Gabriel F. T. Gomes
  2017-04-28 21:35 ` [PATCH v2 2/8] float128: Add _Float128 make bits " Gabriel F. T. Gomes
                   ` (7 more replies)
  0 siblings, 8 replies; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-04-28 21:35 UTC (permalink / raw)
  To: libc-alpha

Changes since v1:

  - Refactored headers to reduce the amount of repetitive boilerplate
    needed to add float128 variants of math functions.
  - Removed the float128-specific implementation of IEEE wrappers in
    favor of the type-generic (templated) wrappers that do not rely on
    __kernel_standard / _LIB_VERSION functionality.
  - Moved hacks for old compilers support to the new,
    architecture-dependent file bits/floatn-compat.h

Testing of the float128 support was done on the branch
tuliom/float128, where we keep the remaining patches (which: add the
remaining functions and macros to libm; extend __MATH_TG; add
strfromf128/strtof128; add float128 tests; and actually enable
float128 support on powerpc64le).

Gabriel F. T. Gomes (2):
  float128: Include math-finite.h for _Float128
  float128: Enable use of IEEE wrapper templates

Paul E. Murphy (6):
  ldbl-128: Use mathx_hidden_def inplace of hidden_def
  float128: Add _Float128 make bits to libm.
  Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__
  float128: Add public _Float128 declarations to libm.
  float128: Add private _Float128 declarations for libm.
  float128: Add wrappers to override ldbl-128 as float128.

 bits/floatn-compat.h                             |  20 ++
 bits/floatn.h                                    |  30 +++
 bits/huge_val_flt128.h                           |  25 ++
 bits/libc-header-start.h                         |   9 +
 bits/libm-simd-decl-stubs.h                      |   6 +
 include/complex.h                                |   7 +
 include/float.h                                  |  31 +++
 include/math.h                                   |  13 +
 math/Makefile                                    |  19 +-
 math/bits/cmathcalls.h                           |   4 +-
 math/bits/mathcalls.h                            |  30 ++-
 math/complex.h                                   |  27 +-
 math/math.h                                      |  73 ++++-
 sysdeps/generic/fix-fp-int-convert-overflow.h    |   2 +
 sysdeps/generic/math-type-macros-float128.h      |  46 ++++
 sysdeps/generic/math_private.h                   |  60 ++++-
 sysdeps/generic/math_private_calls.h             |   4 +-
 sysdeps/ieee754/float128/Makeconfig              |   3 +
 sysdeps/ieee754/float128/Versions                | 139 ++++++++++
 sysdeps/ieee754/float128/e_acosf128.c            |   2 +
 sysdeps/ieee754/float128/e_acoshf128.c           |   2 +
 sysdeps/ieee754/float128/e_asinf128.c            |   2 +
 sysdeps/ieee754/float128/e_atan2f128.c           |   2 +
 sysdeps/ieee754/float128/e_atanhf128.c           |   2 +
 sysdeps/ieee754/float128/e_coshf128.c            |   2 +
 sysdeps/ieee754/float128/e_exp10f128.c           |   2 +
 sysdeps/ieee754/float128/e_expf128.c             |   2 +
 sysdeps/ieee754/float128/e_fmodf128.c            |   2 +
 sysdeps/ieee754/float128/e_gammaf128_r.c         |   2 +
 sysdeps/ieee754/float128/e_hypotf128.c           |   2 +
 sysdeps/ieee754/float128/e_ilogbf128.c           |   2 +
 sysdeps/ieee754/float128/e_j0f128.c              |   2 +
 sysdeps/ieee754/float128/e_j1f128.c              |   2 +
 sysdeps/ieee754/float128/e_jnf128.c              |   2 +
 sysdeps/ieee754/float128/e_lgammaf128.c          |   1 +
 sysdeps/ieee754/float128/e_lgammaf128_r.c        |   2 +
 sysdeps/ieee754/float128/e_log10f128.c           |   2 +
 sysdeps/ieee754/float128/e_log2f128.c            |   2 +
 sysdeps/ieee754/float128/e_logf128.c             |   2 +
 sysdeps/ieee754/float128/e_powf128.c             |   2 +
 sysdeps/ieee754/float128/e_rem_pio2f128.c        |   2 +
 sysdeps/ieee754/float128/e_remainderf128.c       |   2 +
 sysdeps/ieee754/float128/e_scalbf128.c           |   1 +
 sysdeps/ieee754/float128/e_sinhf128.c            |   2 +
 sysdeps/ieee754/float128/e_sqrtf128.c            |   2 +
 sysdeps/ieee754/float128/float128_private.h      | 330 +++++++++++++++++++++++
 sysdeps/ieee754/float128/gamma_productf128.c     |   2 +
 sysdeps/ieee754/float128/ieee754_float128.h      | 140 ++++++++++
 sysdeps/ieee754/float128/k_cosf128.c             |   2 +
 sysdeps/ieee754/float128/k_rem_pio2f128.c        |   2 +
 sysdeps/ieee754/float128/k_sincosf128.c          |   2 +
 sysdeps/ieee754/float128/k_sinf128.c             |   2 +
 sysdeps/ieee754/float128/k_tanf128.c             |   2 +
 sysdeps/ieee754/float128/lgamma_negf128.c        |   2 +
 sysdeps/ieee754/float128/lgamma_productf128.c    |   2 +
 sysdeps/ieee754/float128/s_asinhf128.c           |   2 +
 sysdeps/ieee754/float128/s_atanf128.c            |   2 +
 sysdeps/ieee754/float128/s_cbrtf128.c            |   2 +
 sysdeps/ieee754/float128/s_ceilf128.c            |   2 +
 sysdeps/ieee754/float128/s_copysignf128.c        |   2 +
 sysdeps/ieee754/float128/s_cosf128.c             |   2 +
 sysdeps/ieee754/float128/s_erff128.c             |   2 +
 sysdeps/ieee754/float128/s_expm1f128.c           |   2 +
 sysdeps/ieee754/float128/s_fabsf128.c            |   2 +
 sysdeps/ieee754/float128/s_finitef128.c          |   2 +
 sysdeps/ieee754/float128/s_floorf128.c           |   2 +
 sysdeps/ieee754/float128/s_fmaf128.c             |   2 +
 sysdeps/ieee754/float128/s_fpclassifyf128.c      |   2 +
 sysdeps/ieee754/float128/s_frexpf128.c           |   2 +
 sysdeps/ieee754/float128/s_fromfpf128.c          |   5 +
 sysdeps/ieee754/float128/s_fromfpxf128.c         |   5 +
 sysdeps/ieee754/float128/s_getpayloadf128.c      |   2 +
 sysdeps/ieee754/float128/s_isinff128.c           |   2 +
 sysdeps/ieee754/float128/s_isnanf128.c           |   2 +
 sysdeps/ieee754/float128/s_issignalingf128.c     |   2 +
 sysdeps/ieee754/float128/s_llrintf128.c          |   2 +
 sysdeps/ieee754/float128/s_llroundf128.c         |   2 +
 sysdeps/ieee754/float128/s_log1pf128.c           |   2 +
 sysdeps/ieee754/float128/s_logbf128.c            |   2 +
 sysdeps/ieee754/float128/s_lrintf128.c           |   2 +
 sysdeps/ieee754/float128/s_lroundf128.c          |   2 +
 sysdeps/ieee754/float128/s_modff128.c            |   2 +
 sysdeps/ieee754/float128/s_nearbyintf128.c       |   2 +
 sysdeps/ieee754/float128/s_nextafterf128.c       |   2 +
 sysdeps/ieee754/float128/s_nexttowardf128.c      |   1 +
 sysdeps/ieee754/float128/s_nextupf128.c          |   2 +
 sysdeps/ieee754/float128/s_remquof128.c          |   2 +
 sysdeps/ieee754/float128/s_rintf128.c            |   2 +
 sysdeps/ieee754/float128/s_roundf128.c           |   2 +
 sysdeps/ieee754/float128/s_scalblnf128.c         |   2 +
 sysdeps/ieee754/float128/s_scalbnf128.c          |   2 +
 sysdeps/ieee754/float128/s_setpayloadf128.c      |   4 +
 sysdeps/ieee754/float128/s_setpayloadsigf128.c   |   4 +
 sysdeps/ieee754/float128/s_signbitf128.c         |   2 +
 sysdeps/ieee754/float128/s_significandf128.c     |   1 +
 sysdeps/ieee754/float128/s_sincosf128.c          |   2 +
 sysdeps/ieee754/float128/s_sinf128.c             |   2 +
 sysdeps/ieee754/float128/s_tanf128.c             |   2 +
 sysdeps/ieee754/float128/s_tanhf128.c            |   2 +
 sysdeps/ieee754/float128/s_totalorderf128.c      |   2 +
 sysdeps/ieee754/float128/s_totalordermagf128.c   |   2 +
 sysdeps/ieee754/float128/s_truncf128.c           |   2 +
 sysdeps/ieee754/float128/s_ufromfpf128.c         |   5 +
 sysdeps/ieee754/float128/s_ufromfpxf128.c        |   5 +
 sysdeps/ieee754/float128/t_sincosf128.c          |   2 +
 sysdeps/ieee754/float128/w_llogbf128.c           |   3 +
 sysdeps/ieee754/float128/x2y2m1f128.c            |   2 +
 sysdeps/ieee754/ldbl-128/s_finitel.c             |   2 +-
 sysdeps/ieee754/ldbl-128/s_isinfl.c              |   2 +-
 sysdeps/ieee754/ldbl-128/s_isnanl.c              |   2 +-
 sysdeps/ieee754/ldbl-opt/s_sin.c                 |   1 +
 sysdeps/powerpc/powerpc64le/bits/floatn-compat.h |  58 ++++
 112 files changed, 1246 insertions(+), 22 deletions(-)
 create mode 100644 bits/floatn-compat.h
 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
 create mode 100644 sysdeps/ieee754/float128/Makeconfig
 create mode 100644 sysdeps/ieee754/float128/Versions
 create mode 100644 sysdeps/ieee754/float128/e_acosf128.c
 create mode 100644 sysdeps/ieee754/float128/e_acoshf128.c
 create mode 100644 sysdeps/ieee754/float128/e_asinf128.c
 create mode 100644 sysdeps/ieee754/float128/e_atan2f128.c
 create mode 100644 sysdeps/ieee754/float128/e_atanhf128.c
 create mode 100644 sysdeps/ieee754/float128/e_coshf128.c
 create mode 100644 sysdeps/ieee754/float128/e_exp10f128.c
 create mode 100644 sysdeps/ieee754/float128/e_expf128.c
 create mode 100644 sysdeps/ieee754/float128/e_fmodf128.c
 create mode 100644 sysdeps/ieee754/float128/e_gammaf128_r.c
 create mode 100644 sysdeps/ieee754/float128/e_hypotf128.c
 create mode 100644 sysdeps/ieee754/float128/e_ilogbf128.c
 create mode 100644 sysdeps/ieee754/float128/e_j0f128.c
 create mode 100644 sysdeps/ieee754/float128/e_j1f128.c
 create mode 100644 sysdeps/ieee754/float128/e_jnf128.c
 create mode 100644 sysdeps/ieee754/float128/e_lgammaf128.c
 create mode 100644 sysdeps/ieee754/float128/e_lgammaf128_r.c
 create mode 100644 sysdeps/ieee754/float128/e_log10f128.c
 create mode 100644 sysdeps/ieee754/float128/e_log2f128.c
 create mode 100644 sysdeps/ieee754/float128/e_logf128.c
 create mode 100644 sysdeps/ieee754/float128/e_powf128.c
 create mode 100644 sysdeps/ieee754/float128/e_rem_pio2f128.c
 create mode 100644 sysdeps/ieee754/float128/e_remainderf128.c
 create mode 100644 sysdeps/ieee754/float128/e_scalbf128.c
 create mode 100644 sysdeps/ieee754/float128/e_sinhf128.c
 create mode 100644 sysdeps/ieee754/float128/e_sqrtf128.c
 create mode 100644 sysdeps/ieee754/float128/float128_private.h
 create mode 100644 sysdeps/ieee754/float128/gamma_productf128.c
 create mode 100644 sysdeps/ieee754/float128/ieee754_float128.h
 create mode 100644 sysdeps/ieee754/float128/k_cosf128.c
 create mode 100644 sysdeps/ieee754/float128/k_rem_pio2f128.c
 create mode 100644 sysdeps/ieee754/float128/k_sincosf128.c
 create mode 100644 sysdeps/ieee754/float128/k_sinf128.c
 create mode 100644 sysdeps/ieee754/float128/k_tanf128.c
 create mode 100644 sysdeps/ieee754/float128/lgamma_negf128.c
 create mode 100644 sysdeps/ieee754/float128/lgamma_productf128.c
 create mode 100644 sysdeps/ieee754/float128/s_asinhf128.c
 create mode 100644 sysdeps/ieee754/float128/s_atanf128.c
 create mode 100644 sysdeps/ieee754/float128/s_cbrtf128.c
 create mode 100644 sysdeps/ieee754/float128/s_ceilf128.c
 create mode 100644 sysdeps/ieee754/float128/s_copysignf128.c
 create mode 100644 sysdeps/ieee754/float128/s_cosf128.c
 create mode 100644 sysdeps/ieee754/float128/s_erff128.c
 create mode 100644 sysdeps/ieee754/float128/s_expm1f128.c
 create mode 100644 sysdeps/ieee754/float128/s_fabsf128.c
 create mode 100644 sysdeps/ieee754/float128/s_finitef128.c
 create mode 100644 sysdeps/ieee754/float128/s_floorf128.c
 create mode 100644 sysdeps/ieee754/float128/s_fmaf128.c
 create mode 100644 sysdeps/ieee754/float128/s_fpclassifyf128.c
 create mode 100644 sysdeps/ieee754/float128/s_frexpf128.c
 create mode 100644 sysdeps/ieee754/float128/s_fromfpf128.c
 create mode 100644 sysdeps/ieee754/float128/s_fromfpxf128.c
 create mode 100644 sysdeps/ieee754/float128/s_getpayloadf128.c
 create mode 100644 sysdeps/ieee754/float128/s_isinff128.c
 create mode 100644 sysdeps/ieee754/float128/s_isnanf128.c
 create mode 100644 sysdeps/ieee754/float128/s_issignalingf128.c
 create mode 100644 sysdeps/ieee754/float128/s_llrintf128.c
 create mode 100644 sysdeps/ieee754/float128/s_llroundf128.c
 create mode 100644 sysdeps/ieee754/float128/s_log1pf128.c
 create mode 100644 sysdeps/ieee754/float128/s_logbf128.c
 create mode 100644 sysdeps/ieee754/float128/s_lrintf128.c
 create mode 100644 sysdeps/ieee754/float128/s_lroundf128.c
 create mode 100644 sysdeps/ieee754/float128/s_modff128.c
 create mode 100644 sysdeps/ieee754/float128/s_nearbyintf128.c
 create mode 100644 sysdeps/ieee754/float128/s_nextafterf128.c
 create mode 100644 sysdeps/ieee754/float128/s_nexttowardf128.c
 create mode 100644 sysdeps/ieee754/float128/s_nextupf128.c
 create mode 100644 sysdeps/ieee754/float128/s_remquof128.c
 create mode 100644 sysdeps/ieee754/float128/s_rintf128.c
 create mode 100644 sysdeps/ieee754/float128/s_roundf128.c
 create mode 100644 sysdeps/ieee754/float128/s_scalblnf128.c
 create mode 100644 sysdeps/ieee754/float128/s_scalbnf128.c
 create mode 100644 sysdeps/ieee754/float128/s_setpayloadf128.c
 create mode 100644 sysdeps/ieee754/float128/s_setpayloadsigf128.c
 create mode 100644 sysdeps/ieee754/float128/s_signbitf128.c
 create mode 100644 sysdeps/ieee754/float128/s_significandf128.c
 create mode 100644 sysdeps/ieee754/float128/s_sincosf128.c
 create mode 100644 sysdeps/ieee754/float128/s_sinf128.c
 create mode 100644 sysdeps/ieee754/float128/s_tanf128.c
 create mode 100644 sysdeps/ieee754/float128/s_tanhf128.c
 create mode 100644 sysdeps/ieee754/float128/s_totalorderf128.c
 create mode 100644 sysdeps/ieee754/float128/s_totalordermagf128.c
 create mode 100644 sysdeps/ieee754/float128/s_truncf128.c
 create mode 100644 sysdeps/ieee754/float128/s_ufromfpf128.c
 create mode 100644 sysdeps/ieee754/float128/s_ufromfpxf128.c
 create mode 100644 sysdeps/ieee754/float128/t_sincosf128.c
 create mode 100644 sysdeps/ieee754/float128/w_llogbf128.c
 create mode 100644 sysdeps/ieee754/float128/x2y2m1f128.c
 create mode 100644 sysdeps/powerpc/powerpc64le/bits/floatn-compat.h

-- 
2.4.11

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v2 2/8] float128: Add _Float128 make bits to libm.
  2017-04-28 21:35 [PATCH v2 0/8] Add float128 functions and declarations to libm Gabriel F. T. Gomes
@ 2017-04-28 21:35 ` Gabriel F. T. Gomes
  2017-05-01 12:00   ` Joseph Myers
  2017-04-28 21:35 ` [PATCH v2 7/8] float128: Enable use of IEEE wrapper templates Gabriel F. T. Gomes
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-04-28 21:35 UTC (permalink / raw)
  To: libc-alpha

From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>

This adds the appropriate common bits for a platform to
enable float128 and expose ABI.

2016-10-21  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
	    Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>

	* math/Makefile:
	(type-float128-suffix): New variable
	(type-float128-routines): Likewise
	(type-float128-yes): Likewise
	(types): Append float128 if supported
	(types-basic): New variable to control the use of templates for
	float, double, and long double, but not for float128 or newer types.
	(type-basic-foreach): Likewise.

	* sysdeps/ieee754/float128/Makeconfig: New file.
	* sysdeps/ieee754/float128/Versions: New file.
---
 math/Makefile                       |  16 ++++-
 sysdeps/ieee754/float128/Makeconfig |   3 +
 sysdeps/ieee754/float128/Versions   | 139 ++++++++++++++++++++++++++++++++++++
 3 files changed, 156 insertions(+), 2 deletions(-)
 create mode 100644 sysdeps/ieee754/float128/Makeconfig
 create mode 100644 sysdeps/ieee754/float128/Versions

diff --git a/math/Makefile b/math/Makefile
index 97080a7..634c619 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -100,7 +100,7 @@ libm-compat-calls =							\
 # Finally, note that types is an intentionally recursive variable.
 # We only know the full set of supported types for the target machine
 # after the Rules makefile has been parsed.
-types = $(type-ldouble-$(long-double-fcts)) double float
+types-basic = $(type-ldouble-$(long-double-fcts)) double float
 
 # long double support
 type-ldouble-suffix := l
@@ -117,12 +117,23 @@ type-double-routines := branred doasin dosincos halfulp mpa mpatan2	\
 type-float-suffix := f
 type-float-routines := k_rem_pio2f
 
+# _Float128 support
+type-float128-suffix := f128
+type-float128-routines := t_sincosf128 k_sincosf128
+type-float128-yes := float128
+types = $(types-basic) $(type-float128-$(float128-fcts))
+
+# For each of the basic types (float, double, long double), replace the
+# occurrences of 'F' in arg 1 with the appropriate suffix for the type.
+type-basic-foreach = $(foreach t, $(types-basic), \
+		       $(subst F,$(type-$(t)-suffix),$(1)))
 
 # Apply suffix to each type in arg 1
 type-foreach = $(foreach t,$(types),$(subst F,$(type-$(t)-suffix),$(1)))
 
 libm-routines = $(strip $(libm-support)					\
-			$(call type-foreach, $(libm-compat-calls))	\
+			$(call type-basic-foreach,			\
+			       $(libm-compat-calls))			\
 			$(call type-foreach, $(libm-calls))		\
 			$(foreach t, $(types), $(type-$(t)-routines))) 	\
 
@@ -543,6 +554,7 @@ endif
 CFLAGS-s_modf.c += -fsignaling-nans
 CFLAGS-s_modff.c += -fsignaling-nans
 CFLAGS-s_modfl.c += -fsignaling-nans
+CFLAGS-s_modff128.c += -fsignaling-nans
 
 # The -lieee library is actually an object file.
 # The module just defines the _LIB_VERSION_ variable.
diff --git a/sysdeps/ieee754/float128/Makeconfig b/sysdeps/ieee754/float128/Makeconfig
new file mode 100644
index 0000000..6c385d2
--- /dev/null
+++ b/sysdeps/ieee754/float128/Makeconfig
@@ -0,0 +1,3 @@
+# Include this earlier so it can be used earlier in Makefiles,
+# and sysdep/ makefiles.
+float128-fcts = yes
diff --git a/sysdeps/ieee754/float128/Versions b/sysdeps/ieee754/float128/Versions
new file mode 100644
index 0000000..4829102
--- /dev/null
+++ b/sysdeps/ieee754/float128/Versions
@@ -0,0 +1,139 @@
+%include <float128-abi.h>
+%ifndef FLOAT128_VERSION
+% error "float128-abi.h must define FLOAT128_VERSION"
+%endif
+libm {
+  FLOAT128_VERSION {
+    acosf128;
+    acoshf128;
+    asinf128;
+    asinhf128;
+    atan2f128;
+    atanf128;
+    atanhf128;
+    cabsf128;
+    cacosf128;
+    cacoshf128;
+    cargf128;
+    casinf128;
+    casinhf128;
+    catanf128;
+    catanhf128;
+    cbrtf128;
+    ccosf128;
+    ccoshf128;
+    ceilf128;
+    cexpf128;
+    cimagf128;
+    clog10f128;
+    clogf128;
+    copysignf128;
+    conjf128;
+    cosf128;
+    coshf128;
+    cpowf128;
+    cprojf128;
+    crealf128;
+    csinf128;
+    csinhf128;
+    csqrtf128;
+    ctanf128;
+    ctanhf128;
+    erff128;
+    erfcf128;
+    exp10f128;
+    expf128;
+    expm1f128;
+    fabsf128;
+    fdimf128;
+    floorf128;
+    fmaf128;
+    fmaxf128;
+    fminf128;
+    fmodf128;
+    frexpf128;
+    fromfpf128;
+    fromfpxf128;
+    getpayloadf128;
+    hypotf128;
+    ilogbf128;
+    j0f128;
+    j1f128;
+    jnf128;
+    ldexpf128;
+    lgammaf128;
+    lgammaf128_r;
+    llogbf128;
+    llrintf128;
+    llroundf128;
+    log10f128;
+    log1pf128;
+    log2f128;
+    logf128;
+    logbf128;
+    lrintf128;
+    lroundf128;
+    modff128;
+    nanf128;
+    nearbyintf128;
+    nextafterf128;
+    nextdownf128;
+    nextupf128;
+    powf128;
+    remainderf128;
+    remquof128;
+    rintf128;
+    roundf128;
+    scalblnf128;
+    scalbnf128;
+    setpayloadf128;
+    setpayloadsigf128;
+    sincosf128;
+    sinf128;
+    sinhf128;
+    sqrtf128;
+    tanf128;
+    tanhf128;
+    tgammaf128;
+    totalorderf128;
+    totalordermagf128;
+    truncf128;
+    ufromfpf128;
+    ufromfpxf128;
+    y0f128;
+    y1f128;
+    ynf128;
+    __acosf128_finite;
+    __acoshf128_finite;
+    __asinf128_finite;
+    __atan2f128_finite;
+    __atanhf128_finite;
+    __coshf128_finite;
+    __exp10f128_finite;
+    __expf128_finite;
+    __finitef128;
+    __fmodf128_finite;
+    __fpclassifyf128;
+    __gammaf128_r_finite;
+    __hypotf128_finite;
+    __iseqsigf128;
+    __isinff128;
+    __isnanf128;
+    __issignalingf128;
+    __lgammaf128_r_finite;
+    __log10f128_finite;
+    __log2f128_finite;
+    __logf128_finite;
+    __powf128_finite;
+    __remainderf128_finite;
+    __signbitf128;
+    __sinhf128_finite;
+    __sqrtf128_finite;
+    __j0f128_finite;
+    __j1f128_finite;
+    __jnf128_finite;
+    __y0f128_finite;
+    __y1f128_finite;
+    __ynf128_finite;
+  }
+}
-- 
2.4.11

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v2 5/8] float128: Include math-finite.h for _Float128
  2017-04-28 21:35 [PATCH v2 0/8] Add float128 functions and declarations to libm Gabriel F. T. Gomes
  2017-04-28 21:35 ` [PATCH v2 2/8] float128: Add _Float128 make bits " Gabriel F. T. Gomes
  2017-04-28 21:35 ` [PATCH v2 7/8] float128: Enable use of IEEE wrapper templates Gabriel F. T. Gomes
@ 2017-04-28 21:35 ` Gabriel F. T. Gomes
  2017-04-28 22:53   ` Joseph Myers
  2017-04-28 21:36 ` [PATCH v2 6/8] float128: Add private _Float128 declarations for libm Gabriel F. T. Gomes
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-04-28 21:35 UTC (permalink / raw)
  To: libc-alpha

All the declarations in math-finite.h are macroized by floating-point
type.  This patch includes it for float128.

2017-03-20  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>

	* math/math.h: Include bits/math-finite.h for _Float128.
---
 math/math.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/math/math.h b/math/math.h
index f154d45..d022d9f 100644
--- a/math/math.h
+++ b/math/math.h
@@ -659,6 +659,19 @@ extern int matherr (struct exception *__exc);
 #  endif
 
 # endif /* __USE_ISOC99.  */
+
+/* Include bits/math-finite.h for float128.  */
+# if __USE_FLOAT128
+#  define _Mdouble_ _Float128
+#  define __MATH_DECLARING_DOUBLE 0
+#  define __MATH_DECLARING_LDOUBLE 0
+#  define _MSUF_ f128
+#  include <bits/math-finite.h>
+#  undef _Mdouble_
+#  undef __MATH_DECLARING_DOUBLE
+#  undef __MATH_DECLARING_LDOUBLE
+#  undef _MSUF_
+# endif
 #endif /* __FINITE_MATH_ONLY__ > 0.  */
 
 #ifdef __USE_ISOC99
-- 
2.4.11

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v2 7/8] float128: Enable use of IEEE wrapper templates
  2017-04-28 21:35 [PATCH v2 0/8] Add float128 functions and declarations to libm Gabriel F. T. Gomes
  2017-04-28 21:35 ` [PATCH v2 2/8] float128: Add _Float128 make bits " Gabriel F. T. Gomes
@ 2017-04-28 21:35 ` Gabriel F. T. Gomes
  2017-04-28 21:35 ` [PATCH v2 5/8] float128: Include math-finite.h for _Float128 Gabriel F. T. Gomes
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-04-28 21:35 UTC (permalink / raw)
  To: libc-alpha

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.

2017-02-01  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.
---
 sysdeps/generic/math-type-macros-float128.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sysdeps/generic/math-type-macros-float128.h b/sysdeps/generic/math-type-macros-float128.h
index 4cd23a0..c06db4a 100644
--- a/sysdeps/generic/math-type-macros-float128.h
+++ b/sysdeps/generic/math-type-macros-float128.h
@@ -40,4 +40,7 @@
 /* Supply the generic macros.  */
 #include <math-type-macros.h>
 
+/* Use the type-generic wrapper templates.  */
+#define __USE_WRAPPER_TEMPLATE 1
+
 #endif
-- 
2.4.11

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v2 3/8] Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__
  2017-04-28 21:35 [PATCH v2 0/8] Add float128 functions and declarations to libm Gabriel F. T. Gomes
                   ` (5 preceding siblings ...)
  2017-04-28 21:36 ` [PATCH v2 4/8] float128: Add public _Float128 declarations to libm Gabriel F. T. Gomes
@ 2017-04-28 21:36 ` Gabriel F. T. Gomes
  2017-05-03 11:36   ` Joseph Myers
  2017-04-28 21:36 ` [PATCH v2 8/8] float128: Add wrappers to override ldbl-128 as float128 Gabriel F. T. Gomes
  7 siblings, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-04-28 21:36 UTC (permalink / raw)
  To: libc-alpha

From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>

This macro is defined by TS 18661-3 for supporting the _FloatN and
_FloatNx types, as well as the functions suffixed with fN.

2017-02-23  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>

	* bits/libc-header-start.h:
	(__GLIBC_USE_IEC_60559_TYPES_EXT): New macro.
---
 bits/libc-header-start.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/bits/libc-header-start.h b/bits/libc-header-start.h
index 860225d..e1390e5 100644
--- a/bits/libc-header-start.h
+++ b/bits/libc-header-start.h
@@ -59,3 +59,12 @@
 #else
 # define __GLIBC_USE_IEC_60559_FUNCS_EXT 0
 #endif
+
+/* ISO/IEC TS 18661-3:2014 defines the
+   __STDC_WANT_IEC_60559_TYPES_EXT__ macro.  */
+#undef __GLIBC_USE_IEC_60559_TYPES_EXT
+#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_TYPES_EXT__
+# define __GLIBC_USE_IEC_60559_TYPES_EXT 1
+#else
+# define __GLIBC_USE_IEC_60559_TYPES_EXT 0
+#endif
-- 
2.4.11

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v2 4/8] float128: Add public _Float128 declarations to libm.
  2017-04-28 21:35 [PATCH v2 0/8] Add float128 functions and declarations to libm Gabriel F. T. Gomes
                   ` (4 preceding siblings ...)
  2017-04-28 21:36 ` [PATCH v2 1/8] ldbl-128: Use mathx_hidden_def inplace of hidden_def Gabriel F. T. Gomes
@ 2017-04-28 21:36 ` Gabriel F. T. Gomes
  2017-04-28 22:49   ` Joseph Myers
  2017-04-28 21:36 ` [PATCH v2 3/8] Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__ Gabriel F. T. Gomes
  2017-04-28 21:36 ` [PATCH v2 8/8] float128: Add wrappers to override ldbl-128 as float128 Gabriel F. T. Gomes
  7 siblings, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-04-28 21:36 UTC (permalink / raw)
  To: libc-alpha

From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>

This introduces the machine-dependent bits/floatn.h to control
the inclusion of _Float128 ABI.

	* bits/floatn.h: New file.
	* bits/floatn-compat.h: Likewise.
	* math/Makefile (headers): Install bits/floatn.h,
	bits/floatn-compat.h and bits/huge_val_flt128.h.

	* math/bits/cmathcalls.h (_Mdouble_complex_): Only define if not
	defined.

	* math/mathcalls.h (drem): Only define if __FLOATN_TYPE
	not defined.
	(gamma): Likewise.
	(nexttoward): Likewise.
	(significand): Likewise.
	(pow10): Likewise.
	(scalb): Likewise.
	(finite): Likewise.
	(isinf): Likewise.
	(isnan): Likewise.

	* math/complex.h: Include bits/cmathcalls.h to get the declarations
	of float128 versions of complex functions.
	(CMPLXF128): Define when __USE_FLOAT128 is set, which implies that
	IEC_60559_TYPES_EXT is also set.

	* math/math.h: Define and undefine __FLOATN_TYPE as
	needed for _FloatN types. Add prototypes for _Float128
	if __USE_FLOAT128.

	[__USE_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.

	[__USE_FLOAT128] (__f128): New macro to apply proper _Float128
	literal suffix depending on compiler version for __USE_GNU
	enabled constants.
	[__USE_FLOAT128] (M_Ef128): New _GNU_SOURCE enabled macro.
	[__USE_FLOAT128] (M_LOG2Ef128): Likewise.
	[__USE_FLOAT128] (M_LOG10Ef128): Likewise.
	[__USE_FLOAT128] (M_LN2f128): Likewise.
	[__USE_FLOAT128] (M_LN10f128): Likewise.
	[__USE_FLOAT128] (M_PIf128): Likewise.
	[__USE_FLOAT128] (M_PI_2f128): Likewise.
	[__USE_FLOAT128] (M_PI_4f128): Likewise.
	[__USE_FLOAT128] (M_1_PIf128): Likewise.
	[__USE_FLOAT128] (M_2_PIf128): Likewise.
	[__USE_FLOAT128] (M_SQRT2f128): Likewise.
	[__USE_FLOAT128] (M_SQRT1_2f128): Likewise.

	* sysdeps/powerpc/powerpc64/bits/floatn-compat.h: New file to
	localize workarounds for old compilers.

fixup! float128: Add public _Float128 declarations to libm.
---
 bits/floatn-compat.h                             | 20 ++++++++
 bits/floatn.h                                    | 30 ++++++++++++
 bits/huge_val_flt128.h                           | 25 ++++++++++
 math/Makefile                                    |  3 +-
 math/bits/cmathcalls.h                           |  4 +-
 math/bits/mathcalls.h                            | 30 ++++++++----
 math/complex.h                                   | 27 ++++++++++-
 math/math.h                                      | 60 +++++++++++++++++++++++-
 sysdeps/powerpc/powerpc64le/bits/floatn-compat.h | 58 +++++++++++++++++++++++
 9 files changed, 243 insertions(+), 14 deletions(-)
 create mode 100644 bits/floatn-compat.h
 create mode 100644 bits/floatn.h
 create mode 100644 bits/huge_val_flt128.h
 create mode 100644 sysdeps/powerpc/powerpc64le/bits/floatn-compat.h

diff --git a/bits/floatn-compat.h b/bits/floatn-compat.h
new file mode 100644
index 0000000..2fc7d35
--- /dev/null
+++ b/bits/floatn-compat.h
@@ -0,0 +1,20 @@
+/* Define _FloatN macros for ISO/IEC TS-18661-3 support, when needed.
+   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/>.  */
+
+/* Nothing to be done, here.  Each platform that provides _FloatN support
+   defines the required macros in sysdeps.  */
diff --git a/bits/floatn.h b/bits/floatn.h
new file mode 100644
index 0000000..abc39cb
--- /dev/null
+++ b/bits/floatn.h
@@ -0,0 +1,30 @@
+/* Macros to control TS 18661-3 glibc features.
+   Copyright (C) 2016 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 if the current compiler invocation supports _Float128 or
+   __float128 as an additional floating-point type.  */
+#define __HAVE_FLOAT128 0
+
+/* Defined if support for _Float128 is present.  This implies
+   support for ISO/IEC TS-18661-3, meaning that architectures that
+   define this macro use __GLIBC_USE (IEC_60559_TYPES_EXT).  */
+#define __USE_FLOAT128 0
+
+/* Defined for GCC versions which support the __float128 type, but not
+   _Complex __float128.  This resolves to a complex binary128 type.  */
+#undef __CFLOAT128
diff --git a/bits/huge_val_flt128.h b/bits/huge_val_flt128.h
new file mode 100644
index 0000000..d08da7e
--- /dev/null
+++ b/bits/huge_val_flt128.h
@@ -0,0 +1,25 @@
+/* Default `HUGE_VAL_F128' constant.
+   Copyright (C) 2016 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
+
+#ifdef __USE_FLOAT128
+# define HUGE_VAL_F128 (__builtin_huge_valf128 ())
+#endif
diff --git a/math/Makefile b/math/Makefile
index 634c619..621050a 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/floatn-compat.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..078c08c 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.  */
+# ifndef __FLOATN_TYPE
 __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.  */ \
+      && !defined __FLOATN_TYPE
 /* 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
 
+# ifndef __FLOATN_TYPE
 /* 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.  */ \
+      && !defined __FLOATN_TYPE
 /* 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)
+# ifndef __FLOATN_TYPE
 /* Obsolete alias for `lgamma'.  */
 __MATHCALL (gamma,, (_Mdouble_));
+# endif
 #endif
 
 #ifdef __USE_MISC
@@ -254,7 +263,7 @@ __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 && !defined __FLOATN_TYPE
 __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__));
 # endif
 
@@ -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))  \
+     && !defined __FLOATN_TYPE
 /* 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..36b6689 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 __USE_FLOAT128
+# 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,23 @@ __BEGIN_DECLS
 #undef	_Mdouble_
 #undef	__MATH_PRECNAME
 
+#if __USE_FLOAT128
+# 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..f154d45 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 __USE_FLOAT128
+# include <bits/huge_val_flt128.h>
+#endif
+
 #ifdef __USE_ISOC99
 # include <bits/huge_valf.h>
 # include <bits/huge_vall.h>
@@ -206,6 +214,7 @@ enum
   extern type __MATH_PRECNAME(function,suffix) args __THROW
 
 #define _Mdouble_		double
+#undef __FLOATN_TYPE
 #define __MATH_PRECNAME(name,r)	__CONCAT(name,r)
 #define __MATH_DECLARING_DOUBLE  1
 #include <bits/mathcalls-helper-functions.h>
@@ -223,6 +232,7 @@ enum
 # ifndef _Mfloat_
 #  define _Mfloat_		float
 # endif
+# undef __FLOATN_TYPE
 # define _Mdouble_		_Mfloat_
 # define __MATH_PRECNAME(name,r) name##f##r
 # define __MATH_DECLARING_DOUBLE  0
@@ -266,6 +276,7 @@ extern long double __REDIRECT_NTH (nexttowardl,
 #  ifndef _Mlong_double_
 #   define _Mlong_double_	long double
 #  endif
+#  undef __FLOATN_TYPE
 #  define _Mdouble_		_Mlong_double_
 #  define __MATH_PRECNAME(name,r) name##l##r
 #  define __MATH_DECLARING_DOUBLE  0
@@ -279,6 +290,28 @@ extern long double __REDIRECT_NTH (nexttowardl,
 # 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_FLOAT128
+# ifndef _Mfloat128_
+#  define _Mfloat128_		_Float128
+# endif
+# define __FLOATN_TYPE		1
+# define _Mdouble_		_Mfloat128_
+# define __MATH_PRECNAME(name,r) name##f128##r
+# define __MATH_DECLARING_DOUBLE  0
+# include <bits/mathcalls-helper-functions.h>
+# if __USE_FLOAT128
+#  include <bits/mathcalls.h>
+# endif
+# undef __FLOATN_TYPE
+# undef _Mdouble_
+# undef __MATH_PRECNAME
+# undef __MATH_DECLARING_DOUBLE
+#endif /* __HAVE_FLOAT128.  */
+
 #undef	__MATHDECL_1
 #undef	__MATHDECL
 #undef	__MATHCALL
@@ -377,7 +410,12 @@ enum
 # endif
 
 /* Return nonzero value if X is positive or negative infinity.  */
-# if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__
+# if __USE_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 +567,26 @@ extern int matherr (struct exception *__exc);
 # define M_SQRT1_2l	0.707106781186547524400844362104849039L /* 1/sqrt(2) */
 #endif
 
+#if __USE_FLOAT128 && __USE_GNU
+# if defined __GNUC__ && !__GNUC_PREREQ (7,0)
+#  define __f128(x) x ## q
+# else
+#  define __f128(x) x ## f128
+# endif
+# 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
diff --git a/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h b/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h
new file mode 100644
index 0000000..5ecadec
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h
@@ -0,0 +1,58 @@
+/* Define _FloatN macros for ISO/IEC TS-18661-3 support for powerpc64le.
+   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/>.  */
+
+/* Define macros to support _Float128 on old compilers.  */
+#if __USE_FLOAT128
+
+/* The type _Float128, as well as the literal suffix (F128), exist for powerpc
+   only since GCC 7.0.  */
+# if !__GNUC_PREREQ (7, 0)
+#  define L(x) x##Q
+typedef __float128 _Float128;
+# else
+#  define L(x) x##F128
+# endif
+
+/* Add a typedef for older GCC compilers which don't natively support
+   _Complex _Float128.  */
+# if __GNUC_PREREQ (6, 2) && !__GNUC_PREREQ (7, 0) && !defined __CFLOAT128
+typedef _Complex float __cfloat128 __attribute__ ((mode (KC)));
+#  define __CFLOAT128 __cfloat128
+# endif
+
+/* Builtin __builtin_huge_val is only type-generic since GCC 7.0.  */
+# if !__GNUC_PREREQ (7, 0)
+#  define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ())
+# endif
+
+/* The following builtins (suffixed with 'q') are available in GCC >= 6.2,
+   which is the minimum version required for float128 support on powerpc64le.
+   Since GCC 7.0 the builtins suffixed with f128 are also available, then
+   there is no need to redefined them.  */
+# if !__GNUC_PREREQ (7, 0)
+#  define __builtin_copysignf128 __builtin_copysignq
+#  define __builtin_fabsf128 __builtin_fabsq
+#  define __builtin_inff128 __builtin_infq
+#  define __builtin_nanf128 __builtin_nanq
+# endif
+
+/* __builtin_signbit is type generic in GCC 6.2, which is the minimum
+   version required for float128 support on powerpc64le.  */
+# define __builtin_signbitf128 __builtin_signbit
+
+#endif
-- 
2.4.11

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v2 6/8] float128: Add private _Float128 declarations for libm.
  2017-04-28 21:35 [PATCH v2 0/8] Add float128 functions and declarations to libm Gabriel F. T. Gomes
                   ` (2 preceding siblings ...)
  2017-04-28 21:35 ` [PATCH v2 5/8] float128: Include math-finite.h for _Float128 Gabriel F. T. Gomes
@ 2017-04-28 21:36 ` Gabriel F. T. Gomes
  2017-05-03 11:39   ` Joseph Myers
  2017-04-28 21:36 ` [PATCH v2 1/8] ldbl-128: Use mathx_hidden_def inplace of hidden_def Gabriel F. T. Gomes
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-04-28 21:36 UTC (permalink / raw)
  To: libc-alpha

From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>

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.

	* 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.

	* 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 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.
	(signbitf128): Likewise.
	(__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.
---
 bits/libm-simd-decl-stubs.h                   |  6 +++
 include/complex.h                             |  7 ++++
 include/float.h                               | 31 +++++++++++++++
 include/math.h                                | 13 +++++++
 sysdeps/generic/fix-fp-int-convert-overflow.h |  2 +
 sysdeps/generic/math-type-macros-float128.h   | 43 ++++++++++++++++++++
 sysdeps/generic/math_private.h                | 56 ++++++++++++++++++++++++++-
 sysdeps/generic/math_private_calls.h          |  4 +-
 sysdeps/ieee754/ldbl-opt/s_sin.c              |  1 +
 9 files changed, 160 insertions(+), 3 deletions(-)
 create mode 100644 include/float.h
 create mode 100644 sysdeps/generic/math-type-macros-float128.h

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/include/complex.h b/include/complex.h
index 082e71f..8eec3a0 100644
--- a/include/complex.h
+++ b/include/complex.h
@@ -8,6 +8,13 @@
 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 __USE_FLOAT128
+#   ifdef __CFLOAT128
+extern __CFLOAT128 __kernel_casinhf128 (__CFLOAT128 z, int adj);
+#   else
+extern _Complex _Float128 __kernel_casinhf128 (_Complex _Float128 z, int adj);
+#   endif
+#  endif
 # endif
 
 #endif
diff --git a/include/float.h b/include/float.h
new file mode 100644
index 0000000..f792158
--- /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) && __USE_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 a4f5562..a61d6f7 100644
--- a/include/math.h
+++ b/include/math.h
@@ -21,6 +21,12 @@ hidden_proto (__finitel)
 hidden_proto (__isinfl)
 hidden_proto (__isnanl)
 #  endif
+
+#  if __USE_FLOAT128
+hidden_proto (__finitef128)
+hidden_proto (__isinff128)
+hidden_proto (__isnanf128)
+#  endif
 # endif
 
 libm_hidden_proto (__fpclassify)
@@ -38,5 +44,12 @@ libm_hidden_proto (__expl)
 libm_hidden_proto (__expm1l)
 # endif
 
+# if __USE_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/math-type-macros-float128.h b/sysdeps/generic/math-type-macros-float128.h
new file mode 100644
index 0000000..4cd23a0
--- /dev/null
+++ b/sysdeps/generic/math-type-macros-float128.h
@@ -0,0 +1,43 @@
+/* Helper macros for _Float128 variants of type generic functions of libm.
+   Copyright (C) 2016 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_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
+
+#ifdef __CFLOAT128
+# define CFLOAT __CFLOAT128
+#else
+# define CFLOAT _Complex _Float128
+#endif
+
+#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..96ed252 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,46 @@ do {								\
 #undef _MSUF_
 #undef _Mdouble_
 
+#if __USE_FLOAT128
+# define _Mdouble_ _Float128
+# define _MSUF_ f128
+# define __MATH_DECLARING_FLOAT128
+# include <math_private_calls.h>
+# undef __MATH_DECLARING_FLOAT128
+# undef _MSUF_
+# undef _Mdouble_
+#endif
+
+#if __USE_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);
+}
+extern inline _Float128
+signbitf128 (_Float128 x)
+{
+  return __builtin_signbit (x);
+}
+#endif
+
+
+
 /* fdlibm kernel function */
 extern double __kernel_standard (double,double,int);
 extern float __kernel_standard_f (float,float,int);
@@ -263,13 +306,24 @@ extern void __docos (double __x, double __dx, double __v[]);
    })
 #endif
 
+#if __USE_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..eaff86a 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_FLOAT128
 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_FLOAT128
 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
-- 
2.4.11

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v2 8/8] float128: Add wrappers to override ldbl-128 as float128.
  2017-04-28 21:35 [PATCH v2 0/8] Add float128 functions and declarations to libm Gabriel F. T. Gomes
                   ` (6 preceding siblings ...)
  2017-04-28 21:36 ` [PATCH v2 3/8] Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__ Gabriel F. T. Gomes
@ 2017-04-28 21:36 ` Gabriel F. T. Gomes
  2017-05-02 21:51   ` Joseph Myers
  7 siblings, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-04-28 21:36 UTC (permalink / raw)
  To: libc-alpha

From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>

This change defines float128_private.h which contains
macros used to override long double naming conventions
when building a ldbl file.

	* sysdeps/ieee754/float128/e_acosf128.c: New file.
	* sysdeps/ieee754/float128/e_acoshf128.c: New file.
	* sysdeps/ieee754/float128/e_asinf128.c: New file.
	* sysdeps/ieee754/float128/e_atan2f128.c: New file.
	* sysdeps/ieee754/float128/e_atanhf128.c: New file.
	* sysdeps/ieee754/float128/e_coshf128.c: New file.
	* sysdeps/ieee754/float128/e_exp10f128.c: New file.
	* sysdeps/ieee754/float128/e_expf128.c: New file.
	* sysdeps/ieee754/float128/e_fmodf128.c: New file.
	* sysdeps/ieee754/float128/e_gammaf128_r.c: New file.
	* sysdeps/ieee754/float128/e_hypotf128.c: New file.
	* sysdeps/ieee754/float128/e_ilogbf128.c: New file.
	* sysdeps/ieee754/float128/e_j0f128.c: New file.
	* sysdeps/ieee754/float128/e_j1f128.c: New file.
	* sysdeps/ieee754/float128/e_jnf128.c: New file.
	* sysdeps/ieee754/float128/e_lgammaf128.c: New file.
	* sysdeps/ieee754/float128/e_lgammaf128_r.c: New file.
	* sysdeps/ieee754/float128/e_log10f128.c: New file.
	* sysdeps/ieee754/float128/e_log2f128.c: New file.
	* sysdeps/ieee754/float128/e_logf128.c: New file.
	* sysdeps/ieee754/float128/e_powf128.c: New file.
	* sysdeps/ieee754/float128/e_rem_pio2f128.c: New file.
	* sysdeps/ieee754/float128/e_remainderf128.c: New file.
	* sysdeps/ieee754/float128/e_scalbf128.c: New file.
	* sysdeps/ieee754/float128/e_sinhf128.c: New file.
	* sysdeps/ieee754/float128/e_sqrtf128.c: New file.
	* sysdeps/ieee754/float128/float128_private.h: New file.
	* sysdeps/ieee754/float128/gamma_productf128.c: New file.
	* sysdeps/ieee754/float128/ieee754_float128.h: New file.
	* sysdeps/ieee754/float128/k_cosf128.c: New file.
	* sysdeps/ieee754/float128/k_rem_pio2f128.c: New file.
	* sysdeps/ieee754/float128/k_sincosf128.c: New file.
	* sysdeps/ieee754/float128/k_sinf128.c: New file.
	* sysdeps/ieee754/float128/k_tanf128.c: New file.
	* sysdeps/ieee754/float128/lgamma_negf128.c: New file.
	* sysdeps/ieee754/float128/lgamma_productf128.c: New file.
	* sysdeps/ieee754/float128/s_asinhf128.c: New file.
	* sysdeps/ieee754/float128/s_atanf128.c: New file.
	* sysdeps/ieee754/float128/s_cbrtf128.c: New file.
	* sysdeps/ieee754/float128/s_ceilf128.c: New file.
	* sysdeps/ieee754/float128/s_copysignf128.c: New file.
	* sysdeps/ieee754/float128/s_cosf128.c: New file.
	* sysdeps/ieee754/float128/s_erff128.c: New file.
	* sysdeps/ieee754/float128/s_expm1f128.c: New file.
	* sysdeps/ieee754/float128/s_fabsf128.c: New file.
	* sysdeps/ieee754/float128/s_finitef128.c: New file.
	* sysdeps/ieee754/float128/s_floorf128.c: New file.
	* sysdeps/ieee754/float128/s_fmaf128.c: New file.
	* sysdeps/ieee754/float128/s_fpclassifyf128.c: New file.
	* sysdeps/ieee754/float128/s_frexpf128.c: New file.
	* sysdeps/ieee754/float128/s_isinff128.c: New file.
	* sysdeps/ieee754/float128/s_isnanf128.c: New file.
	* sysdeps/ieee754/float128/s_issignalingf128.c: New file.
	* sysdeps/ieee754/float128/s_llrintf128.c: New file.
	* sysdeps/ieee754/float128/s_llroundf128.c: New file.
	* sysdeps/ieee754/float128/s_log1pf128.c: New file.
	* sysdeps/ieee754/float128/s_logbf128.c: New file.
	* sysdeps/ieee754/float128/s_lrintf128.c: New file.
	* sysdeps/ieee754/float128/s_lroundf128.c: New file.
	* sysdeps/ieee754/float128/s_modff128.c: New file.
	* sysdeps/ieee754/float128/s_nearbyintf128.c: New file.
	* sysdeps/ieee754/float128/s_nextafterf128.c: New file.
	* sysdeps/ieee754/float128/s_nexttowardf128.c: New file.
	* sysdeps/ieee754/float128/s_nextupf128.c: New file.
	* sysdeps/ieee754/float128/s_remquof128.c: New file.
	* sysdeps/ieee754/float128/s_rintf128.c: New file.
	* sysdeps/ieee754/float128/s_roundf128.c: New file.
	* sysdeps/ieee754/float128/s_scalblnf128.c: New file.
	* sysdeps/ieee754/float128/s_scalbnf128.c: New file.
	* sysdeps/ieee754/float128/s_signbitf128.c: New file.
	* sysdeps/ieee754/float128/s_significandf128.c: New file.
	* sysdeps/ieee754/float128/s_sincosf128.c: New file.
	* sysdeps/ieee754/float128/s_sinf128.c: New file.
	* sysdeps/ieee754/float128/s_tanf128.c: New file.
	* sysdeps/ieee754/float128/s_tanhf128.c: New file.
	* sysdeps/ieee754/float128/s_truncf128.c: New file.
	* sysdeps/ieee754/float128/t_sincosf128.c: New file.
	* sysdeps/ieee754/float128/x2y2m1f128.c: New file.
---
 sysdeps/ieee754/float128/e_acosf128.c          |   2 +
 sysdeps/ieee754/float128/e_acoshf128.c         |   2 +
 sysdeps/ieee754/float128/e_asinf128.c          |   2 +
 sysdeps/ieee754/float128/e_atan2f128.c         |   2 +
 sysdeps/ieee754/float128/e_atanhf128.c         |   2 +
 sysdeps/ieee754/float128/e_coshf128.c          |   2 +
 sysdeps/ieee754/float128/e_exp10f128.c         |   2 +
 sysdeps/ieee754/float128/e_expf128.c           |   2 +
 sysdeps/ieee754/float128/e_fmodf128.c          |   2 +
 sysdeps/ieee754/float128/e_gammaf128_r.c       |   2 +
 sysdeps/ieee754/float128/e_hypotf128.c         |   2 +
 sysdeps/ieee754/float128/e_ilogbf128.c         |   2 +
 sysdeps/ieee754/float128/e_j0f128.c            |   2 +
 sysdeps/ieee754/float128/e_j1f128.c            |   2 +
 sysdeps/ieee754/float128/e_jnf128.c            |   2 +
 sysdeps/ieee754/float128/e_lgammaf128.c        |   1 +
 sysdeps/ieee754/float128/e_lgammaf128_r.c      |   2 +
 sysdeps/ieee754/float128/e_log10f128.c         |   2 +
 sysdeps/ieee754/float128/e_log2f128.c          |   2 +
 sysdeps/ieee754/float128/e_logf128.c           |   2 +
 sysdeps/ieee754/float128/e_powf128.c           |   2 +
 sysdeps/ieee754/float128/e_rem_pio2f128.c      |   2 +
 sysdeps/ieee754/float128/e_remainderf128.c     |   2 +
 sysdeps/ieee754/float128/e_scalbf128.c         |   1 +
 sysdeps/ieee754/float128/e_sinhf128.c          |   2 +
 sysdeps/ieee754/float128/e_sqrtf128.c          |   2 +
 sysdeps/ieee754/float128/float128_private.h    | 330 +++++++++++++++++++++++++
 sysdeps/ieee754/float128/gamma_productf128.c   |   2 +
 sysdeps/ieee754/float128/ieee754_float128.h    | 140 +++++++++++
 sysdeps/ieee754/float128/k_cosf128.c           |   2 +
 sysdeps/ieee754/float128/k_rem_pio2f128.c      |   2 +
 sysdeps/ieee754/float128/k_sincosf128.c        |   2 +
 sysdeps/ieee754/float128/k_sinf128.c           |   2 +
 sysdeps/ieee754/float128/k_tanf128.c           |   2 +
 sysdeps/ieee754/float128/lgamma_negf128.c      |   2 +
 sysdeps/ieee754/float128/lgamma_productf128.c  |   2 +
 sysdeps/ieee754/float128/s_asinhf128.c         |   2 +
 sysdeps/ieee754/float128/s_atanf128.c          |   2 +
 sysdeps/ieee754/float128/s_cbrtf128.c          |   2 +
 sysdeps/ieee754/float128/s_ceilf128.c          |   2 +
 sysdeps/ieee754/float128/s_copysignf128.c      |   2 +
 sysdeps/ieee754/float128/s_cosf128.c           |   2 +
 sysdeps/ieee754/float128/s_erff128.c           |   2 +
 sysdeps/ieee754/float128/s_expm1f128.c         |   2 +
 sysdeps/ieee754/float128/s_fabsf128.c          |   2 +
 sysdeps/ieee754/float128/s_finitef128.c        |   2 +
 sysdeps/ieee754/float128/s_floorf128.c         |   2 +
 sysdeps/ieee754/float128/s_fmaf128.c           |   2 +
 sysdeps/ieee754/float128/s_fpclassifyf128.c    |   2 +
 sysdeps/ieee754/float128/s_frexpf128.c         |   2 +
 sysdeps/ieee754/float128/s_fromfpf128.c        |   5 +
 sysdeps/ieee754/float128/s_fromfpxf128.c       |   5 +
 sysdeps/ieee754/float128/s_getpayloadf128.c    |   2 +
 sysdeps/ieee754/float128/s_isinff128.c         |   2 +
 sysdeps/ieee754/float128/s_isnanf128.c         |   2 +
 sysdeps/ieee754/float128/s_issignalingf128.c   |   2 +
 sysdeps/ieee754/float128/s_llrintf128.c        |   2 +
 sysdeps/ieee754/float128/s_llroundf128.c       |   2 +
 sysdeps/ieee754/float128/s_log1pf128.c         |   2 +
 sysdeps/ieee754/float128/s_logbf128.c          |   2 +
 sysdeps/ieee754/float128/s_lrintf128.c         |   2 +
 sysdeps/ieee754/float128/s_lroundf128.c        |   2 +
 sysdeps/ieee754/float128/s_modff128.c          |   2 +
 sysdeps/ieee754/float128/s_nearbyintf128.c     |   2 +
 sysdeps/ieee754/float128/s_nextafterf128.c     |   2 +
 sysdeps/ieee754/float128/s_nexttowardf128.c    |   1 +
 sysdeps/ieee754/float128/s_nextupf128.c        |   2 +
 sysdeps/ieee754/float128/s_remquof128.c        |   2 +
 sysdeps/ieee754/float128/s_rintf128.c          |   2 +
 sysdeps/ieee754/float128/s_roundf128.c         |   2 +
 sysdeps/ieee754/float128/s_scalblnf128.c       |   2 +
 sysdeps/ieee754/float128/s_scalbnf128.c        |   2 +
 sysdeps/ieee754/float128/s_setpayloadf128.c    |   4 +
 sysdeps/ieee754/float128/s_setpayloadsigf128.c |   4 +
 sysdeps/ieee754/float128/s_signbitf128.c       |   2 +
 sysdeps/ieee754/float128/s_significandf128.c   |   1 +
 sysdeps/ieee754/float128/s_sincosf128.c        |   2 +
 sysdeps/ieee754/float128/s_sinf128.c           |   2 +
 sysdeps/ieee754/float128/s_tanf128.c           |   2 +
 sysdeps/ieee754/float128/s_tanhf128.c          |   2 +
 sysdeps/ieee754/float128/s_totalorderf128.c    |   2 +
 sysdeps/ieee754/float128/s_totalordermagf128.c |   2 +
 sysdeps/ieee754/float128/s_truncf128.c         |   2 +
 sysdeps/ieee754/float128/s_ufromfpf128.c       |   5 +
 sysdeps/ieee754/float128/s_ufromfpxf128.c      |   5 +
 sysdeps/ieee754/float128/t_sincosf128.c        |   2 +
 sysdeps/ieee754/float128/w_llogbf128.c         |   3 +
 sysdeps/ieee754/float128/x2y2m1f128.c          |   2 +
 88 files changed, 655 insertions(+)
 create mode 100644 sysdeps/ieee754/float128/e_acosf128.c
 create mode 100644 sysdeps/ieee754/float128/e_acoshf128.c
 create mode 100644 sysdeps/ieee754/float128/e_asinf128.c
 create mode 100644 sysdeps/ieee754/float128/e_atan2f128.c
 create mode 100644 sysdeps/ieee754/float128/e_atanhf128.c
 create mode 100644 sysdeps/ieee754/float128/e_coshf128.c
 create mode 100644 sysdeps/ieee754/float128/e_exp10f128.c
 create mode 100644 sysdeps/ieee754/float128/e_expf128.c
 create mode 100644 sysdeps/ieee754/float128/e_fmodf128.c
 create mode 100644 sysdeps/ieee754/float128/e_gammaf128_r.c
 create mode 100644 sysdeps/ieee754/float128/e_hypotf128.c
 create mode 100644 sysdeps/ieee754/float128/e_ilogbf128.c
 create mode 100644 sysdeps/ieee754/float128/e_j0f128.c
 create mode 100644 sysdeps/ieee754/float128/e_j1f128.c
 create mode 100644 sysdeps/ieee754/float128/e_jnf128.c
 create mode 100644 sysdeps/ieee754/float128/e_lgammaf128.c
 create mode 100644 sysdeps/ieee754/float128/e_lgammaf128_r.c
 create mode 100644 sysdeps/ieee754/float128/e_log10f128.c
 create mode 100644 sysdeps/ieee754/float128/e_log2f128.c
 create mode 100644 sysdeps/ieee754/float128/e_logf128.c
 create mode 100644 sysdeps/ieee754/float128/e_powf128.c
 create mode 100644 sysdeps/ieee754/float128/e_rem_pio2f128.c
 create mode 100644 sysdeps/ieee754/float128/e_remainderf128.c
 create mode 100644 sysdeps/ieee754/float128/e_scalbf128.c
 create mode 100644 sysdeps/ieee754/float128/e_sinhf128.c
 create mode 100644 sysdeps/ieee754/float128/e_sqrtf128.c
 create mode 100644 sysdeps/ieee754/float128/float128_private.h
 create mode 100644 sysdeps/ieee754/float128/gamma_productf128.c
 create mode 100644 sysdeps/ieee754/float128/ieee754_float128.h
 create mode 100644 sysdeps/ieee754/float128/k_cosf128.c
 create mode 100644 sysdeps/ieee754/float128/k_rem_pio2f128.c
 create mode 100644 sysdeps/ieee754/float128/k_sincosf128.c
 create mode 100644 sysdeps/ieee754/float128/k_sinf128.c
 create mode 100644 sysdeps/ieee754/float128/k_tanf128.c
 create mode 100644 sysdeps/ieee754/float128/lgamma_negf128.c
 create mode 100644 sysdeps/ieee754/float128/lgamma_productf128.c
 create mode 100644 sysdeps/ieee754/float128/s_asinhf128.c
 create mode 100644 sysdeps/ieee754/float128/s_atanf128.c
 create mode 100644 sysdeps/ieee754/float128/s_cbrtf128.c
 create mode 100644 sysdeps/ieee754/float128/s_ceilf128.c
 create mode 100644 sysdeps/ieee754/float128/s_copysignf128.c
 create mode 100644 sysdeps/ieee754/float128/s_cosf128.c
 create mode 100644 sysdeps/ieee754/float128/s_erff128.c
 create mode 100644 sysdeps/ieee754/float128/s_expm1f128.c
 create mode 100644 sysdeps/ieee754/float128/s_fabsf128.c
 create mode 100644 sysdeps/ieee754/float128/s_finitef128.c
 create mode 100644 sysdeps/ieee754/float128/s_floorf128.c
 create mode 100644 sysdeps/ieee754/float128/s_fmaf128.c
 create mode 100644 sysdeps/ieee754/float128/s_fpclassifyf128.c
 create mode 100644 sysdeps/ieee754/float128/s_frexpf128.c
 create mode 100644 sysdeps/ieee754/float128/s_fromfpf128.c
 create mode 100644 sysdeps/ieee754/float128/s_fromfpxf128.c
 create mode 100644 sysdeps/ieee754/float128/s_getpayloadf128.c
 create mode 100644 sysdeps/ieee754/float128/s_isinff128.c
 create mode 100644 sysdeps/ieee754/float128/s_isnanf128.c
 create mode 100644 sysdeps/ieee754/float128/s_issignalingf128.c
 create mode 100644 sysdeps/ieee754/float128/s_llrintf128.c
 create mode 100644 sysdeps/ieee754/float128/s_llroundf128.c
 create mode 100644 sysdeps/ieee754/float128/s_log1pf128.c
 create mode 100644 sysdeps/ieee754/float128/s_logbf128.c
 create mode 100644 sysdeps/ieee754/float128/s_lrintf128.c
 create mode 100644 sysdeps/ieee754/float128/s_lroundf128.c
 create mode 100644 sysdeps/ieee754/float128/s_modff128.c
 create mode 100644 sysdeps/ieee754/float128/s_nearbyintf128.c
 create mode 100644 sysdeps/ieee754/float128/s_nextafterf128.c
 create mode 100644 sysdeps/ieee754/float128/s_nexttowardf128.c
 create mode 100644 sysdeps/ieee754/float128/s_nextupf128.c
 create mode 100644 sysdeps/ieee754/float128/s_remquof128.c
 create mode 100644 sysdeps/ieee754/float128/s_rintf128.c
 create mode 100644 sysdeps/ieee754/float128/s_roundf128.c
 create mode 100644 sysdeps/ieee754/float128/s_scalblnf128.c
 create mode 100644 sysdeps/ieee754/float128/s_scalbnf128.c
 create mode 100644 sysdeps/ieee754/float128/s_setpayloadf128.c
 create mode 100644 sysdeps/ieee754/float128/s_setpayloadsigf128.c
 create mode 100644 sysdeps/ieee754/float128/s_signbitf128.c
 create mode 100644 sysdeps/ieee754/float128/s_significandf128.c
 create mode 100644 sysdeps/ieee754/float128/s_sincosf128.c
 create mode 100644 sysdeps/ieee754/float128/s_sinf128.c
 create mode 100644 sysdeps/ieee754/float128/s_tanf128.c
 create mode 100644 sysdeps/ieee754/float128/s_tanhf128.c
 create mode 100644 sysdeps/ieee754/float128/s_totalorderf128.c
 create mode 100644 sysdeps/ieee754/float128/s_totalordermagf128.c
 create mode 100644 sysdeps/ieee754/float128/s_truncf128.c
 create mode 100644 sysdeps/ieee754/float128/s_ufromfpf128.c
 create mode 100644 sysdeps/ieee754/float128/s_ufromfpxf128.c
 create mode 100644 sysdeps/ieee754/float128/t_sincosf128.c
 create mode 100644 sysdeps/ieee754/float128/w_llogbf128.c
 create mode 100644 sysdeps/ieee754/float128/x2y2m1f128.c

diff --git a/sysdeps/ieee754/float128/e_acosf128.c b/sysdeps/ieee754/float128/e_acosf128.c
new file mode 100644
index 0000000..7ddf7dc
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_acosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_acosl.c"
diff --git a/sysdeps/ieee754/float128/e_acoshf128.c b/sysdeps/ieee754/float128/e_acoshf128.c
new file mode 100644
index 0000000..f6dd40c
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_acoshf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_acoshl.c"
diff --git a/sysdeps/ieee754/float128/e_asinf128.c b/sysdeps/ieee754/float128/e_asinf128.c
new file mode 100644
index 0000000..133ab8d
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_asinf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_asinl.c"
diff --git a/sysdeps/ieee754/float128/e_atan2f128.c b/sysdeps/ieee754/float128/e_atan2f128.c
new file mode 100644
index 0000000..9aa740f
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_atan2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_atan2l.c"
diff --git a/sysdeps/ieee754/float128/e_atanhf128.c b/sysdeps/ieee754/float128/e_atanhf128.c
new file mode 100644
index 0000000..f26c8d5
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_atanhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_atanhl.c"
diff --git a/sysdeps/ieee754/float128/e_coshf128.c b/sysdeps/ieee754/float128/e_coshf128.c
new file mode 100644
index 0000000..2abf067
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_coshf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_coshl.c"
diff --git a/sysdeps/ieee754/float128/e_exp10f128.c b/sysdeps/ieee754/float128/e_exp10f128.c
new file mode 100644
index 0000000..b3468d2
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_exp10f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_exp10l.c"
diff --git a/sysdeps/ieee754/float128/e_expf128.c b/sysdeps/ieee754/float128/e_expf128.c
new file mode 100644
index 0000000..b727b17
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_expf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_expl.c"
diff --git a/sysdeps/ieee754/float128/e_fmodf128.c b/sysdeps/ieee754/float128/e_fmodf128.c
new file mode 100644
index 0000000..ed8a749
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_fmodf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_fmodl.c"
diff --git a/sysdeps/ieee754/float128/e_gammaf128_r.c b/sysdeps/ieee754/float128/e_gammaf128_r.c
new file mode 100644
index 0000000..895ac63
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_gammaf128_r.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_gammal_r.c"
diff --git a/sysdeps/ieee754/float128/e_hypotf128.c b/sysdeps/ieee754/float128/e_hypotf128.c
new file mode 100644
index 0000000..1f06555
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_hypotf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_hypotl.c"
diff --git a/sysdeps/ieee754/float128/e_ilogbf128.c b/sysdeps/ieee754/float128/e_ilogbf128.c
new file mode 100644
index 0000000..2861801
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_ilogbf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_ilogbl.c"
diff --git a/sysdeps/ieee754/float128/e_j0f128.c b/sysdeps/ieee754/float128/e_j0f128.c
new file mode 100644
index 0000000..b624b5c
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_j0f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_j0l.c"
diff --git a/sysdeps/ieee754/float128/e_j1f128.c b/sysdeps/ieee754/float128/e_j1f128.c
new file mode 100644
index 0000000..445428e
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_j1f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_j1l.c"
diff --git a/sysdeps/ieee754/float128/e_jnf128.c b/sysdeps/ieee754/float128/e_jnf128.c
new file mode 100644
index 0000000..7854e11
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_jnf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_jnl.c"
diff --git a/sysdeps/ieee754/float128/e_lgammaf128.c b/sysdeps/ieee754/float128/e_lgammaf128.c
new file mode 100644
index 0000000..72f02ac
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_lgammaf128.c
@@ -0,0 +1 @@
+/* _FloatN uses tgamma instead.  */
diff --git a/sysdeps/ieee754/float128/e_lgammaf128_r.c b/sysdeps/ieee754/float128/e_lgammaf128_r.c
new file mode 100644
index 0000000..3517ac3
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_lgammaf128_r.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_lgammal_r.c"
diff --git a/sysdeps/ieee754/float128/e_log10f128.c b/sysdeps/ieee754/float128/e_log10f128.c
new file mode 100644
index 0000000..1c3341e
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_log10f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_log10l.c"
diff --git a/sysdeps/ieee754/float128/e_log2f128.c b/sysdeps/ieee754/float128/e_log2f128.c
new file mode 100644
index 0000000..36becaa
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_log2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_log2l.c"
diff --git a/sysdeps/ieee754/float128/e_logf128.c b/sysdeps/ieee754/float128/e_logf128.c
new file mode 100644
index 0000000..b0c9975
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_logf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_logl.c"
diff --git a/sysdeps/ieee754/float128/e_powf128.c b/sysdeps/ieee754/float128/e_powf128.c
new file mode 100644
index 0000000..3afaf7f
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_powf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_powl.c"
diff --git a/sysdeps/ieee754/float128/e_rem_pio2f128.c b/sysdeps/ieee754/float128/e_rem_pio2f128.c
new file mode 100644
index 0000000..86c2ca1
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_rem_pio2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_rem_pio2l.c"
diff --git a/sysdeps/ieee754/float128/e_remainderf128.c b/sysdeps/ieee754/float128/e_remainderf128.c
new file mode 100644
index 0000000..90c18f8
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_remainderf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_remainderl.c"
diff --git a/sysdeps/ieee754/float128/e_scalbf128.c b/sysdeps/ieee754/float128/e_scalbf128.c
new file mode 100644
index 0000000..067b724
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_scalbf128.c
@@ -0,0 +1 @@
+/* Not defined for _FloatN types.  */
diff --git a/sysdeps/ieee754/float128/e_sinhf128.c b/sysdeps/ieee754/float128/e_sinhf128.c
new file mode 100644
index 0000000..42a54e0
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_sinhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_sinhl.c"
diff --git a/sysdeps/ieee754/float128/e_sqrtf128.c b/sysdeps/ieee754/float128/e_sqrtf128.c
new file mode 100644
index 0000000..1ac216f
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_sqrtf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include <math/e_sqrtl.c>
diff --git a/sysdeps/ieee754/float128/float128_private.h b/sysdeps/ieee754/float128/float128_private.h
new file mode 100644
index 0000000..b0755b9
--- /dev/null
+++ b/sysdeps/ieee754/float128/float128_private.h
@@ -0,0 +1,330 @@
+/* _Float128 overrides for building ldbl-128 as _Float128.
+   Copyright (C) 2016 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/>.  */
+
+/* This must be included before the function renames below.  */
+#include <math.h>
+#undef HUGE_VALL
+#include <math/mul_splitl.h>
+
+/* Renames derived from math_private.h.  */
+#include <math_private.h>
+#include <ieee754_float128.h>
+#define ieee854_long_double_shape_type ieee854_float128_shape_type
+#define ieee854_long_double ieee854_float128
+
+#undef GET_LDOUBLE_LSW64
+#undef GET_LDOUBLE_MSW64
+#undef GET_LDOUBLE_WORDS64
+#undef SET_LDOUBLE_LSW64
+#undef SET_LDOUBLE_MSW64
+#undef SET_LDOUBLE_WORDS64
+#define GET_LDOUBLE_LSW64(x,y) GET_FLOAT128_LSW64 (x, y)
+#define GET_LDOUBLE_MSW64(x,y) GET_FLOAT128_MSW64 (x, y)
+#define GET_LDOUBLE_WORDS64(x,y,z) GET_FLOAT128_WORDS64 (x, y, z)
+#define SET_LDOUBLE_LSW64(x,y) SET_FLOAT128_LSW64 (x, y)
+#define SET_LDOUBLE_MSW64(x,y) SET_FLOAT128_MSW64 (x, y)
+#define SET_LDOUBLE_WORDS64(x,y,z) SET_FLOAT128_WORDS64 (x, y, z)
+
+#undef IEEE854_LONG_DOUBLE_BIAS
+#define IEEE854_LONG_DOUBLE_BIAS IEEE854_FLOAT128_BIAS
+
+#ifdef SET_RESTORE_ROUNDF128
+# undef SET_RESTORE_ROUNDL
+# define SET_RESTORE_ROUNDL() SET_RESTORE_ROUNDF128()
+#endif
+
+
+/* misc macros from the header below.  */
+#include <fix-fp-int-convert-overflow.h>
+#undef FIX_LDBL_LONG_CONVERT_OVERFLOW
+#undef FIX_LDBL_LLONG_CONVERT_OVERFLOW
+#define FIX_LDBL_LONG_CONVERT_OVERFLOW FIX_FLT128_LONG_CONVERT_OVERFLOW
+#define FIX_LDBL_LLONG_CONVERT_OVERFLOW FIX_FLT128_LLONG_CONVERT_OVERFLOW
+
+
+/* float.h constants.  */
+#include <float.h>
+#undef LDBL_DIG
+#undef LDBL_EPSILON
+#undef LDBL_MANT_DIG
+#undef LDBL_MAX
+#undef LDBL_MAX_10_EXP
+#undef LDBL_MAX_EXP
+#undef LDBL_MIN
+#undef LDBL_MIN_10_EXP
+#undef LDBL_MIN_EXP
+#undef LDBL_TRUE_MIN
+#define HUGE_VALL HUGE_VAL_F128
+#define LDBL_DIG FLT128_DIG
+#define LDBL_EPSILON FLT128_EPSILON
+#define LDBL_MANT_DIG FLT128_MANT_DIG
+#define LDBL_MAX FLT128_MAX
+#define LDBL_MAX_10_EXP FLT128_MAX_10_EXP
+#define LDBL_MAX_EXP FLT128_MAX_EXP
+#define LDBL_MIN FLT128_MIN
+#define LDBL_MIN_10_EXP FLT128_MIN_10_EXP
+#define LDBL_MIN_EXP FLT128_MIN_EXP
+#define LDBL_TRUE_MIN FLT128_TRUE_MIN
+
+
+/* math.h GNU constants.  */
+#undef M_El
+#undef M_LOG2El
+#undef M_LOG10El
+#undef M_LN2l
+#undef M_LN10l
+#undef M_PIl
+#undef M_PI_2l
+#undef M_PI_4l
+#undef M_1_PIl
+#undef M_2_PIl
+#undef M_2_SQRTPIl
+#undef M_SQRT2l
+#undef M_SQRT1_2l
+#define M_El M_Ef128
+#define M_LOG2El M_LOG2Ef128
+#define M_LOG10El M_LOG10Ef128
+#define M_LN2l M_LN2f128
+#define M_LN10l M_LN10f128
+#define M_PIl M_PIf128
+#define M_PI_2l M_PI_2f128
+#define M_PI_4l M_PI_4f128
+#define M_1_PIl M_1_PIf128
+#define M_2_PIl M_2_PIf128
+#define M_2_SQRTPIl M_2_SQRTPIf128
+#define M_SQRT2l M_SQRT2f128
+#define M_SQRT1_2l M_SQRT1_2f128
+
+
+/* IEEE function renames.  */
+#define __ieee754_acoshl __ieee754_acoshf128
+#define __ieee754_acosl __ieee754_acosf128
+#define __ieee754_asinhl __ieee754_asinhf128
+#define __ieee754_asinl __ieee754_asinf128
+#define __ieee754_atan2l __ieee754_atan2f128
+#define __ieee754_atanhl __ieee754_atanhf128
+#define __ieee754_coshl __ieee754_coshf128
+#define __ieee754_cosl __ieee754_cosf128
+#define __ieee754_exp10l __ieee754_exp10f128
+#define __ieee754_expl __ieee754_expf128
+#define __ieee754_fmodl __ieee754_fmodf128
+#define __ieee754_gammal_r __ieee754_gammaf128_r
+#define __ieee754_hypotl __ieee754_hypotf128
+#define __ieee754_ilogbl __ieee754_ilogbf128
+#define __ieee754_j0l __ieee754_j0f128
+#define __ieee754_j1l __ieee754_j1f128
+#define __ieee754_jnl __ieee754_jnf128
+#define __ieee754_lgammal_r __ieee754_lgammaf128_r
+#define __ieee754_log10l __ieee754_log10f128
+#define __ieee754_log2l __ieee754_log2f128
+#define __ieee754_logl __ieee754_logf128
+#define __ieee754_powl __ieee754_powf128
+#define __ieee754_rem_pio2l __ieee754_rem_pio2f128
+#define __ieee754_remainderl __ieee754_remainderf128
+#define __ieee754_sinhl __ieee754_sinhf128
+#define __ieee754_sqrtl __ieee754_sqrtf128
+#define __ieee754_y0l __ieee754_y0f128
+#define __ieee754_y1l __ieee754_y1f128
+#define __ieee754_ynl __ieee754_ynf128
+
+
+/* finite math entry points.  */
+#define __acoshl_finite __acoshf128_finite
+#define __acosl_finite __acosf128_finite
+#define __asinl_finite __asinf128_finite
+#define __atan2l_finite __atan2f128_finite
+#define __atanhl_finite __atanhf128_finite
+#define __coshl_finite __coshf128_finite
+#define __cosl_finite __cosf128_finite
+#define __exp10l_finite __exp10f128_finite
+#define __expl_finite __expf128_finite
+#define __fmodl_finite __fmodf128_finite
+#define __hypotl_finite __hypotf128_finite
+#define __ilogbl_finite __ilogbf128_finite
+#define __j0l_finite __j0f128_finite
+#define __j1l_finite __j1f128_finite
+#define __jnl_finite __jnf128_finite
+#define __lgammal_r_finite __lgammaf128_r_finite
+#define __log10l_finite __log10f128_finite
+#define __log2l_finite __log2f128_finite
+#define __logl_finite __logf128_finite
+#define __powl_finite __powf128_finite
+#define __remainderl_finite __remainderf128_finite
+#define __sinhl_finite __sinhf128_finite
+#define __y0l_finite __y0f128_finite
+#define __y1l_finite __y1f128_finite
+#define __ynl_finite __ynf128_finite
+
+
+/* internal function names.  */
+#define __asinhl __asinhf128
+#define __atanl __atanf128
+#define __cbrtl __cbrtf128
+#define __ceill __ceilf128
+#define __copysignl __copysignf128
+#define __cosl __cosf128
+#define __erfcl __erfcf128
+#define __erfl __erff128
+#define __expl __expf128
+#define __expm1l __expm1f128
+#define __fabsl __fabsf128
+#define __fdiml __fdimf128
+#define __finitel __finitef128
+#define __floorl __floorf128
+#define __fmal __fmaf128
+#define __fmaxl __fmaxf128
+#define __fminl __fminf128
+#define __fpclassifyl __fpclassifyf128
+#define __frexpl __frexpf128
+#define __gammal_r_finite __gammaf128_r_finite
+#define __isinfl __isinff128
+#define __isnanl __isnanf128
+#define __issignalingl __issignalingf128
+#define __ldexpl __ldexpf128
+#define __llrintl __llrintf128
+#define __llroundl __llroundf128
+#define __log1pl __log1pf128
+#define __logbl __logbf128
+#define __logl __logf128
+#define __lrintl __lrintf128
+#define __lroundl __lroundf128
+#define __modfl __modff128
+#define __nearbyintl __nearbyintf128
+#define __nextafterl __nextafterf128
+#define __nextdownl __nextdownf128
+#define __nextupl __nextupf128
+#define __remquol __remquof128
+#define __rintl __rintf128
+#define __roundl __roundf128
+#define __scalblnl __scalblnf128
+#define __scalbnl __scalbnf128
+#define __signbitl __signbitf128
+#define __sincosl __sincosf128
+#define __sinl __sinf128
+#define __sqrtl __sqrtf128
+#define __tanhl __tanhf128
+#define __tanl __tanf128
+#define __truncl __truncf128
+#define __x2y2m1l __x2y2m1f128
+
+/* __nexttowardf128 is not _Float128 API. */
+#define __nexttowardl __nexttowardf128_do_not_use
+#define nexttowardl nexttowardf128_do_not_use
+
+
+/* public entry points.  */
+#define asinhl asinhf128
+#define atanl atanf128
+#define atanl atanf128
+#define cbrtl cbrtf128
+#define ceill ceilf128
+#define ceill ceilf128
+#define copysignl copysignf128
+#define copysignl copysignf128
+#define cosl cosf128
+#define cosl cosf128
+#define erfcl erfcf128
+#define erfl erff128
+#define expl expf128
+#define expm1l expm1f128
+#define fabsl fabsf128
+#define fdiml fdimf128
+#define finitel finitef128
+#define floorl floorf128
+#define fmal fmaf128
+#define fmaxl fmaxf128
+#define fminl fminf128
+#define fromfpl fromfpf128
+#define fromfpxl fromfpxf128
+#define fpclassifyl fpclassifyf128
+#define frexpl frexpf128
+#define gammal_r_finite gammaf128_r_finite
+#define getpayloadl getpayloadf128
+#define isinfl isinff128
+#define isnanl isnanf128
+#define issignalingl issignalingf128
+#define ldexpl ldexpf128
+#define llrintl llrintf128
+#define llroundl llroundf128
+#define log1pl log1pf128
+#define logbl logbf128
+#define logl logf128
+#define lrintl lrintf128
+#define lroundl lroundf128
+#define modfl modff128
+#define nanl nanf128
+#define nearbyintl nearbyintf128
+#define nextafterl nextafterf128
+#define nextdownl nextdownf128
+#define nextupl nextupf128
+#define remquol remquof128
+#define rintl rintf128
+#define roundl roundf128
+#define scalbnl scalbnf128
+#define signbitl signbitf128
+#define sincosl sincosf128
+#define sinl sinf128
+#define sqrtl sqrtf128
+#define tanhl tanhf128
+#define tanl tanf128
+#define totalorderl totalorderf128
+#define totalordermagl totalordermagf128
+#define truncl truncf128
+#define ufromfpl ufromfpf128
+#define ufromfpxl ufromfpxf128
+
+
+/* misc internal renames.  */
+#define __builtin_fmal __builtin_fmaf128
+#define __expl_table __expf128_table
+#define __gamma_productl __gamma_productf128
+#define __kernel_cosl __kernel_cosf128
+#define __kernel_rem_pio2l __kernel_rem_pio2f128
+#define __kernel_sincosl __kernel_sincosf128
+#define __kernel_sinl __kernel_sinf128
+#define __kernel_tanl __kernel_tanf128
+#define __lgamma_negl __lgamma_negf128
+#define __lgamma_productl __lgamma_productf128
+#define __sincosl_table __sincosf128_table
+#define mul_splitl mul_splitf128
+
+/* Builtin renames.  */
+#define __builtin_copysignl __builtin_copysignf128
+#define __builtin_signbitl __builtin_signbitf128
+
+static inline void
+mul_splitf128 (_Float128 *hi, _Float128 *lo, _Float128 x, _Float128 y)
+{
+#ifdef __FP_FAST_FMAF128
+  /* Fast built-in fused multiply-add.  */
+  *hi = x * y;
+  *lo = __builtin_fmal (x, y, -*hi);
+#else
+  /* Apply Dekker's algorithm.  */
+  *hi = x * y;
+# define C ((1LL << (FLT128_MANT_DIG + 1) / 2) + 1)
+  _Float128 x1 = x * C;
+  _Float128 y1 = y * C;
+# undef C
+  x1 = (x - x1) + x1;
+  y1 = (y - y1) + y1;
+  _Float128 x2 = x - x1;
+  _Float128 y2 = y - y1;
+  *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
+#endif
+}
diff --git a/sysdeps/ieee754/float128/gamma_productf128.c b/sysdeps/ieee754/float128/gamma_productf128.c
new file mode 100644
index 0000000..be2271f
--- /dev/null
+++ b/sysdeps/ieee754/float128/gamma_productf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/gamma_productl.c"
diff --git a/sysdeps/ieee754/float128/ieee754_float128.h b/sysdeps/ieee754/float128/ieee754_float128.h
new file mode 100644
index 0000000..5bd3a98
--- /dev/null
+++ b/sysdeps/ieee754/float128/ieee754_float128.h
@@ -0,0 +1,140 @@
+/* _Float128 IEEE like macros.
+   Copyright (C) 2016 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 _IEEE754_FLOAT128_H
+#define _IEEE754_FLOAT128_H
+
+#include <endian.h>
+#include <stdint.h>
+
+# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+#  define __FLT_EORDER2(t, a, b) t a; t b;
+#  define __FLT_EORDER4(t, a, b, c, d) \
+			t a; t b; t c; t d;
+#  define __FLT_EORDER6(t, a, b, c, d, e, f)  \
+			t a; t b; t c; t d; t e; t f;
+#  define __FLT_EORDER7(t, a, b, c, d, e, f, g)  \
+			t a; t b; t c; t d; t e; t f; t g;
+# else
+#  define __FLT_EORDER2(t, a, b) \
+			t b; t a;
+#  define __FLT_EORDER4(t, a, b, c, d) \
+			t d; t c; t b; t a;
+#  define __FLT_EORDER6(t, a, b, c, d, e, f)  \
+			t f; t e; t d; t c; t b; t a;
+#  define __FLT_EORDER7(t, a, b, c, d, e, f, g)  \
+			t g; t f; t e; t d; t c; t b; t a;
+# endif
+
+/* A union which permits us to convert between _Float128 and
+   four 32 bit ints or two 64 bit ints.  */
+
+typedef union
+{
+  _Float128 value;
+  struct
+  {
+    __FLT_EORDER2 (uint64_t, msw, lsw);
+  } parts64;
+  struct
+  {
+    __FLT_EORDER4 (uint32_t, w0, w1, w2, w3);
+  } parts32;
+} ieee854_float128_shape_type;
+
+/* Get two 64 bit ints from a _Float128.  */
+
+# define GET_FLOAT128_WORDS64(ix0,ix1,d)			\
+do {								\
+  ieee854_float128_shape_type qw_u;				\
+  qw_u.value = (d);						\
+  (ix0) = qw_u.parts64.msw;					\
+  (ix1) = qw_u.parts64.lsw;					\
+} while (0)
+
+/* Set a _Float128 from two 64 bit ints.  */
+
+# define SET_FLOAT128_WORDS64(d,ix0,ix1)			\
+do {								\
+  ieee854_float128_shape_type qw_u;				\
+  qw_u.parts64.msw = (ix0);					\
+  qw_u.parts64.lsw = (ix1);					\
+  (d) = qw_u.value;						\
+} while (0)
+
+/* Get the more significant 64 bits of a _Float128 mantissa.  */
+
+# define GET_FLOAT128_MSW64(v,d)				\
+do {								\
+  ieee854_float128_shape_type sh_u;				\
+  sh_u.value = (d);						\
+  (v) = sh_u.parts64.msw;					\
+} while (0)
+
+/* Set the more significant 64 bits of a _Float128 mantissa from an int.  */
+
+# define SET_FLOAT128_MSW64(d,v)				\
+do {								\
+  ieee854_float128_shape_type sh_u;				\
+  sh_u.value = (d);						\
+  sh_u.parts64.msw = (v);					\
+  (d) = sh_u.value;						\
+} while (0)
+
+/* Get the least significant 64 bits of a _Float128 mantissa.  */
+
+# define GET_FLOAT128_LSW64(v,d)				\
+do {								\
+  ieee854_float128_shape_type sh_u;				\
+  sh_u.value = (d);						\
+  (v) = sh_u.parts64.lsw;					\
+} while (0)
+
+/* Likewise, some helper macros which are exposed via ieee754.h for
+   C99 real types, but not _Float128.  */
+
+union ieee854_float128
+  {
+    _Float128 d;
+
+    /* This is the IEEE 854 quad-precision format.  */
+    struct
+      {
+	__FLT_EORDER6 (unsigned int, negative:1,
+				     exponent:15,
+				     mantissa0:16,
+				     mantissa1:32,
+				     mantissa2:32,
+				     mantissa3:32)
+      } ieee;
+
+    /* This format makes it easier to see if a NaN is a signalling NaN.  */
+    struct
+      {
+	__FLT_EORDER7 (unsigned int, negative:1,
+				     exponent:15,
+				     quiet_nan:1,
+				     mantissa0:15,
+				     mantissa1:32,
+				     mantissa2:32,
+				     mantissa3:32)
+      } ieee_nan;
+  };
+
+#define IEEE854_FLOAT128_BIAS 0x3fff /* Added to exponent.  */
+
+#endif
diff --git a/sysdeps/ieee754/float128/k_cosf128.c b/sysdeps/ieee754/float128/k_cosf128.c
new file mode 100644
index 0000000..9db0906
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_cosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_cosl.c"
diff --git a/sysdeps/ieee754/float128/k_rem_pio2f128.c b/sysdeps/ieee754/float128/k_rem_pio2f128.c
new file mode 100644
index 0000000..5140266
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_rem_pio2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include <math/k_rem_pio2l.c>
diff --git a/sysdeps/ieee754/float128/k_sincosf128.c b/sysdeps/ieee754/float128/k_sincosf128.c
new file mode 100644
index 0000000..14c0f1e
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_sincosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_sincosl.c"
diff --git a/sysdeps/ieee754/float128/k_sinf128.c b/sysdeps/ieee754/float128/k_sinf128.c
new file mode 100644
index 0000000..f3acf1c
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_sinf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_sinl.c"
diff --git a/sysdeps/ieee754/float128/k_tanf128.c b/sysdeps/ieee754/float128/k_tanf128.c
new file mode 100644
index 0000000..ca6be53
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_tanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_tanl.c"
diff --git a/sysdeps/ieee754/float128/lgamma_negf128.c b/sysdeps/ieee754/float128/lgamma_negf128.c
new file mode 100644
index 0000000..9c16f93
--- /dev/null
+++ b/sysdeps/ieee754/float128/lgamma_negf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/lgamma_negl.c"
diff --git a/sysdeps/ieee754/float128/lgamma_productf128.c b/sysdeps/ieee754/float128/lgamma_productf128.c
new file mode 100644
index 0000000..5efe5dd
--- /dev/null
+++ b/sysdeps/ieee754/float128/lgamma_productf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/lgamma_productl.c"
diff --git a/sysdeps/ieee754/float128/s_asinhf128.c b/sysdeps/ieee754/float128/s_asinhf128.c
new file mode 100644
index 0000000..7b93d8c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_asinhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_asinhl.c"
diff --git a/sysdeps/ieee754/float128/s_atanf128.c b/sysdeps/ieee754/float128/s_atanf128.c
new file mode 100644
index 0000000..9b4d7ec
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_atanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_atanl.c"
diff --git a/sysdeps/ieee754/float128/s_cbrtf128.c b/sysdeps/ieee754/float128/s_cbrtf128.c
new file mode 100644
index 0000000..3bd5797
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_cbrtf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_cbrtl.c"
diff --git a/sysdeps/ieee754/float128/s_ceilf128.c b/sysdeps/ieee754/float128/s_ceilf128.c
new file mode 100644
index 0000000..0af15f5
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_ceilf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_ceill.c"
diff --git a/sysdeps/ieee754/float128/s_copysignf128.c b/sysdeps/ieee754/float128/s_copysignf128.c
new file mode 100644
index 0000000..808f7ab
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_copysignf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_copysignl.c"
diff --git a/sysdeps/ieee754/float128/s_cosf128.c b/sysdeps/ieee754/float128/s_cosf128.c
new file mode 100644
index 0000000..8ba5526
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_cosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_cosl.c"
diff --git a/sysdeps/ieee754/float128/s_erff128.c b/sysdeps/ieee754/float128/s_erff128.c
new file mode 100644
index 0000000..ac16ad6
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_erff128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_erfl.c"
diff --git a/sysdeps/ieee754/float128/s_expm1f128.c b/sysdeps/ieee754/float128/s_expm1f128.c
new file mode 100644
index 0000000..ea28d89
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_expm1f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_expm1l.c"
diff --git a/sysdeps/ieee754/float128/s_fabsf128.c b/sysdeps/ieee754/float128/s_fabsf128.c
new file mode 100644
index 0000000..79ba47c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fabsf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_fabsl.c"
diff --git a/sysdeps/ieee754/float128/s_finitef128.c b/sysdeps/ieee754/float128/s_finitef128.c
new file mode 100644
index 0000000..801de88
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_finitef128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_finitel.c"
diff --git a/sysdeps/ieee754/float128/s_floorf128.c b/sysdeps/ieee754/float128/s_floorf128.c
new file mode 100644
index 0000000..1829843
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_floorf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_floorl.c"
diff --git a/sysdeps/ieee754/float128/s_fmaf128.c b/sysdeps/ieee754/float128/s_fmaf128.c
new file mode 100644
index 0000000..6497895
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fmaf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_fmal.c"
diff --git a/sysdeps/ieee754/float128/s_fpclassifyf128.c b/sysdeps/ieee754/float128/s_fpclassifyf128.c
new file mode 100644
index 0000000..15131dc
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fpclassifyf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_fpclassifyl.c"
diff --git a/sysdeps/ieee754/float128/s_frexpf128.c b/sysdeps/ieee754/float128/s_frexpf128.c
new file mode 100644
index 0000000..7b040b3
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_frexpf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_frexpl.c"
diff --git a/sysdeps/ieee754/float128/s_fromfpf128.c b/sysdeps/ieee754/float128/s_fromfpf128.c
new file mode 100644
index 0000000..891de3d
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fromfpf128.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 0
+#define FUNC fromfpf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
diff --git a/sysdeps/ieee754/float128/s_fromfpxf128.c b/sysdeps/ieee754/float128/s_fromfpxf128.c
new file mode 100644
index 0000000..0159ae2
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fromfpxf128.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 1
+#define FUNC fromfpxl
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
diff --git a/sysdeps/ieee754/float128/s_getpayloadf128.c b/sysdeps/ieee754/float128/s_getpayloadf128.c
new file mode 100644
index 0000000..2e2607a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_getpayloadf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_getpayloadl.c"
diff --git a/sysdeps/ieee754/float128/s_isinff128.c b/sysdeps/ieee754/float128/s_isinff128.c
new file mode 100644
index 0000000..62cc424
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_isinff128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_isinfl.c"
diff --git a/sysdeps/ieee754/float128/s_isnanf128.c b/sysdeps/ieee754/float128/s_isnanf128.c
new file mode 100644
index 0000000..efba240
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_isnanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_isnanl.c"
diff --git a/sysdeps/ieee754/float128/s_issignalingf128.c b/sysdeps/ieee754/float128/s_issignalingf128.c
new file mode 100644
index 0000000..1d45995
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_issignalingf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_issignalingl.c"
diff --git a/sysdeps/ieee754/float128/s_llrintf128.c b/sysdeps/ieee754/float128/s_llrintf128.c
new file mode 100644
index 0000000..bb9ca58
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_llrintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_llrintl.c"
diff --git a/sysdeps/ieee754/float128/s_llroundf128.c b/sysdeps/ieee754/float128/s_llroundf128.c
new file mode 100644
index 0000000..be54a90
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_llroundf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_llroundl.c"
diff --git a/sysdeps/ieee754/float128/s_log1pf128.c b/sysdeps/ieee754/float128/s_log1pf128.c
new file mode 100644
index 0000000..48bb84f
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_log1pf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_log1pl.c"
diff --git a/sysdeps/ieee754/float128/s_logbf128.c b/sysdeps/ieee754/float128/s_logbf128.c
new file mode 100644
index 0000000..167384a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_logbf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_logbl.c"
diff --git a/sysdeps/ieee754/float128/s_lrintf128.c b/sysdeps/ieee754/float128/s_lrintf128.c
new file mode 100644
index 0000000..1cfa9d7
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_lrintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_lrintl.c"
diff --git a/sysdeps/ieee754/float128/s_lroundf128.c b/sysdeps/ieee754/float128/s_lroundf128.c
new file mode 100644
index 0000000..13ba9f2
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_lroundf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_lroundl.c"
diff --git a/sysdeps/ieee754/float128/s_modff128.c b/sysdeps/ieee754/float128/s_modff128.c
new file mode 100644
index 0000000..4618c6c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_modff128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_modfl.c"
diff --git a/sysdeps/ieee754/float128/s_nearbyintf128.c b/sysdeps/ieee754/float128/s_nearbyintf128.c
new file mode 100644
index 0000000..e61a3b3
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nearbyintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_nearbyintl.c"
diff --git a/sysdeps/ieee754/float128/s_nextafterf128.c b/sysdeps/ieee754/float128/s_nextafterf128.c
new file mode 100644
index 0000000..2c43a00
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nextafterf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_nextafterl.c"
diff --git a/sysdeps/ieee754/float128/s_nexttowardf128.c b/sysdeps/ieee754/float128/s_nexttowardf128.c
new file mode 100644
index 0000000..006e4c9
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nexttowardf128.c
@@ -0,0 +1 @@
+/* This function does not exist for _FloatN types.  */
diff --git a/sysdeps/ieee754/float128/s_nextupf128.c b/sysdeps/ieee754/float128/s_nextupf128.c
new file mode 100644
index 0000000..7d5d0b8
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nextupf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_nextupl.c"
diff --git a/sysdeps/ieee754/float128/s_remquof128.c b/sysdeps/ieee754/float128/s_remquof128.c
new file mode 100644
index 0000000..1cef61a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_remquof128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_remquol.c"
diff --git a/sysdeps/ieee754/float128/s_rintf128.c b/sysdeps/ieee754/float128/s_rintf128.c
new file mode 100644
index 0000000..2adb95f
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_rintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_rintl.c"
diff --git a/sysdeps/ieee754/float128/s_roundf128.c b/sysdeps/ieee754/float128/s_roundf128.c
new file mode 100644
index 0000000..1eb36f2
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_roundf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_roundl.c"
diff --git a/sysdeps/ieee754/float128/s_scalblnf128.c b/sysdeps/ieee754/float128/s_scalblnf128.c
new file mode 100644
index 0000000..999223c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_scalblnf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_scalblnl.c"
diff --git a/sysdeps/ieee754/float128/s_scalbnf128.c b/sysdeps/ieee754/float128/s_scalbnf128.c
new file mode 100644
index 0000000..0e7ab26
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_scalbnf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_scalbnl.c"
diff --git a/sysdeps/ieee754/float128/s_setpayloadf128.c b/sysdeps/ieee754/float128/s_setpayloadf128.c
new file mode 100644
index 0000000..63e046a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_setpayloadf128.c
@@ -0,0 +1,4 @@
+#include <float128_private.h>
+#define SIG 0
+#define FUNC setpayloadf128
+#include "../ldbl-128/s_setpayloadl_main.c"
diff --git a/sysdeps/ieee754/float128/s_setpayloadsigf128.c b/sysdeps/ieee754/float128/s_setpayloadsigf128.c
new file mode 100644
index 0000000..85b2c4a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_setpayloadsigf128.c
@@ -0,0 +1,4 @@
+#include <float128_private.h>
+#define SIG 1
+#define FUNC setpayloadsigf128
+#include "../ldbl-128/s_setpayloadl_main.c"
diff --git a/sysdeps/ieee754/float128/s_signbitf128.c b/sysdeps/ieee754/float128/s_signbitf128.c
new file mode 100644
index 0000000..71c1ca3
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_signbitf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_signbitl.c"
diff --git a/sysdeps/ieee754/float128/s_significandf128.c b/sysdeps/ieee754/float128/s_significandf128.c
new file mode 100644
index 0000000..067b724
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_significandf128.c
@@ -0,0 +1 @@
+/* Not defined for _FloatN types.  */
diff --git a/sysdeps/ieee754/float128/s_sincosf128.c b/sysdeps/ieee754/float128/s_sincosf128.c
new file mode 100644
index 0000000..472adde
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_sincosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_sincosl.c"
diff --git a/sysdeps/ieee754/float128/s_sinf128.c b/sysdeps/ieee754/float128/s_sinf128.c
new file mode 100644
index 0000000..d79a116
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_sinf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_sinl.c"
diff --git a/sysdeps/ieee754/float128/s_tanf128.c b/sysdeps/ieee754/float128/s_tanf128.c
new file mode 100644
index 0000000..382961a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_tanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_tanl.c"
diff --git a/sysdeps/ieee754/float128/s_tanhf128.c b/sysdeps/ieee754/float128/s_tanhf128.c
new file mode 100644
index 0000000..e02c9a6
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_tanhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_tanhl.c"
diff --git a/sysdeps/ieee754/float128/s_totalorderf128.c b/sysdeps/ieee754/float128/s_totalorderf128.c
new file mode 100644
index 0000000..1b115d8
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_totalorderf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_totalorderl.c"
diff --git a/sysdeps/ieee754/float128/s_totalordermagf128.c b/sysdeps/ieee754/float128/s_totalordermagf128.c
new file mode 100644
index 0000000..e44c657
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_totalordermagf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_totalordermagl.c"
diff --git a/sysdeps/ieee754/float128/s_truncf128.c b/sysdeps/ieee754/float128/s_truncf128.c
new file mode 100644
index 0000000..474d9dc
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_truncf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_truncl.c"
diff --git a/sysdeps/ieee754/float128/s_ufromfpf128.c b/sysdeps/ieee754/float128/s_ufromfpf128.c
new file mode 100644
index 0000000..0cd2281
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_ufromfpf128.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 0
+#define FUNC ufromfpf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
diff --git a/sysdeps/ieee754/float128/s_ufromfpxf128.c b/sysdeps/ieee754/float128/s_ufromfpxf128.c
new file mode 100644
index 0000000..c0cd7e3
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_ufromfpxf128.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 1
+#define FUNC ufromfpxf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
diff --git a/sysdeps/ieee754/float128/t_sincosf128.c b/sysdeps/ieee754/float128/t_sincosf128.c
new file mode 100644
index 0000000..7e699d3
--- /dev/null
+++ b/sysdeps/ieee754/float128/t_sincosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/t_sincosl.c"
diff --git a/sysdeps/ieee754/float128/w_llogbf128.c b/sysdeps/ieee754/float128/w_llogbf128.c
new file mode 100644
index 0000000..f83657d
--- /dev/null
+++ b/sysdeps/ieee754/float128/w_llogbf128.c
@@ -0,0 +1,3 @@
+#define declare_mgen_alias(from, to) weak_alias (M_SUF (from), M_SUF (to))
+#include <math-type-macros-float128.h>
+#include <w_llogb_template.c>
diff --git a/sysdeps/ieee754/float128/x2y2m1f128.c b/sysdeps/ieee754/float128/x2y2m1f128.c
new file mode 100644
index 0000000..6888079
--- /dev/null
+++ b/sysdeps/ieee754/float128/x2y2m1f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/x2y2m1l.c"
-- 
2.4.11

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v2 1/8] ldbl-128: Use mathx_hidden_def inplace of hidden_def
  2017-04-28 21:35 [PATCH v2 0/8] Add float128 functions and declarations to libm Gabriel F. T. Gomes
                   ` (3 preceding siblings ...)
  2017-04-28 21:36 ` [PATCH v2 6/8] float128: Add private _Float128 declarations for libm Gabriel F. T. Gomes
@ 2017-04-28 21:36 ` Gabriel F. T. Gomes
  2017-05-01 11:39   ` Joseph Myers
  2017-04-28 21:36 ` [PATCH v2 4/8] float128: Add public _Float128 declarations to libm Gabriel F. T. Gomes
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-04-28 21:36 UTC (permalink / raw)
  To: libc-alpha

From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>

This provides a extra macro expansion before invoking
the hidden_def macro.  This is necessary to build the
ldbl-128 files as float128 correctly.

	* sysdeps/generic/math_private.h:
	(mathx_hidden_def): New macro.
	* sysdeps/ieee754/ldbl-128/s_finitel.c: Replace hidden_def with
	the above.
	* sysdeps/ieee754/ldbl-128/s_isinfl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_isnanl.c: Likewise.
---
 sysdeps/generic/math_private.h       | 4 ++++
 sysdeps/ieee754/ldbl-128/s_finitel.c | 2 +-
 sysdeps/ieee754/ldbl-128/s_isinfl.c  | 2 +-
 sysdeps/ieee754/ldbl-128/s_isnanl.c  | 2 +-
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index aba1cb9..4d8a35f 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -181,6 +181,10 @@ do {								\
 } while (0)
 #endif
 
+/* We need to guarantee an expansion of name when building
+   ldbl-128 files as another type (e.g _Float128).  */
+#define mathx_hidden_def(name) hidden_def(name)
+
 /* Get long double macros from a separate header.  */
 #include <math_ldbl.h>
 
diff --git a/sysdeps/ieee754/ldbl-128/s_finitel.c b/sysdeps/ieee754/ldbl-128/s_finitel.c
index feb4590..7c69968 100644
--- a/sysdeps/ieee754/ldbl-128/s_finitel.c
+++ b/sysdeps/ieee754/ldbl-128/s_finitel.c
@@ -32,5 +32,5 @@ int __finitel(_Float128 x)
 	return (int)((u_int64_t)((hx&0x7fff000000000000LL)
 				 -0x7fff000000000000LL)>>63);
 }
-hidden_def (__finitel)
+mathx_hidden_def (__finitel)
 weak_alias (__finitel, finitel)
diff --git a/sysdeps/ieee754/ldbl-128/s_isinfl.c b/sysdeps/ieee754/ldbl-128/s_isinfl.c
index dce8fc0..a41e8cf 100644
--- a/sysdeps/ieee754/ldbl-128/s_isinfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_isinfl.c
@@ -25,5 +25,5 @@ __isinfl (_Float128 x)
 	lx |= -lx;
 	return ~(lx >> 63) & (hx >> 62);
 }
-hidden_def (__isinfl)
+mathx_hidden_def (__isinfl)
 weak_alias (__isinfl, isinfl)
diff --git a/sysdeps/ieee754/ldbl-128/s_isnanl.c b/sysdeps/ieee754/ldbl-128/s_isnanl.c
index 1dee642..80f97fe 100644
--- a/sysdeps/ieee754/ldbl-128/s_isnanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_isnanl.c
@@ -34,5 +34,5 @@ int __isnanl(_Float128 x)
 	hx = 0x7fff000000000000LL - hx;
 	return (int)((u_int64_t)hx>>63);
 }
-hidden_def (__isnanl)
+mathx_hidden_def (__isnanl)
 weak_alias (__isnanl, isnanl)
-- 
2.4.11

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 4/8] float128: Add public _Float128 declarations to libm.
  2017-04-28 21:36 ` [PATCH v2 4/8] float128: Add public _Float128 declarations to libm Gabriel F. T. Gomes
@ 2017-04-28 22:49   ` Joseph Myers
  2017-05-02 20:53     ` Gabriel F. T. Gomes
  0 siblings, 1 reply; 43+ messages in thread
From: Joseph Myers @ 2017-04-28 22:49 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

On Fri, 28 Apr 2017, Gabriel F. T. Gomes wrote:

> diff --git a/bits/floatn.h b/bits/floatn.h
> new file mode 100644
> index 0000000..abc39cb
> --- /dev/null
> +++ b/bits/floatn.h
> @@ -0,0 +1,30 @@
> +/* Macros to control TS 18661-3 glibc features.
> +   Copyright (C) 2016 Free Software Foundation, Inc.

Everything in any of these patches needs to include 2017 in copyright 
dates.

> +/* Defined if the current compiler invocation supports _Float128 or
> +   __float128 as an additional floating-point type.  */
> +#define __HAVE_FLOAT128 0
> +
> +/* Defined if support for _Float128 is present.  This implies
> +   support for ISO/IEC TS-18661-3, meaning that architectures that
> +   define this macro use __GLIBC_USE (IEC_60559_TYPES_EXT).  */
> +#define __USE_FLOAT128 0

I still don't follow what the exact semantics of the macros are meant to 
be.

What's "additional" for types?  Is the case of _Float128 being 
ABI-compatible with long double included or not?  And what does "support 
for _Float128 is present" mean?

I think the following questions might be answered by such macros, and it 
must be completely unambiguous from the comments on the default 
definitions exactly which question or questions each macro relates to.

(a) Does the compiler support a particular type name (such as _Float128)?

(b) Does the compiler support some name for a type that is ABI-compatible 
with _Float128 (the name possibly being __float128 or long double)?

(c) Does this glibc build include support for _Float128 (that is, *f128 
functions / aliases, and all the associated header pieces)?  If 
ABI-distinct, the headers *should* care about this even when the functions 
aren't going to be declared, because of the type-generic <math.h> macros 
that might need to call __isinff128 etc.

(d) Is such a type, given that it is supported, ABI-distinct from the 
default float, double and long double in the glibc ABI?  Headers care 
about this because __isinff128 won't exist if it's not ABI-distinct.  But 
for your purposes you could hardcode the answer that this is "yes" 
whenever (c) is true.

(e) Should this compilation expose declarations for the *f128 interfaces?  
I think it's best for this to be represented as ((b) && (c)) && 
__GLIBC_USE (IEC_60559_TYPES_EXT), rather than having its own macro.

It looks rather like you're using __USE_FLOAT128 as (e), which as noted I 
don't think should have its own macro at all, and __HAVE_FLOAT128 as (d) 
or (b) && (d).  ((b) && (d) is the condition for including 
bits/mathcalls-helper-functions.h, (b) && (e) is the condition for 
including bits/mathcalls.h.)

So define macros for compiler+library support for _Float128 ((b) && (c)), 
and compiler+library support for ABI-distinct _Float128 ((b) && (d)), both 
of those macros admitting the possibility that the name might be different 
- the macro for ((b) && (c)) would be used in conjunction with __GLIBC_USE 
(IEC_60559_TYPES_EXT) to determine whether to expose public declarations, 
the macro for ((b) && (d)) would determine whether to include 
bits/mathcalls-helper-functions.h and how __MATH_TG is defined.  The 
compiler+ part is relevant because you don't want to try declaring the 
functions etc. if the compiler doesn't support the types at all.  (The 
compiler used to build glibc must support them, possibly under another 
name, but the user's compiler may be older.)

> diff --git a/bits/huge_val_flt128.h b/bits/huge_val_flt128.h

> +#ifdef __USE_FLOAT128
> +# define HUGE_VAL_F128 (__builtin_huge_valf128 ())
> +#endif

I'd expect exactly one of math.h and this header to have the ((b) && (c)) 
&& __GLIBC_USE (IEC_60559_TYPES_EXT) conditional.  Probably math.h as 
that's the existing practice for bits/huge_vall.h.  You currently have 
conditionals in both places.

> +#if __USE_FLOAT128 && __USE_GNU

__USE_GNU needs to be tested with "defined", it's a defined/undefined 
macro not 1/0.

> diff --git a/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h b/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h
> new file mode 100644
> index 0000000..5ecadec
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h

> +#  define L(x) x##Q

"L" is in the user's namespace and should not go in a public header.

> +/* Builtin __builtin_huge_val is only type-generic since GCC 7.0.  */

It's never type-generic.  Type-generic built-in functions are only 
type-generic on argument types (they all have int return type).  You mean 
something else, such as that __builtin_huge_valf128 doesn't exist before 
GCC 7.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 5/8] float128: Include math-finite.h for _Float128
  2017-04-28 21:35 ` [PATCH v2 5/8] float128: Include math-finite.h for _Float128 Gabriel F. T. Gomes
@ 2017-04-28 22:53   ` Joseph Myers
  2017-05-09 18:54     ` [PATCH v3 " Gabriel F. T. Gomes
  0 siblings, 1 reply; 43+ messages in thread
From: Joseph Myers @ 2017-04-28 22:53 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

On Fri, 28 Apr 2017, Gabriel F. T. Gomes wrote:

> All the declarations in math-finite.h are macroized by floating-point
> type.  This patch includes it for float128.

At least pow10 and gamma there need to have their declarations in 
math-finite.h disabled for _FloatN just as they are in mathcalls.h.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 1/8] ldbl-128: Use mathx_hidden_def inplace of hidden_def
  2017-04-28 21:36 ` [PATCH v2 1/8] ldbl-128: Use mathx_hidden_def inplace of hidden_def Gabriel F. T. Gomes
@ 2017-05-01 11:39   ` Joseph Myers
  0 siblings, 0 replies; 43+ messages in thread
From: Joseph Myers @ 2017-05-01 11:39 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

On Fri, 28 Apr 2017, Gabriel F. T. Gomes wrote:

> From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>
> 
> This provides a extra macro expansion before invoking
> the hidden_def macro.  This is necessary to build the
> ldbl-128 files as float128 correctly.
> 
> 	* sysdeps/generic/math_private.h:
> 	(mathx_hidden_def): New macro.
> 	* sysdeps/ieee754/ldbl-128/s_finitel.c: Replace hidden_def with
> 	the above.
> 	* sysdeps/ieee754/ldbl-128/s_isinfl.c: Likewise.
> 	* sysdeps/ieee754/ldbl-128/s_isnanl.c: Likewise.

This patch is OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 2/8] float128: Add _Float128 make bits to libm.
  2017-04-28 21:35 ` [PATCH v2 2/8] float128: Add _Float128 make bits " Gabriel F. T. Gomes
@ 2017-05-01 12:00   ` Joseph Myers
  2017-05-02 19:46     ` Gabriel F. T. Gomes
  0 siblings, 1 reply; 43+ messages in thread
From: Joseph Myers @ 2017-05-01 12:00 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

The list of symbols in sysdeps/ieee754/float128/Versions is missing 
canonicalizef128.  It's also not quite alphabetical (you have copysignf128 
before conjf128; the __* list is rather more non-alphabetical).  It's also 
missing exp2f128.  It's also missing fmaxmagf128 and fminmagf128.  It's 
also missing roundevenf128.  It's also missing __exp2f128_finite.

What's the rationale for __isinff128 and __isnanf128 being in libm when 
the versions for other types are in libc?  (For other types, __finite is 
in both.  It's a reasonable assumption that new such functions should be 
exported from only one library.)

Now, various such functions would have been needed in libc for use from 
e.g. printf code (but still get built in libm even if not exported from 
there, I think).  Mostly they may not get used in libc any more because of 
inline expansion of macros such as isinf, together with those macros being 
used in glibc instead of direct __isinf etc. calls.  In patch 4, you 
arrange for __isinff128 to be used from the isinf macro when building with 
GCC < 7, so probably __isinff128 would get used from strfromf128.

There's a reasonable case for saying the libm is the library these 
functions belong in and so new such functions should be exported from only 
libm even if they need to be present in, but not exported from, libc, but 
we should at least consider the question and make sure it's a deliberate 
choice of where to export the functions from which will be applied in 
future to other _FloatN / _FloatNx types.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 2/8] float128: Add _Float128 make bits to libm.
  2017-05-01 12:00   ` Joseph Myers
@ 2017-05-02 19:46     ` Gabriel F. T. Gomes
  2017-05-02 20:33       ` Joseph Myers
  0 siblings, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-05-02 19:46 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

On Mon, 1 May 2017 12:00:31 +0000
Joseph Myers <joseph@codesourcery.com> wrote:

> The list of symbols in sysdeps/ieee754/float128/Versions is missing 
> canonicalizef128.  It's also not quite alphabetical (you have copysignf128 
> before conjf128; the __* list is rather more non-alphabetical).  It's also 
> missing exp2f128.  It's also missing fmaxmagf128 and fminmagf128.  It's 
> also missing roundevenf128.  It's also missing __exp2f128_finite.

I kept their implementations separate from this patch series in order to
ease review (since their implementation is not reusing the
implementation in ldbl-128, as is the case for all other functions).

If you prefer, I can squash those patches in this patch set and
resubmit.  Is that what you prefer?

As for the alphabetical order, I'll just fix it.

> What's the rationale for __isinff128 and __isnanf128 being in libm when 
> the versions for other types are in libc?  (For other types, __finite is 
> in both.  It's a reasonable assumption that new such functions should be 
> exported from only one library.)
> 
> Now, various such functions would have been needed in libc for use from 
> e.g. printf code (but still get built in libm even if not exported from 
> there, I think).  Mostly they may not get used in libc any more because of 
> inline expansion of macros such as isinf, together with those macros being 
> used in glibc instead of direct __isinf etc. calls.  In patch 4, you 
> arrange for __isinff128 to be used from the isinf macro when building with 
> GCC < 7, so probably __isinff128 would get used from strfromf128.

Indeed, these functions are present both in libm and libc.
They are global in libm and local in libc.

> There's a reasonable case for saying the libm is the library these 
> functions belong in and so new such functions should be exported from only 
> libm even if they need to be present in, but not exported from, libc, but 
> we should at least consider the question and make sure it's a deliberate 
> choice of where to export the functions from which will be applied in 
> future to other _FloatN / _FloatNx types.

We had assumed that these functions should be exported through libm.
From your experience, would you recommend that they be exported from
both, as is the case with the other functions?

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 2/8] float128: Add _Float128 make bits to libm.
  2017-05-02 19:46     ` Gabriel F. T. Gomes
@ 2017-05-02 20:33       ` Joseph Myers
  2017-05-08 18:22         ` [PATCH v3 1/2] " Gabriel F. T. Gomes
  0 siblings, 1 reply; 43+ messages in thread
From: Joseph Myers @ 2017-05-02 20:33 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

On Tue, 2 May 2017, Gabriel F. T. Gomes wrote:

> On Mon, 1 May 2017 12:00:31 +0000
> Joseph Myers <joseph@codesourcery.com> wrote:
> 
> > The list of symbols in sysdeps/ieee754/float128/Versions is missing 
> > canonicalizef128.  It's also not quite alphabetical (you have copysignf128 
> > before conjf128; the __* list is rather more non-alphabetical).  It's also 
> > missing exp2f128.  It's also missing fmaxmagf128 and fminmagf128.  It's 
> > also missing roundevenf128.  It's also missing __exp2f128_finite.
> 
> I kept their implementations separate from this patch series in order to
> ease review (since their implementation is not reusing the
> implementation in ldbl-128, as is the case for all other functions).

I'd expect canonicalizef128, fmaxmagf128, fminmagf128 to be using the 
type-generic templates, just like the corresponding functions for other 
types and the other _Float128 functions using type-generic templates, with 
no special _Float128 action needed beyond just giving them appropriate 
symbol versions.

I'd expect roundevenf128 to use the ldbl-128 implementation with 
appropriate macros defined, just like the other functions based on 
ldbl-128.

That leaves exp2f128.  math/e_exp2l.c is actually logically a type-generic 
implementation that could be used for any floating-point type.  Maybe it 
should be made into a type-generic template, as long as the sysdeps 
implementations (for architectures and floating-point formats that have 
sysdeps implementations of exp2 functions) continue to be used when 
available.

> > There's a reasonable case for saying the libm is the library these 
> > functions belong in and so new such functions should be exported from only 
> > libm even if they need to be present in, but not exported from, libc, but 
> > we should at least consider the question and make sure it's a deliberate 
> > choice of where to export the functions from which will be applied in 
> > future to other _FloatN / _FloatNx types.
> 
> We had assumed that these functions should be exported through libm.
> From your experience, would you recommend that they be exported from
> both, as is the case with the other functions?

I think exporting from libm (only) makes logical sense, given that they 
are used in macros defined in <math.h> and libm is the standard place from 
which to export any functionality from <math.h>, <complex.h> or <fenv.h>.  
It also accords with a previous discussion of how in general such 
functions should not be in, or exported from, libc.so unnecessarily 
<https://sourceware.org/ml/libc-alpha/2014-06/msg00655.html> (subject to 
requirements of compat symbols staying and the point I noted of non-compat 
copysignl being needed in libc in certain cases).

For the functions present in libc at version GLIBC_2.0, I suppose they had 
to stay exported from libc when symbol versioning was added because people 
would have had pre-symbol versioning binaries built with glibc 2.0 that 
used those functions but only linked with libc and not libm.  (Though that 
doesn't explain exports added to libc at subsequent symbol versions.)

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 4/8] float128: Add public _Float128 declarations to libm.
  2017-04-28 22:49   ` Joseph Myers
@ 2017-05-02 20:53     ` Gabriel F. T. Gomes
  2017-05-02 21:40       ` Joseph Myers
  0 siblings, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-05-02 20:53 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

On Fri, 28 Apr 2017 22:49:13 +0000
Joseph Myers <joseph@codesourcery.com> wrote:

> On Fri, 28 Apr 2017, Gabriel F. T. Gomes wrote:
> 
> > diff --git a/bits/floatn.h b/bits/floatn.h
> > --- /dev/null
> > +++ b/bits/floatn.h
> > @@ -0,0 +1,30 @@
> > +/* Macros to control TS 18661-3 glibc features.
> > +   Copyright (C) 2016 Free Software Foundation, Inc.  
> 
> Everything in any of these patches needs to include 2017 in copyright 
> dates.

OK.

> > +/* Defined if the current compiler invocation supports _Float128 or
> > +   __float128 as an additional floating-point type.  */
> > +#define __HAVE_FLOAT128 0
> > +
> > +/* Defined if support for _Float128 is present.  This implies
> > +   support for ISO/IEC TS-18661-3, meaning that architectures that
> > +   define this macro use __GLIBC_USE (IEC_60559_TYPES_EXT).  */
> > +#define __USE_FLOAT128 0  
> 
> I still don't follow what the exact semantics of the macros are meant to 
> be.
> 
> What's "additional" for types?  Is the case of _Float128 being 
> ABI-compatible with long double included or not?  And what does "support 
> for _Float128 is present" mean?
> 
> I think the following questions might be answered by such macros, and it 
> must be completely unambiguous from the comments on the default 
> definitions exactly which question or questions each macro relates to.
> 
> (a) Does the compiler support a particular type name (such as _Float128)?
> 
> (b) Does the compiler support some name for a type that is ABI-compatible 
> with _Float128 (the name possibly being __float128 or long double)?

Actually, we've been using __HAVE_FLOAT128 as ((a) || (b)) and the
comments aren't helping.
What about this:

/* Defined if the current compiler invocation provides a 128-bit
   floating point type compatible with IEEE 754.  */
#define __HAVE_FLOAT128 0

> (c) Does this glibc build include support for _Float128 (that is, *f128 
> functions / aliases, and all the associated header pieces)?  If 
> ABI-distinct, the headers *should* care about this even when the functions 
> aren't going to be declared, because of the type-generic <math.h> macros 
> that might need to call __isinff128 etc.

We don't have a macro that indicates that support for _Float128 is
provided in our glibc builds.  This information is currently implicit.

We now understand that this is useful for glibc users.  Do you have any
suggestion for the macro name?

> (d) Is such a type, given that it is supported, ABI-distinct from the 
> default float, double and long double in the glibc ABI?  Headers care 
> about this because __isinff128 won't exist if it's not ABI-distinct.  But 
> for your purposes you could hardcode the answer that this is "yes" 
> whenever (c) is true.

Likewise, this information is implicit.  Any suggestions for the macro
name?

> (e) Should this compilation expose declarations for the *f128 interfaces?  
> I think it's best for this to be represented as ((b) && (c)) && 
> __GLIBC_USE (IEC_60559_TYPES_EXT), rather than having its own macro.
> 
> It looks rather like you're using __USE_FLOAT128 as (e), which as noted I 
> don't think should have its own macro at all,

We decided to provide this macro to avoid having to write all the
condition multiple times in the code.  We could change this, but is it
the best thing to do?

> ((b) && (d) is the condition for including 
> bits/mathcalls-helper-functions.h, (b) && (e) is the condition for 
> including bits/mathcalls.h.)

OK.

> So define macros for compiler+library support for _Float128 ((b) && (c)), 
> and compiler+library support for ABI-distinct _Float128 ((b) && (d)), both 
> of those macros admitting the possibility that the name might be different 
> - the macro for ((b) && (c)) would be used in conjunction with __GLIBC_USE 
> (IEC_60559_TYPES_EXT) to determine whether to expose public declarations, 
> the macro for ((b) && (d)) would determine whether to include 
> bits/mathcalls-helper-functions.h and how __MATH_TG is defined.  The 
> compiler+ part is relevant because you don't want to try declaring the 
> functions etc. if the compiler doesn't support the types at all.  (The 
> compiler used to build glibc must support them, possibly under another 
> name, but the user's compiler may be older.)

OK.

> > diff --git a/bits/huge_val_flt128.h b/bits/huge_val_flt128.h  
> 
> > +#ifdef __USE_FLOAT128
> > +# define HUGE_VAL_F128 (__builtin_huge_valf128 ())
> > +#endif  
> 
> I'd expect exactly one of math.h and this header to have the ((b) && (c)) 
> && __GLIBC_USE (IEC_60559_TYPES_EXT) conditional.  Probably math.h as 
> that's the existing practice for bits/huge_vall.h.  You currently have 
> conditionals in both places.

OK.

> > +#if __USE_FLOAT128 && __USE_GNU  
> 
> __USE_GNU needs to be tested with "defined", it's a defined/undefined 
> macro not 1/0.

OK.

> > diff --git a/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h b/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h
> > --- /dev/null
> > +++ b/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h  
> 
> > +#  define L(x) x##Q  
> 
> "L" is in the user's namespace and should not go in a public header.

OK.

> > +/* Builtin __builtin_huge_val is only type-generic since GCC 7.0.  */  
> 
> It's never type-generic.  Type-generic built-in functions are only 
> type-generic on argument types (they all have int return type).

Indeed.  I am going to rewrite this comment.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 4/8] float128: Add public _Float128 declarations to libm.
  2017-05-02 20:53     ` Gabriel F. T. Gomes
@ 2017-05-02 21:40       ` Joseph Myers
  2017-05-04 12:58         ` Gabriel F. T. Gomes
  0 siblings, 1 reply; 43+ messages in thread
From: Joseph Myers @ 2017-05-02 21:40 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

On Tue, 2 May 2017, Gabriel F. T. Gomes wrote:

> > (a) Does the compiler support a particular type name (such as _Float128)?
> > 
> > (b) Does the compiler support some name for a type that is ABI-compatible 
> > with _Float128 (the name possibly being __float128 or long double)?
> 
> Actually, we've been using __HAVE_FLOAT128 as ((a) || (b)) and the
> comments aren't helping.

(a) implies (b) as I'm interpreting it (_Float128 being a possible name 
for such a type), so that's just (b), which isn't actually something I 
think the headers need - anything conditional in the headers should be 
conditional on library support also being present (after all, e.g. AArch64 
has such a type - long double, and _Float128 in GCC 7, but shouldn't 
enable the declarations until the relevant aliases are present in the 
library).

> What about this:
> 
> /* Defined if the current compiler invocation provides a 128-bit
>    floating point type compatible with IEEE 754.  */
> #define __HAVE_FLOAT128 0

I'd suggest

/* 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

(Note the "default" in the comment on __HAVE_DISTINCT_FLOAT128 - I'm 
referring to the functions that get the symbols with the C11 *f, *, *l 
names.  If in future you support binary128 long double for powerpc64le, 
with *l API calls mapped to __*f128 ABI calls, it's still ABI-distinct 
from default long double in that sense, meaning that e.g. __isinff128 
needs to be declared, __isinfl is for ibm128 and __isinff128 is for 
float128 whatever the C names for those types.)

> > (c) Does this glibc build include support for _Float128 (that is, *f128 
> > functions / aliases, and all the associated header pieces)?  If 
> > ABI-distinct, the headers *should* care about this even when the functions 
> > aren't going to be declared, because of the type-generic <math.h> macros 
> > that might need to call __isinff128 etc.
> 
> We don't have a macro that indicates that support for _Float128 is
> provided in our glibc builds.  This information is currently implicit.
> 
> We now understand that this is useful for glibc users.  Do you have any
> suggestion for the macro name?

I'm suggesting the above macros as being only for use in other glibc 
headers, not for users.  Users wanting to test for support can do e.g. 
"#ifdef HUGE_VAL_F128".

> > (e) Should this compilation expose declarations for the *f128 interfaces?  
> > I think it's best for this to be represented as ((b) && (c)) && 
> > __GLIBC_USE (IEC_60559_TYPES_EXT), rather than having its own macro.
> > 
> > It looks rather like you're using __USE_FLOAT128 as (e), which as noted I 
> > don't think should have its own macro at all,
> 
> We decided to provide this macro to avoid having to write all the
> condition multiple times in the code.  We could change this, but is it
> the best thing to do?

The __GLIBC_USE macro gets recomputed for each header included, to reflect 
that what matters for __STDC_WANT_IEC_60559_TYPES_EXT__ is its value when 
an affected header is included - not when some unrelated system header is 
included.

I'd say that if any macro represents __HAVE_FLOAT128 && __GLIBC_USE 
(IEC_60559_TYPES_EXT), you need to be very careful about ordering, so that 
it also reflects the current value of __GLIBC_USE (IEC_60559_TYPES_EXT).

It's true that CFP DR#3 says the __STDC_WANT_* macros must be defined or 
undefined the same for all affected headers.  But bits/floatn.h also needs 
to be included by some headers that aren't listed in TS 18661-3 as being 
affected by __STDC_WANT_IEC_60559_TYPES_EXT__: wchar.h needs to include 
it, and then declare wcstof128 if __HAVE_FLOAT128 && defined __USE_GNU.  
Since it's legitimate to do

#include <wchar.h>
#define __STDC_WANT_IEC_60559_TYPES_EXT__
#include <math.h>

(for example), you'd need to make sure that math.h gets the correct value 
of any combined macro.  I think it's simpler just to use

#if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)

where needed.  Or have a macro __GLIBC_USE_FLOAT (128) which is defined as

#define __GLIBC_USE_FLOAT(N) __HAVE_FLOAT ## N && __GLIBC_USE (IEC_60559_TYPES_EXT)

so that it automatically reflects the current value of __GLIBC_USE 
(IEC_60559_TYPES_EXT).

Also, another point on conditions under which to declare functions: all 
the TS 18661-1 functions should be declared for the new type if 
__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT), whether or not 
__GLIBC_USE (IEC_60559_BFP_EXT) is true.  So all the

#if __GLIBC_USE (IEC_60559_BFP_EXT)

conditionals in bits/mathcalls.h need to be changed to

#if __GLIBC_USE (IEC_60559_BFP_EXT) || defined __FLOATN_TYPE

or similar.  (See what I said about this in 
<https://sourceware.org/ml/libc-alpha/2017-01/msg00333.html>.)

Also, you're missing the SNANF128 macro.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 8/8] float128: Add wrappers to override ldbl-128 as float128.
  2017-04-28 21:36 ` [PATCH v2 8/8] float128: Add wrappers to override ldbl-128 as float128 Gabriel F. T. Gomes
@ 2017-05-02 21:51   ` Joseph Myers
  2017-05-09 19:11     ` [PATCH v3 " Gabriel F. T. Gomes
  0 siblings, 1 reply; 43+ messages in thread
From: Joseph Myers @ 2017-05-02 21:51 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

On Fri, 28 Apr 2017, Gabriel F. T. Gomes wrote:

> +/* public entry points.  */
> +#define asinhl asinhf128
> +#define atanl atanf128
> +#define atanl atanf128
> +#define cbrtl cbrtf128
> +#define ceill ceilf128
> +#define ceill ceilf128
> +#define copysignl copysignf128
> +#define copysignl copysignf128
> +#define cosl cosf128
> +#define cosl cosf128

You have duplicate definitions of several macros (atanl ceill copysignl 
cosl).

> +#define finitel finitef128
> +#define isinfl isinff128
> +#define isnanl isnanf128

These only have public names for long double, not for _Float128; it might 
be better to rename to *do_not_use names as for nexttoward.  (In the 
nexttoward case the function shouldn't be built at all for _Float128; 
likewise scalb, significand.  Of course you might later need to build them 
for long double = float128, but public *f128 interfaces still wouldn't be 
exported for them.  In the cases of finite, isinf, isnan, the __*f128 
interfaces exist, but no public ABI without the leading __.)

> +#define fpclassifyl fpclassifyf128
> +#define issignalingl issignalingf128

And fpclassifyl, issignalingl don't exist; no need for these #defines.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 3/8] Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__
  2017-04-28 21:36 ` [PATCH v2 3/8] Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__ Gabriel F. T. Gomes
@ 2017-05-03 11:36   ` Joseph Myers
  2017-05-08 18:23     ` [PATCH v3 2/2] " Gabriel F. T. Gomes
  0 siblings, 1 reply; 43+ messages in thread
From: Joseph Myers @ 2017-05-03 11:36 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

On Fri, 28 Apr 2017, Gabriel F. T. Gomes wrote:

> diff --git a/bits/libc-header-start.h b/bits/libc-header-start.h
> index 860225d..e1390e5 100644
> --- a/bits/libc-header-start.h
> +++ b/bits/libc-header-start.h
> @@ -59,3 +59,12 @@
>  #else
>  # define __GLIBC_USE_IEC_60559_FUNCS_EXT 0
>  #endif
> +
> +/* ISO/IEC TS 18661-3:2014 defines the

It's actually :2015 not :2014.

The comment in include/features.h listing feature test macros needs 
updating as well.

manual/creature.texi needs updating as well, either in this or in a 
subsequent patch.

(By the time the new functions are actually enabled anywhere, of course 
they will need to be documented in the libm / libc documentation.)

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 6/8] float128: Add private _Float128 declarations for libm.
  2017-04-28 21:36 ` [PATCH v2 6/8] float128: Add private _Float128 declarations for libm Gabriel F. T. Gomes
@ 2017-05-03 11:39   ` Joseph Myers
  2017-05-09 18:58     ` [PATCH v3 " Gabriel F. T. Gomes
  0 siblings, 1 reply; 43+ messages in thread
From: Joseph Myers @ 2017-05-03 11:39 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

On Fri, 28 Apr 2017, Gabriel F. T. Gomes wrote:

> From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>
> 
> 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.
> 
> 	* 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.

This bit seems out of place in this patch; bits/libm-simd-decl-stubs.h is 
an installed header and these changes would be needed to use the installed 
headers, whereas the rest of the changes in this patch are specific to 
building rather than using glibc, as indicated in the commit message.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 4/8] float128: Add public _Float128 declarations to libm.
  2017-05-02 21:40       ` Joseph Myers
@ 2017-05-04 12:58         ` Gabriel F. T. Gomes
  2017-05-04 13:34           ` Joseph Myers
  0 siblings, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-05-04 12:58 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

On Tue, 2 May 2017 21:40:27 +0000
Joseph Myers <joseph@codesourcery.com> wrote:

> On Tue, 2 May 2017, Gabriel F. T. Gomes wrote:
> 
> > > (a) Does the compiler support a particular type name (such as _Float128)?
> > > 
> > > (b) Does the compiler support some name for a type that is ABI-compatible 
> > > with _Float128 (the name possibly being __float128 or long double)?  
> > 
> > Actually, we've been using __HAVE_FLOAT128 as ((a) || (b)) and the
> > comments aren't helping.  
> 
> (a) implies (b) as I'm interpreting it (_Float128 being a possible name 
> for such a type), so that's just (b), which isn't actually something I 
> think the headers need - anything conditional in the headers should be 
> conditional on library support also being present (after all, e.g. AArch64 
> has such a type - long double, and _Float128 in GCC 7, but shouldn't 
> enable the declarations until the relevant aliases are present in the 
> library).
> 
> > What about this:
> > 
> > /* Defined if the current compiler invocation provides a 128-bit
> >    floating point type compatible with IEEE 754.  */
> > #define __HAVE_FLOAT128 0  
> 
> I'd suggest
> 
> /* 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
> 
> (Note the "default" in the comment on __HAVE_DISTINCT_FLOAT128 - I'm 
> referring to the functions that get the symbols with the C11 *f, *, *l 
> names.  If in future you support binary128 long double for powerpc64le, 
> with *l API calls mapped to __*f128 ABI calls, it's still ABI-distinct 
> from default long double in that sense, meaning that e.g. __isinff128 
> needs to be declared, __isinfl is for ibm128 and __isinff128 is for 
> float128 whatever the C names for those types.)
> 
> > > (c) Does this glibc build include support for _Float128 (that is, *f128 
> > > functions / aliases, and all the associated header pieces)?  If 
> > > ABI-distinct, the headers *should* care about this even when the functions 
> > > aren't going to be declared, because of the type-generic <math.h> macros 
> > > that might need to call __isinff128 etc.  
> > 
> > We don't have a macro that indicates that support for _Float128 is
> > provided in our glibc builds.  This information is currently implicit.
> > 
> > We now understand that this is useful for glibc users.  Do you have any
> > suggestion for the macro name?  
> 
> I'm suggesting the above macros as being only for use in other glibc 
> headers, not for users.  Users wanting to test for support can do e.g. 
> "#ifdef HUGE_VAL_F128".

Let me confirm that I understood this correctly...

On the one hand, the macros __HAVE_FLOAT128 (meaning ((b) && (c))) and
__HAVE_DISTINCT_FLOAT128 (meaning ((b) &&(d))) are not to be tested by
the users, explicitly.  On the other hand, these macros are to be
present in the installed header (floatn.h), so that, when a user
includes math.h, the user will get the declarations for *f128 functions
(if __HAVE_FLOAT128 = 1) and will indirectly access __*f128 functions
(e.g. __isinff128) through __MATH_TG macros (if
__HAVE_DISTINCT_FLOAT128 = 1).

Or are you implying that the macros __HAVE_FLOAT128 and
__HAVE_DISTINCT_FLOAT128 should not be visible at all by users (i.e.
should not be in an installed header)?

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 4/8] float128: Add public _Float128 declarations to libm.
  2017-05-04 12:58         ` Gabriel F. T. Gomes
@ 2017-05-04 13:34           ` Joseph Myers
  2017-05-09 18:49             ` [PATCH v3 " Gabriel F. T. Gomes
  0 siblings, 1 reply; 43+ messages in thread
From: Joseph Myers @ 2017-05-04 13:34 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

On Thu, 4 May 2017, Gabriel F. T. Gomes wrote:

> Let me confirm that I understood this correctly...
> 
> On the one hand, the macros __HAVE_FLOAT128 (meaning ((b) && (c))) and
> __HAVE_DISTINCT_FLOAT128 (meaning ((b) &&(d))) are not to be tested by
> the users, explicitly.  On the other hand, these macros are to be
> present in the installed header (floatn.h), so that, when a user
> includes math.h, the user will get the declarations for *f128 functions
> (if __HAVE_FLOAT128 = 1) and will indirectly access __*f128 functions
> (e.g. __isinff128) through __MATH_TG macros (if
> __HAVE_DISTINCT_FLOAT128 = 1).

Yes.  They are in installed headers, but as with all __* symbols in 
installed headers, they do not form a public API, should not be used 
directly by users, and so are liable to change at any time if a different 
approach seems more convenient in future.

(And there is no guarantee that any future support for other _FloatN / 
_FloatNx types would use such macros, although the design is intended to 
be suitable for other such types as well.  __HAVE_FLOAT32 might end up 
always being defined to 1 when *f32 support is added, since float always 
has a suitable ABI, but if you have a macro __GLIBC_USE_FLOAT such as I 
suggested, you'd still want to have __HAVE_FLOAT32 defined so that 
__GLIBC_USE_FLOAT (32) can be used.  There might be no need for 
__HAVE_DISTINCT_FLOAT32, however.)

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v3 1/2] float128: Add _Float128 make bits to libm.
  2017-05-02 20:33       ` Joseph Myers
@ 2017-05-08 18:22         ` Gabriel F. T. Gomes
  2017-05-08 19:05           ` Tulio Magno Quites Machado Filho
  2017-05-08 21:24           ` Joseph Myers
  0 siblings, 2 replies; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-05-08 18:22 UTC (permalink / raw)
  To: libc-alpha

From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>

Changes since v2:

  - Fix alphabetical order in sysdeps/ieee754/float128/Versions.
  - Add missing functions to sysdeps/ieee754/float128/Versions:
    __exp2f128_finite, __iscanonicalf128, canonicalizef128,
    exp2f128, fmaxmagf128, fminmagf128, roundevenf128.

-- 8< --
This adds the appropriate common bits for a platform to
enable float128 and expose ABI.

2016-10-21  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
	    Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>

	* math/Makefile:
	(type-float128-suffix): New variable
	(type-float128-routines): Likewise
	(type-float128-yes): Likewise
	(types): Append float128 if supported
	(types-basic): New variable to control the use of templates for
	float, double, and long double, but not for float128 or newer types.
	(type-basic-foreach): Likewise.

	* sysdeps/ieee754/float128/Makeconfig: New file.
	* sysdeps/ieee754/float128/Versions: New file.
---
 math/Makefile                       |  16 +++-
 sysdeps/ieee754/float128/Makeconfig |   3 +
 sysdeps/ieee754/float128/Versions   | 146 ++++++++++++++++++++++++++++++++++++
 3 files changed, 163 insertions(+), 2 deletions(-)
 create mode 100644 sysdeps/ieee754/float128/Makeconfig
 create mode 100644 sysdeps/ieee754/float128/Versions

diff --git a/math/Makefile b/math/Makefile
index 97080a7..634c619 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -100,7 +100,7 @@ libm-compat-calls =							\
 # Finally, note that types is an intentionally recursive variable.
 # We only know the full set of supported types for the target machine
 # after the Rules makefile has been parsed.
-types = $(type-ldouble-$(long-double-fcts)) double float
+types-basic = $(type-ldouble-$(long-double-fcts)) double float
 
 # long double support
 type-ldouble-suffix := l
@@ -117,12 +117,23 @@ type-double-routines := branred doasin dosincos halfulp mpa mpatan2	\
 type-float-suffix := f
 type-float-routines := k_rem_pio2f
 
+# _Float128 support
+type-float128-suffix := f128
+type-float128-routines := t_sincosf128 k_sincosf128
+type-float128-yes := float128
+types = $(types-basic) $(type-float128-$(float128-fcts))
+
+# For each of the basic types (float, double, long double), replace the
+# occurrences of 'F' in arg 1 with the appropriate suffix for the type.
+type-basic-foreach = $(foreach t, $(types-basic), \
+		       $(subst F,$(type-$(t)-suffix),$(1)))
 
 # Apply suffix to each type in arg 1
 type-foreach = $(foreach t,$(types),$(subst F,$(type-$(t)-suffix),$(1)))
 
 libm-routines = $(strip $(libm-support)					\
-			$(call type-foreach, $(libm-compat-calls))	\
+			$(call type-basic-foreach,			\
+			       $(libm-compat-calls))			\
 			$(call type-foreach, $(libm-calls))		\
 			$(foreach t, $(types), $(type-$(t)-routines))) 	\
 
@@ -543,6 +554,7 @@ endif
 CFLAGS-s_modf.c += -fsignaling-nans
 CFLAGS-s_modff.c += -fsignaling-nans
 CFLAGS-s_modfl.c += -fsignaling-nans
+CFLAGS-s_modff128.c += -fsignaling-nans
 
 # The -lieee library is actually an object file.
 # The module just defines the _LIB_VERSION_ variable.
diff --git a/sysdeps/ieee754/float128/Makeconfig b/sysdeps/ieee754/float128/Makeconfig
new file mode 100644
index 0000000..6c385d2
--- /dev/null
+++ b/sysdeps/ieee754/float128/Makeconfig
@@ -0,0 +1,3 @@
+# Include this earlier so it can be used earlier in Makefiles,
+# and sysdep/ makefiles.
+float128-fcts = yes
diff --git a/sysdeps/ieee754/float128/Versions b/sysdeps/ieee754/float128/Versions
new file mode 100644
index 0000000..b6842c6
--- /dev/null
+++ b/sysdeps/ieee754/float128/Versions
@@ -0,0 +1,146 @@
+%include <float128-abi.h>
+%ifndef FLOAT128_VERSION
+% error "float128-abi.h must define FLOAT128_VERSION"
+%endif
+libm {
+  FLOAT128_VERSION {
+    __acosf128_finite;
+    __acoshf128_finite;
+    __asinf128_finite;
+    __atan2f128_finite;
+    __atanhf128_finite;
+    __coshf128_finite;
+    __exp10f128_finite;
+    __exp2f128_finite;
+    __expf128_finite;
+    __finitef128;
+    __fmodf128_finite;
+    __fpclassifyf128;
+    __gammaf128_r_finite;
+    __hypotf128_finite;
+    __iscanonicalf128;
+    __iseqsigf128;
+    __isinff128;
+    __isnanf128;
+    __issignalingf128;
+    __j0f128_finite;
+    __j1f128_finite;
+    __jnf128_finite;
+    __lgammaf128_r_finite;
+    __log10f128_finite;
+    __log2f128_finite;
+    __logf128_finite;
+    __powf128_finite;
+    __remainderf128_finite;
+    __signbitf128;
+    __sinhf128_finite;
+    __sqrtf128_finite;
+    __y0f128_finite;
+    __y1f128_finite;
+    __ynf128_finite;
+    acosf128;
+    acoshf128;
+    asinf128;
+    asinhf128;
+    atan2f128;
+    atanf128;
+    atanhf128;
+    cabsf128;
+    cacosf128;
+    cacoshf128;
+    canonicalizef128;
+    cargf128;
+    casinf128;
+    casinhf128;
+    catanf128;
+    catanhf128;
+    cbrtf128;
+    ccosf128;
+    ccoshf128;
+    ceilf128;
+    cexpf128;
+    cimagf128;
+    clog10f128;
+    clogf128;
+    conjf128;
+    copysignf128;
+    cosf128;
+    coshf128;
+    cpowf128;
+    cprojf128;
+    crealf128;
+    csinf128;
+    csinhf128;
+    csqrtf128;
+    ctanf128;
+    ctanhf128;
+    erfcf128;
+    erff128;
+    exp10f128;
+    exp2f128;
+    expf128;
+    expm1f128;
+    fabsf128;
+    fdimf128;
+    floorf128;
+    fmaf128;
+    fmaxf128;
+    fmaxmagf128;
+    fminf128;
+    fminmagf128;
+    fmodf128;
+    frexpf128;
+    fromfpf128;
+    fromfpxf128;
+    getpayloadf128;
+    hypotf128;
+    ilogbf128;
+    j0f128;
+    j1f128;
+    jnf128;
+    ldexpf128;
+    lgammaf128;
+    lgammaf128_r;
+    llogbf128;
+    llrintf128;
+    llroundf128;
+    log10f128;
+    log1pf128;
+    log2f128;
+    logbf128;
+    logf128;
+    lrintf128;
+    lroundf128;
+    modff128;
+    nanf128;
+    nearbyintf128;
+    nextafterf128;
+    nextdownf128;
+    nextupf128;
+    powf128;
+    remainderf128;
+    remquof128;
+    rintf128;
+    roundevenf128;
+    roundf128;
+    scalblnf128;
+    scalbnf128;
+    setpayloadf128;
+    setpayloadsigf128;
+    sincosf128;
+    sinf128;
+    sinhf128;
+    sqrtf128;
+    tanf128;
+    tanhf128;
+    tgammaf128;
+    totalorderf128;
+    totalordermagf128;
+    truncf128;
+    ufromfpf128;
+    ufromfpxf128;
+    y0f128;
+    y1f128;
+    ynf128;
+  }
+}
-- 
2.4.11

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v3 2/2] Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__
  2017-05-03 11:36   ` Joseph Myers
@ 2017-05-08 18:23     ` Gabriel F. T. Gomes
  2017-05-08 21:13       ` Joseph Myers
  0 siblings, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-05-08 18:23 UTC (permalink / raw)
  To: libc-alpha

From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>

Changes since v2:

  - Fix year in the comments in bits/libc-header-start.h.
  - Add description to include/features.h and manual/creature.texi.

-- 8< --
This macro is defined by TS 18661-3 for supporting the _FloatN and
_FloatNx types, as well as the functions suffixed with fN.

2017-02-23  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>

	* bits/libc-header-start.h:
	(__GLIBC_USE_IEC_60559_TYPES_EXT): New macro.
---
 bits/libc-header-start.h | 9 +++++++++
 include/features.h       | 2 ++
 manual/creature.texi     | 9 +++++++++
 3 files changed, 20 insertions(+)

diff --git a/bits/libc-header-start.h b/bits/libc-header-start.h
index 860225d..0ce16e2 100644
--- a/bits/libc-header-start.h
+++ b/bits/libc-header-start.h
@@ -59,3 +59,12 @@
 #else
 # define __GLIBC_USE_IEC_60559_FUNCS_EXT 0
 #endif
+
+/* ISO/IEC TS 18661-3:2015 defines the
+   __STDC_WANT_IEC_60559_TYPES_EXT__ macro.  */
+#undef __GLIBC_USE_IEC_60559_TYPES_EXT
+#if defined __USE_GNU || defined __STDC_WANT_IEC_60559_TYPES_EXT__
+# define __GLIBC_USE_IEC_60559_TYPES_EXT 1
+#else
+# define __GLIBC_USE_IEC_60559_TYPES_EXT 0
+#endif
diff --git a/include/features.h b/include/features.h
index 7de4089..972cbd2 100644
--- a/include/features.h
+++ b/include/features.h
@@ -30,6 +30,8 @@
 			Extensions to ISO C11 from TS 18661-1:2014.
    __STDC_WANT_IEC_60559_FUNCS_EXT__
 			Extensions to ISO C11 from TS 18661-4:2015.
+   __STDC_WANT_IEC_60559_TYPES_EXT__
+			Extensions to ISO C11 from TS 18661-3:2015.
 
    _POSIX_SOURCE	IEEE Std 1003.1.
    _POSIX_C_SOURCE	If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
diff --git a/manual/creature.texi b/manual/creature.texi
index 5048886..23218bb 100644
--- a/manual/creature.texi
+++ b/manual/creature.texi
@@ -192,6 +192,15 @@ enabled.  Only some of the features from this TS are supported by
 @end defvr
 
 @comment (none)
+@comment ISO
+@defvr Macro __STDC_WANT_IEC_60559_TYPES_EXT__
+If you define this macro, features from ISO/IEC TS 18661-3:2015
+(Floating-point extensions for C: Interchange and extended types) are
+enabled.  Only some of the features from this TS are supported by
+@theglibc{}.
+@end defvr
+
+@comment (none)
 @comment GNU
 @defvr Macro _GNU_SOURCE
 If you define this macro, everything is included: @w{ISO C89}, @w{ISO
-- 
2.4.11

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v3 1/2] float128: Add _Float128 make bits to libm.
  2017-05-08 18:22         ` [PATCH v3 1/2] " Gabriel F. T. Gomes
@ 2017-05-08 19:05           ` Tulio Magno Quites Machado Filho
  2017-05-08 20:53             ` Gabriel F. T. Gomes
  2017-05-08 21:24           ` Joseph Myers
  1 sibling, 1 reply; 43+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2017-05-08 19:05 UTC (permalink / raw)
  To: Gabriel F. T. Gomes, libc-alpha

"Gabriel F. T. Gomes" <gftg@linux.vnet.ibm.com> writes:

> diff --git a/sysdeps/ieee754/float128/Versions b/sysdeps/ieee754/float128/Versions
> new file mode 100644
> index 0000000..b6842c6
> --- /dev/null
> +++ b/sysdeps/ieee754/float128/Versions
> @@ -0,0 +1,146 @@
> +%include <float128-abi.h>
> +%ifndef FLOAT128_VERSION
> +% error "float128-abi.h must define FLOAT128_VERSION"
> +%endif
> +libm {
> +  FLOAT128_VERSION {
> +    __acosf128_finite;
> +    __acoshf128_finite;
> +    __asinf128_finite;
> +    __atan2f128_finite;
> +    __atanhf128_finite;
> +    __coshf128_finite;
> +    __exp10f128_finite;
> +    __exp2f128_finite;
> +    __expf128_finite;
> +    __finitef128;
> +    __fmodf128_finite;
> +    __fpclassifyf128;
> +    __gammaf128_r_finite;
> +    __hypotf128_finite;
> +    __iscanonicalf128;

Isn't it possible to reuse the implementation from bits/iscanonical.h and
avoid exporting this symbol?
I understand this would require to install iscanonicalf128.h with the new
implementation.

Otherwise, LGTM.

-- 
Tulio Magno

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v3 1/2] float128: Add _Float128 make bits to libm.
  2017-05-08 19:05           ` Tulio Magno Quites Machado Filho
@ 2017-05-08 20:53             ` Gabriel F. T. Gomes
  2017-05-08 21:11               ` Joseph Myers
  0 siblings, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-05-08 20:53 UTC (permalink / raw)
  To: Tulio Magno Quites Machado Filho; +Cc: libc-alpha

On Mon, 08 May 2017 16:05:15 -0300
"Tulio Magno Quites Machado Filho" <tuliom@linux.vnet.ibm.com> wrote:

> "Gabriel F. T. Gomes" <gftg@linux.vnet.ibm.com> writes:
> 
> > diff --git a/sysdeps/ieee754/float128/Versions
> > b/sysdeps/ieee754/float128/Versions new file mode 100644
> > [...]
> > +    __iscanonicalf128;  
> 
> Isn't it possible to reuse the implementation from bits/iscanonical.h and
> avoid exporting this symbol?
> I understand this would require to install iscanonicalf128.h with the new
> implementation.

You are right.  I can provide __iscanonicalf128 as a macro through
iscanonicalf128.h, then the line above (in the Versions file) is not
necessary.

Is this patch OK with this change?

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v3 1/2] float128: Add _Float128 make bits to libm.
  2017-05-08 20:53             ` Gabriel F. T. Gomes
@ 2017-05-08 21:11               ` Joseph Myers
  0 siblings, 0 replies; 43+ messages in thread
From: Joseph Myers @ 2017-05-08 21:11 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: Tulio Magno Quites Machado Filho, libc-alpha

On Mon, 8 May 2017, Gabriel F. T. Gomes wrote:

> On Mon, 08 May 2017 16:05:15 -0300
> "Tulio Magno Quites Machado Filho" <tuliom@linux.vnet.ibm.com> wrote:
> 
> > "Gabriel F. T. Gomes" <gftg@linux.vnet.ibm.com> writes:
> > 
> > > diff --git a/sysdeps/ieee754/float128/Versions
> > > b/sysdeps/ieee754/float128/Versions new file mode 100644
> > > [...]
> > > +    __iscanonicalf128;  
> > 
> > Isn't it possible to reuse the implementation from bits/iscanonical.h and
> > avoid exporting this symbol?
> > I understand this would require to install iscanonicalf128.h with the new
> > implementation.
> 
> You are right.  I can provide __iscanonicalf128 as a macro through
> iscanonicalf128.h, then the line above (in the Versions file) is not
> necessary.

There should be no iscanonicalf128.h (or __iscanonicalf128 function).  
Rather, bits/iscanonical.h defines the iscanonical macro in an appropriate 
way for the applicable glibc configuration.  That means that 
sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h will need to define 
__iscanonicalf128 as a macro (and math.h will need to define __MATH_TG 
appropriately for the case where _Float128 is supported and ABI-distinct 
from the other types).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v3 2/2] Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__
  2017-05-08 18:23     ` [PATCH v3 2/2] " Gabriel F. T. Gomes
@ 2017-05-08 21:13       ` Joseph Myers
  2017-05-09 14:56         ` Gabriel F. T. Gomes
  0 siblings, 1 reply; 43+ messages in thread
From: Joseph Myers @ 2017-05-08 21:13 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

On Mon, 8 May 2017, Gabriel F. T. Gomes wrote:

> From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>
> 
> Changes since v2:
> 
>   - Fix year in the comments in bits/libc-header-start.h.
>   - Add description to include/features.h and manual/creature.texi.
> 
> -- 8< --
> This macro is defined by TS 18661-3 for supporting the _FloatN and
> _FloatNx types, as well as the functions suffixed with fN.
> 
> 2017-02-23  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
> 
> 	* bits/libc-header-start.h:
> 	(__GLIBC_USE_IEC_60559_TYPES_EXT): New macro.

This patch is OK with an updated ChangeLog entry (reflecting all the files 
changed).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v3 1/2] float128: Add _Float128 make bits to libm.
  2017-05-08 18:22         ` [PATCH v3 1/2] " Gabriel F. T. Gomes
  2017-05-08 19:05           ` Tulio Magno Quites Machado Filho
@ 2017-05-08 21:24           ` Joseph Myers
  2017-05-09 14:54             ` Gabriel F. T. Gomes
  1 sibling, 1 reply; 43+ messages in thread
From: Joseph Myers @ 2017-05-08 21:24 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

On Mon, 8 May 2017, Gabriel F. T. Gomes wrote:

> From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>
> 
> Changes since v2:
> 
>   - Fix alphabetical order in sysdeps/ieee754/float128/Versions.
>   - Add missing functions to sysdeps/ieee754/float128/Versions:
>     __exp2f128_finite, __iscanonicalf128, canonicalizef128,
>     exp2f128, fmaxmagf128, fminmagf128, roundevenf128.
> 
> -- 8< --
> This adds the appropriate common bits for a platform to
> enable float128 and expose ABI.
> 
> 2016-10-21  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
> 	    Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
> 
> 	* math/Makefile:
> 	(type-float128-suffix): New variable
> 	(type-float128-routines): Likewise
> 	(type-float128-yes): Likewise
> 	(types): Append float128 if supported
> 	(types-basic): New variable to control the use of templates for
> 	float, double, and long double, but not for float128 or newer types.
> 	(type-basic-foreach): Likewise.
> 
> 	* sysdeps/ieee754/float128/Makeconfig: New file.
> 	* sysdeps/ieee754/float128/Versions: New file.

OK without __iscanonicalf128.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v3 1/2] float128: Add _Float128 make bits to libm.
  2017-05-08 21:24           ` Joseph Myers
@ 2017-05-09 14:54             ` Gabriel F. T. Gomes
  0 siblings, 0 replies; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-05-09 14:54 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

On Mon, 8 May 2017 21:24:41 +0000
Joseph Myers <joseph@codesourcery.com> wrote:

> On Mon, 8 May 2017, Gabriel F. T. Gomes wrote:
> >
> > 	* sysdeps/ieee754/float128/Versions: New file.  
> 
> OK without __iscanonicalf128.

Thanks.  Pushed with the change as 26265c3bce73.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v3 2/2] Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__
  2017-05-08 21:13       ` Joseph Myers
@ 2017-05-09 14:56         ` Gabriel F. T. Gomes
  0 siblings, 0 replies; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-05-09 14:56 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

On Mon, 8 May 2017 21:13:02 +0000
Joseph Myers <joseph@codesourcery.com> wrote:

> On Mon, 8 May 2017, Gabriel F. T. Gomes wrote:
> >
> > 2017-02-23  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
> > 
> > 	* bits/libc-header-start.h:
> > 	(__GLIBC_USE_IEC_60559_TYPES_EXT): New macro.  
> 
> This patch is OK with an updated ChangeLog entry (reflecting all the
> files changed).

Thanks.  Pushed with updated ChangeLog entry as 4fc12f0eda59.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v3 4/8] float128: Add public _Float128 declarations to libm.
  2017-05-04 13:34           ` Joseph Myers
@ 2017-05-09 18:49             ` Gabriel F. T. Gomes
  2017-05-09 22:56               ` Joseph Myers
  0 siblings, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-05-09 18:49 UTC (permalink / raw)
  To: libc-alpha

From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>

Changes since v2:

  - Refactored the macros that enable support for float128 in the
    library to __HAVE_FLOAT128 and __HAVE_DISTINCT_FLOAT128.
  - Enabled declarations of functions protected by IEC_60559_BFP_TYPES
    when IEC_60559_TYPES_EXT is defined.
  - Do not define L in a public header.
  - Fixed comment about __builtin_huge_valf128.
  - Fixed Copyright years.

-- 8< --
This introduces the machine-dependent bits/floatn.h to control
the inclusion of _Float128 ABI.

	* bits/floatn.h: New file.
	* bits/floatn-compat.h: Likewise.
	* 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,
	bits/floatn-compat.h and bits/huge_val_flt128.h.

	* math/bits/cmathcalls.h (_Mdouble_complex_): Only define if not
	defined.

	* math/mathcalls.h (drem): Only define if __FLOATN_TYPE
	not defined.
	(gamma): Likewise.
	(nexttoward): Likewise.
	(significand): Likewise.
	(pow10): Likewise.
	(scalb): Likewise.
	(finite): Likewise.
	(isinf): Likewise.
	(isnan): Likewise.

	* math/complex.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: Define and undefine __FLOATN_TYPE as
	needed for _FloatN types. Add prototypes for _Float128.
	[__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_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(__f128): New macro to apply proper _Float128 literal suffix
	depending on compiler version for __USE_GNU enabled constants.
	[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(M_Ef128): New _GNU_SOURCE enabled macro.
	[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(M_LOG2Ef128): Likewise.
	[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(M_LOG10Ef128): Likewise.
	[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(M_LN2f128): Likewise.
	[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(M_LN10f128): Likewise.
	[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(M_PIf128): Likewise.
	[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(M_PI_2f128): Likewise.
	[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(M_PI_4f128): Likewise.
	[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(M_1_PIf128): Likewise.
	[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(M_2_PIf128): Likewise.
	[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(M_SQRT2f128): Likewise.
	[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(M_SQRT1_2f128): Likewise.

	* sysdeps/powerpc/powerpc64/bits/floatn-compat.h: New file to
	localize workarounds for old compilers.
---
 bits/floatn-compat.h                             | 20 ++++++++
 bits/floatn.h                                    | 30 ++++++++++++
 bits/huge_val_flt128.h                           | 23 +++++++++
 bits/libm-simd-decl-stubs.h                      |  6 +++
 math/Makefile                                    |  3 +-
 math/bits/cmathcalls.h                           |  4 +-
 math/bits/mathcalls.h                            | 36 +++++++++-----
 math/complex.h                                   | 27 ++++++++++-
 math/math.h                                      | 61 +++++++++++++++++++++++-
 sysdeps/powerpc/powerpc64le/bits/floatn-compat.h | 57 ++++++++++++++++++++++
 10 files changed, 250 insertions(+), 17 deletions(-)
 create mode 100644 bits/floatn-compat.h
 create mode 100644 bits/floatn.h
 create mode 100644 bits/huge_val_flt128.h
 create mode 100644 sysdeps/powerpc/powerpc64le/bits/floatn-compat.h

diff --git a/bits/floatn-compat.h b/bits/floatn-compat.h
new file mode 100644
index 0000000..2fc7d35
--- /dev/null
+++ b/bits/floatn-compat.h
@@ -0,0 +1,20 @@
+/* Define _FloatN macros for ISO/IEC TS-18661-3 support, when needed.
+   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/>.  */
+
+/* Nothing to be done, here.  Each platform that provides _FloatN support
+   defines the required macros in sysdeps.  */
diff --git a/bits/floatn.h b/bits/floatn.h
new file mode 100644
index 0000000..94fc357
--- /dev/null
+++ b/bits/floatn.h
@@ -0,0 +1,30 @@
+/* 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 for GCC versions which support the __float128 type, but not
+   _Complex __float128.  This resolves to a complex binary128 type.  */
+#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..621050a 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/floatn-compat.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..745f121 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.  */
+# ifndef __FLOATN_TYPE
 __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.  */ \
+      && !defined __FLOATN_TYPE
 /* 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
 
+# ifndef __FLOATN_TYPE
 /* 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.  */ \
+      && !defined __FLOATN_TYPE
 /* 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)
+# ifndef __FLOATN_TYPE
 /* 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 && !defined __FLOATN_TYPE
 __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__));
 # endif
 
-#if __GLIBC_USE (IEC_60559_BFP_EXT)
+#if __GLIBC_USE (IEC_60559_BFP_EXT) || defined __FLOATN_TYPE
 /* 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) || defined __FLOATN_TYPE
 /* 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) || defined __FLOATN_TYPE
 /* 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))  \
+     && !defined __FLOATN_TYPE
 /* 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..9a730d3 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,23 @@ __BEGIN_DECLS
 #undef	_Mdouble_
 #undef	__MATH_PRECNAME
 
+#if __HAVE_FLOAT128 && __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..60a3bda 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>
@@ -206,6 +214,7 @@ enum
   extern type __MATH_PRECNAME(function,suffix) args __THROW
 
 #define _Mdouble_		double
+#undef __FLOATN_TYPE
 #define __MATH_PRECNAME(name,r)	__CONCAT(name,r)
 #define __MATH_DECLARING_DOUBLE  1
 #include <bits/mathcalls-helper-functions.h>
@@ -223,6 +232,7 @@ enum
 # ifndef _Mfloat_
 #  define _Mfloat_		float
 # endif
+# undef __FLOATN_TYPE
 # define _Mdouble_		_Mfloat_
 # define __MATH_PRECNAME(name,r) name##f##r
 # define __MATH_DECLARING_DOUBLE  0
@@ -266,6 +276,7 @@ extern long double __REDIRECT_NTH (nexttowardl,
 #  ifndef _Mlong_double_
 #   define _Mlong_double_	long double
 #  endif
+#  undef __FLOATN_TYPE
 #  define _Mdouble_		_Mlong_double_
 #  define __MATH_PRECNAME(name,r) name##l##r
 #  define __MATH_DECLARING_DOUBLE  0
@@ -279,6 +290,28 @@ extern long double __REDIRECT_NTH (nexttowardl,
 # 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
+# ifndef _Mfloat128_
+#  define _Mfloat128_		_Float128
+# endif
+# define __FLOATN_TYPE		1
+# define _Mdouble_		_Mfloat128_
+# define __MATH_PRECNAME(name,r) name##f128##r
+# define __MATH_DECLARING_DOUBLE  0
+# include <bits/mathcalls-helper-functions.h>
+# if __GLIBC_USE (IEC_60559_TYPES_EXT)
+#  include <bits/mathcalls.h>
+# endif
+# undef __FLOATN_TYPE
+# undef _Mdouble_
+# undef __MATH_PRECNAME
+# undef __MATH_DECLARING_DOUBLE
+#endif /* __HAVE_DISTINCT_FLOAT128.  */
+
 #undef	__MATHDECL_1
 #undef	__MATHDECL
 #undef	__MATHCALL
@@ -377,7 +410,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 +568,26 @@ extern int matherr (struct exception *__exc);
 # define M_SQRT1_2l	0.707106781186547524400844362104849039L /* 1/sqrt(2) */
 #endif
 
+#if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT) && defined __USE_GNU
+# if defined __GNUC__ && !__GNUC_PREREQ (7,0)
+#  define __f128(x) x ## q
+# else
+#  define __f128(x) x ## f128
+# endif
+# 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
diff --git a/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h b/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h
new file mode 100644
index 0000000..7a711a8
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h
@@ -0,0 +1,57 @@
+/* Define _FloatN macros for ISO/IEC TS-18661-3 support for powerpc64le.
+   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/>.  */
+
+#if __HAVE_FLOAT128
+
+/* The type _Float128, as well as the literal suffix (F128), exist for powerpc
+   only since GCC 7.0.  */
+# if !__GNUC_PREREQ (7, 0)
+#  define __L(x) x##Q
+typedef __float128 _Float128;
+# else
+#  define __L(x) x##F128
+# endif
+
+/* Add a typedef for older GCC compilers which don't natively support
+   _Complex _Float128.  */
+# if !__GNUC_PREREQ (7, 0) && !defined __CFLOAT128
+typedef _Complex float __cfloat128 __attribute__ ((mode (KC)));
+#  define __CFLOAT128 __cfloat128
+# endif
+
+/* Builtin __builtin_huge_valf128 doesn't exist before GCC 7.0.  */
+# if !__GNUC_PREREQ (7, 0)
+#  define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ())
+# endif
+
+/* The following builtins (suffixed with 'q') are available in GCC >= 6.2,
+   which is the minimum version required for float128 support on powerpc64le.
+   Since GCC 7.0 the builtins suffixed with f128 are also available, then
+   there is no need to redefined them.  */
+# if !__GNUC_PREREQ (7, 0)
+#  define __builtin_copysignf128 __builtin_copysignq
+#  define __builtin_fabsf128 __builtin_fabsq
+#  define __builtin_inff128 __builtin_infq
+#  define __builtin_nanf128 __builtin_nanq
+# endif
+
+/* __builtin_signbit is type generic in GCC 6.2, which is the minimum
+   version required for float128 support on powerpc64le.  */
+# define __builtin_signbitf128 __builtin_signbit
+
+#endif
-- 
2.4.11

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v3 5/8] float128: Include math-finite.h for _Float128
  2017-04-28 22:53   ` Joseph Myers
@ 2017-05-09 18:54     ` Gabriel F. T. Gomes
  2017-05-09 22:57       ` Joseph Myers
  0 siblings, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-05-09 18:54 UTC (permalink / raw)
  To: libc-alpha

Changes since v2:

  - Do not declare pow10f128, gammaf128, and scalbf128.

-- 8< --
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.

2017-05-09  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>

	* math/math.h: Include bits/math-finite.h for float128.
	(__MATH_DECLARING_FLOAT128): Define to control declaration of
	float128 functions.
	* math/bits/math-finite.h (pow10): Do not declare for float128.
	(gamma): Likewise.
	(scalb): Likewise.
---
 math/bits/math-finite.h | 13 ++++++++-----
 math/math.h             | 21 +++++++++++++++++++++
 2 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/math/bits/math-finite.h b/math/bits/math-finite.h
index 29f2f2e..17b2d73 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_FLOAT128
 __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_FLOAT128
 /* 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_FLOAT128
 /* scalb.  */
 __MATH_REDIRCALL (scalb, , (_Mdouble_, _Mdouble_));
 #endif
diff --git a/math/math.h b/math/math.h
index 60a3bda..4fc96ac 100644
--- a/math/math.h
+++ b/math/math.h
@@ -624,11 +624,13 @@ extern int matherr (struct exception *__exc);
 # define _Mdouble_ double
 # define __MATH_DECLARING_DOUBLE 1
 # define __MATH_DECLARING_LDOUBLE 0
+# define __MATH_DECLARING_FLOAT128 0
 # define _MSUF_
 # include <bits/math-finite.h>
 # undef _Mdouble_
 # undef __MATH_DECLARING_DOUBLE
 # undef __MATH_DECLARING_LDOUBLE
+# undef __MATH_DECLARING_FLOAT128
 # undef _MSUF_
 
 /* When __USE_ISOC99 is defined, include math-finite for float and
@@ -639,11 +641,13 @@ extern int matherr (struct exception *__exc);
 #  define _Mdouble_ float
 #  define __MATH_DECLARING_DOUBLE 0
 #  define __MATH_DECLARING_LDOUBLE 0
+#  define __MATH_DECLARING_FLOAT128 0
 #  define _MSUF_ f
 #  include <bits/math-finite.h>
 #  undef _Mdouble_
 #  undef __MATH_DECLARING_DOUBLE
 #  undef __MATH_DECLARING_LDOUBLE
+#  undef __MATH_DECLARING_FLOAT128
 #  undef _MSUF_
 
 /* Include bits/math-finite.h for long double.  */
@@ -651,15 +655,32 @@ extern int matherr (struct exception *__exc);
 #   define _Mdouble_ long double
 #   define __MATH_DECLARING_DOUBLE 0
 #   define __MATH_DECLARING_LDOUBLE 1
+#   define __MATH_DECLARING_FLOAT128 0
 #   define _MSUF_ l
 #   include <bits/math-finite.h>
 #   undef _Mdouble_
 #   undef __MATH_DECLARING_DOUBLE
 #   undef __MATH_DECLARING_LDOUBLE
+#   undef __MATH_DECLARING_FLOAT128
 #   undef _MSUF_
 #  endif
 
 # endif /* __USE_ISOC99.  */
+
+/* Include bits/math-finite.h for float128.  */
+# if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
+#  define _Mdouble_ _Float128
+#  define __MATH_DECLARING_DOUBLE 0
+#  define __MATH_DECLARING_LDOUBLE 0
+#  define __MATH_DECLARING_FLOAT128 1
+#  define _MSUF_ f128
+#  include <bits/math-finite.h>
+#  undef _Mdouble_
+#  undef __MATH_DECLARING_DOUBLE
+#  undef __MATH_DECLARING_LDOUBLE
+#  undef __MATH_DECLARING_FLOAT128
+#  undef _MSUF_
+# endif
 #endif /* __FINITE_MATH_ONLY__ > 0.  */
 
 #ifdef __USE_ISOC99
-- 
2.4.11

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v3 6/8] float128: Add private _Float128 declarations for libm.
  2017-05-03 11:39   ` Joseph Myers
@ 2017-05-09 18:58     ` Gabriel F. T. Gomes
  2017-05-09 23:04       ` Joseph Myers
  0 siblings, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-05-09 18:58 UTC (permalink / raw)
  To: libc-alpha

From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>

Changes since v2:

  - The changes to bits/libm-simd-decl-stubs.h were moved to patch 4/8.

-- 8< --
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 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.
	(signbitf128): Likewise.
	(__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.
---
 include/complex.h                             |  7 ++++
 include/float.h                               | 31 +++++++++++++++
 include/math.h                                | 13 +++++++
 sysdeps/generic/fix-fp-int-convert-overflow.h |  2 +
 sysdeps/generic/math-type-macros-float128.h   | 43 ++++++++++++++++++++
 sysdeps/generic/math_private.h                | 56 ++++++++++++++++++++++++++-
 sysdeps/generic/math_private_calls.h          |  4 +-
 sysdeps/ieee754/ldbl-opt/s_sin.c              |  1 +
 8 files changed, 154 insertions(+), 3 deletions(-)
 create mode 100644 include/float.h
 create mode 100644 sysdeps/generic/math-type-macros-float128.h

diff --git a/include/complex.h b/include/complex.h
index 082e71f..238ecbe 100644
--- a/include/complex.h
+++ b/include/complex.h
@@ -8,6 +8,13 @@
 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
+#   ifdef __CFLOAT128
+extern __CFLOAT128 __kernel_casinhf128 (__CFLOAT128 z, int adj);
+#   else
+extern _Complex _Float128 __kernel_casinhf128 (_Complex _Float128 z, int adj);
+#   endif
+#  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 a4f5562..83debf8 100644
--- a/include/math.h
+++ b/include/math.h
@@ -21,6 +21,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)
@@ -38,5 +44,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/math-type-macros-float128.h b/sysdeps/generic/math-type-macros-float128.h
new file mode 100644
index 0000000..425cd73
--- /dev/null
+++ b/sysdeps/generic/math-type-macros-float128.h
@@ -0,0 +1,43 @@
+/* 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
+   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_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
+
+#ifdef __CFLOAT128
+# define CFLOAT __CFLOAT128
+#else
+# define CFLOAT _Complex _Float128
+#endif
+
+#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..5028bfa 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,46 @@ do {								\
 #undef _MSUF_
 #undef _Mdouble_
 
+#if __HAVE_DISTINCT_FLOAT128
+# define _Mdouble_ _Float128
+# define _MSUF_ f128
+# define __MATH_DECLARING_FLOAT128
+# include <math_private_calls.h>
+# undef __MATH_DECLARING_FLOAT128
+# 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);
+}
+extern inline _Float128
+signbitf128 (_Float128 x)
+{
+  return __builtin_signbit (x);
+}
+#endif
+
+
+
 /* fdlibm kernel function */
 extern double __kernel_standard (double,double,int);
 extern float __kernel_standard_f (float,float,int);
@@ -263,13 +306,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..eaff86a 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_FLOAT128
 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_FLOAT128
 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
-- 
2.4.11

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v3 8/8] float128: Add wrappers to override ldbl-128 as float128.
  2017-05-02 21:51   ` Joseph Myers
@ 2017-05-09 19:11     ` Gabriel F. T. Gomes
  2017-05-09 23:14       ` Joseph Myers
  0 siblings, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-05-09 19:11 UTC (permalink / raw)
  To: libc-alpha

From: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>

Changes since v2:

  - Added the implementation of expf128, canonicalizef128, and
    roundevenf128, as well as the definition of SNANF128 to this patch
    set.
  - Removed duplicated definitions of macros
  - Added "_do_not_use" to finitef128, isinff128, and isnanf128.
  - Removed definitions for fpclassifyl and issignalingl.

-- 8< --
This change defines float128_private.h which contains
macros used to override long double naming conventions
when building a ldbl file.

2017-05-09  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
	    Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
	    Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>

	* math/math.h [__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(SNANF128): New macro.
	* math/s_fmaxmag_template.c: Include math_private.h in order to
	make inline expansion of fabs128().
	* math/s_fminmag_template.c: Likewise.

	* sysdeps/ieee754/float128/e_acosf128.c: New file.
	* sysdeps/ieee754/float128/e_acoshf128.c: New file.
	* sysdeps/ieee754/float128/e_asinf128.c: New file.
	* sysdeps/ieee754/float128/e_atan2f128.c: New file.
	* sysdeps/ieee754/float128/e_atanhf128.c: New file.
	* sysdeps/ieee754/float128/e_coshf128.c: New file.
	* sysdeps/ieee754/float128/e_exp10f128.c: New file.
	* sysdeps/ieee754/float128/e_exp2f128.c: New file.
	* sysdeps/ieee754/float128/e_expf128.c: New file.
	* sysdeps/ieee754/float128/e_fmodf128.c: New file.
	* sysdeps/ieee754/float128/e_gammaf128_r.c: New file.
	* sysdeps/ieee754/float128/e_hypotf128.c: New file.
	* sysdeps/ieee754/float128/e_ilogbf128.c: New file.
	* sysdeps/ieee754/float128/e_j0f128.c: New file.
	* sysdeps/ieee754/float128/e_j1f128.c: New file.
	* sysdeps/ieee754/float128/e_jnf128.c: New file.
	* sysdeps/ieee754/float128/e_lgammaf128.c: New file.
	* sysdeps/ieee754/float128/e_lgammaf128_r.c: New file.
	* sysdeps/ieee754/float128/e_log10f128.c: New file.
	* sysdeps/ieee754/float128/e_log2f128.c: New file.
	* sysdeps/ieee754/float128/e_logf128.c: New file.
	* sysdeps/ieee754/float128/e_powf128.c: New file.
	* sysdeps/ieee754/float128/e_rem_pio2f128.c: New file.
	* sysdeps/ieee754/float128/e_remainderf128.c: New file.
	* sysdeps/ieee754/float128/e_scalbf128.c: New file.
	* sysdeps/ieee754/float128/e_sinhf128.c: New file.
	* sysdeps/ieee754/float128/e_sqrtf128.c: New file.
	* sysdeps/ieee754/float128/float128_private.h: New file.
	* sysdeps/ieee754/float128/gamma_productf128.c: New file.
	* sysdeps/ieee754/float128/ieee754_float128.h: New file.
	* sysdeps/ieee754/float128/k_cosf128.c: New file.
	* sysdeps/ieee754/float128/k_rem_pio2f128.c: New file.
	* sysdeps/ieee754/float128/k_sincosf128.c: New file.
	* sysdeps/ieee754/float128/k_sinf128.c: New file.
	* sysdeps/ieee754/float128/k_tanf128.c: New file.
	* sysdeps/ieee754/float128/lgamma_negf128.c: New file.
	* sysdeps/ieee754/float128/lgamma_productf128.c: New file.
	* sysdeps/ieee754/float128/s_asinhf128.c: New file.
	* sysdeps/ieee754/float128/s_atanf128.c: New file.
	* sysdeps/ieee754/float128/s_canonicalizef128.c: New file.
	* sysdeps/ieee754/float128/s_cbrtf128.c: New file.
	* sysdeps/ieee754/float128/s_ceilf128.c: New file.
	* sysdeps/ieee754/float128/s_copysignf128.c: New file.
	* sysdeps/ieee754/float128/s_cosf128.c: New file.
	* sysdeps/ieee754/float128/s_erff128.c: New file.
	* sysdeps/ieee754/float128/s_expm1f128.c: New file.
	* sysdeps/ieee754/float128/s_fabsf128.c: New file.
	* sysdeps/ieee754/float128/s_finitef128.c: New file.
	* sysdeps/ieee754/float128/s_floorf128.c: New file.
	* sysdeps/ieee754/float128/s_fmaf128.c: New file.
	* sysdeps/ieee754/float128/s_fpclassifyf128.c: New file.
	* sysdeps/ieee754/float128/s_frexpf128.c: New file.
	* sysdeps/ieee754/float128/s_fromfpf128.c: New file.
	* sysdeps/ieee754/float128/s_fromfpxf128.c: New file.
	* sysdeps/ieee754/float128/s_getpayloadf128.c: New file.
	* sysdeps/ieee754/float128/s_isinff128.c: New file.
	* sysdeps/ieee754/float128/s_isnanf128.c: New file.
	* sysdeps/ieee754/float128/s_issignalingf128.c: New file.
	* sysdeps/ieee754/float128/s_llrintf128.c: New file.
	* sysdeps/ieee754/float128/s_llroundf128.c: New file.
	* sysdeps/ieee754/float128/s_log1pf128.c: New file.
	* sysdeps/ieee754/float128/s_logbf128.c: New file.
	* sysdeps/ieee754/float128/s_lrintf128.c: New file.
	* sysdeps/ieee754/float128/s_lroundf128.c: New file.
	* sysdeps/ieee754/float128/s_modff128.c: New file.
	* sysdeps/ieee754/float128/s_nearbyintf128.c: New file.
	* sysdeps/ieee754/float128/s_nextafterf128.c: New file.
	* sysdeps/ieee754/float128/s_nexttowardf128.c: New file.
	* sysdeps/ieee754/float128/s_nextupf128.c: New file.
	* sysdeps/ieee754/float128/s_remquof128.c: New file.
	* sysdeps/ieee754/float128/s_rintf128.c: New file.
	* sysdeps/ieee754/float128/s_roundevenf128.c: New file.
	* sysdeps/ieee754/float128/s_roundf128.c: New file.
	* sysdeps/ieee754/float128/s_scalblnf128.c: New file.
	* sysdeps/ieee754/float128/s_scalbnf128.c: New file.
	* sysdeps/ieee754/float128/s_setpayloadf128.c: New file.
	* sysdeps/ieee754/float128/s_setpayloadsigf128.c: New file.
	* sysdeps/ieee754/float128/s_signbitf128.c: New file.
	* sysdeps/ieee754/float128/s_significandf128.c: New file.
	* sysdeps/ieee754/float128/s_sincosf128.c: New file.
	* sysdeps/ieee754/float128/s_sinf128.c: New file.
	* sysdeps/ieee754/float128/s_tanf128.c: New file.
	* sysdeps/ieee754/float128/s_tanhf128.c: New file.
	* sysdeps/ieee754/float128/s_totalorderf128.c: New file.
	* sysdeps/ieee754/float128/s_totalordermagf128.c: New file.
	* sysdeps/ieee754/float128/s_truncf128.c: New file.
	* sysdeps/ieee754/float128/s_ufromfpf128.c: New file.
	* sysdeps/ieee754/float128/s_ufromfpxf128.c: New file.
	* sysdeps/ieee754/float128/t_sincosf128.c: New file.
	* sysdeps/ieee754/float128/w_llogbf128.c: New file.
	* sysdeps/ieee754/float128/x2y2m1f128.c: New file.

	* sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h:
	(__iscanonicalf128): Define as a macro.

	* sysdeps/powerpc/powerpc64le/bits/floatn-compat.h:
	[!__GNUC_PREREQ (7, 0)] (__builtin_nansf128): New macro
---
 math/math.h                                      |   3 +
 math/s_fmaxmag_template.c                        |   1 +
 math/s_fminmag_template.c                        |   1 +
 sysdeps/ieee754/float128/e_acosf128.c            |   2 +
 sysdeps/ieee754/float128/e_acoshf128.c           |   2 +
 sysdeps/ieee754/float128/e_asinf128.c            |   2 +
 sysdeps/ieee754/float128/e_atan2f128.c           |   2 +
 sysdeps/ieee754/float128/e_atanhf128.c           |   2 +
 sysdeps/ieee754/float128/e_coshf128.c            |   2 +
 sysdeps/ieee754/float128/e_exp10f128.c           |   2 +
 sysdeps/ieee754/float128/e_exp2f128.c            |  54 ++++
 sysdeps/ieee754/float128/e_expf128.c             |   2 +
 sysdeps/ieee754/float128/e_fmodf128.c            |   2 +
 sysdeps/ieee754/float128/e_gammaf128_r.c         |   2 +
 sysdeps/ieee754/float128/e_hypotf128.c           |   2 +
 sysdeps/ieee754/float128/e_ilogbf128.c           |   2 +
 sysdeps/ieee754/float128/e_j0f128.c              |   2 +
 sysdeps/ieee754/float128/e_j1f128.c              |   2 +
 sysdeps/ieee754/float128/e_jnf128.c              |   2 +
 sysdeps/ieee754/float128/e_lgammaf128.c          |   1 +
 sysdeps/ieee754/float128/e_lgammaf128_r.c        |   2 +
 sysdeps/ieee754/float128/e_log10f128.c           |   2 +
 sysdeps/ieee754/float128/e_log2f128.c            |   2 +
 sysdeps/ieee754/float128/e_logf128.c             |   2 +
 sysdeps/ieee754/float128/e_powf128.c             |   2 +
 sysdeps/ieee754/float128/e_rem_pio2f128.c        |   2 +
 sysdeps/ieee754/float128/e_remainderf128.c       |   2 +
 sysdeps/ieee754/float128/e_scalbf128.c           |   1 +
 sysdeps/ieee754/float128/e_sinhf128.c            |   2 +
 sysdeps/ieee754/float128/e_sqrtf128.c            |   2 +
 sysdeps/ieee754/float128/float128_private.h      | 330 +++++++++++++++++++++++
 sysdeps/ieee754/float128/gamma_productf128.c     |   2 +
 sysdeps/ieee754/float128/ieee754_float128.h      | 140 ++++++++++
 sysdeps/ieee754/float128/k_cosf128.c             |   2 +
 sysdeps/ieee754/float128/k_rem_pio2f128.c        |   2 +
 sysdeps/ieee754/float128/k_sincosf128.c          |   2 +
 sysdeps/ieee754/float128/k_sinf128.c             |   2 +
 sysdeps/ieee754/float128/k_tanf128.c             |   2 +
 sysdeps/ieee754/float128/lgamma_negf128.c        |   2 +
 sysdeps/ieee754/float128/lgamma_productf128.c    |   2 +
 sysdeps/ieee754/float128/s_asinhf128.c           |   2 +
 sysdeps/ieee754/float128/s_atanf128.c            |   2 +
 sysdeps/ieee754/float128/s_canonicalizef128.c    |   2 +
 sysdeps/ieee754/float128/s_cbrtf128.c            |   2 +
 sysdeps/ieee754/float128/s_ceilf128.c            |   2 +
 sysdeps/ieee754/float128/s_copysignf128.c        |   2 +
 sysdeps/ieee754/float128/s_cosf128.c             |   2 +
 sysdeps/ieee754/float128/s_erff128.c             |   2 +
 sysdeps/ieee754/float128/s_expm1f128.c           |   2 +
 sysdeps/ieee754/float128/s_fabsf128.c            |   2 +
 sysdeps/ieee754/float128/s_finitef128.c          |   2 +
 sysdeps/ieee754/float128/s_floorf128.c           |   2 +
 sysdeps/ieee754/float128/s_fmaf128.c             |   2 +
 sysdeps/ieee754/float128/s_fpclassifyf128.c      |   2 +
 sysdeps/ieee754/float128/s_frexpf128.c           |   2 +
 sysdeps/ieee754/float128/s_fromfpf128.c          |   5 +
 sysdeps/ieee754/float128/s_fromfpxf128.c         |   5 +
 sysdeps/ieee754/float128/s_getpayloadf128.c      |   2 +
 sysdeps/ieee754/float128/s_isinff128.c           |   2 +
 sysdeps/ieee754/float128/s_isnanf128.c           |   2 +
 sysdeps/ieee754/float128/s_issignalingf128.c     |   2 +
 sysdeps/ieee754/float128/s_llrintf128.c          |   2 +
 sysdeps/ieee754/float128/s_llroundf128.c         |   2 +
 sysdeps/ieee754/float128/s_log1pf128.c           |   2 +
 sysdeps/ieee754/float128/s_logbf128.c            |   2 +
 sysdeps/ieee754/float128/s_lrintf128.c           |   2 +
 sysdeps/ieee754/float128/s_lroundf128.c          |   2 +
 sysdeps/ieee754/float128/s_modff128.c            |   2 +
 sysdeps/ieee754/float128/s_nearbyintf128.c       |   2 +
 sysdeps/ieee754/float128/s_nextafterf128.c       |   2 +
 sysdeps/ieee754/float128/s_nexttowardf128.c      |   1 +
 sysdeps/ieee754/float128/s_nextupf128.c          |   2 +
 sysdeps/ieee754/float128/s_remquof128.c          |   2 +
 sysdeps/ieee754/float128/s_rintf128.c            |   2 +
 sysdeps/ieee754/float128/s_roundevenf128.c       |   2 +
 sysdeps/ieee754/float128/s_roundf128.c           |   2 +
 sysdeps/ieee754/float128/s_scalblnf128.c         |   2 +
 sysdeps/ieee754/float128/s_scalbnf128.c          |   2 +
 sysdeps/ieee754/float128/s_setpayloadf128.c      |   4 +
 sysdeps/ieee754/float128/s_setpayloadsigf128.c   |   4 +
 sysdeps/ieee754/float128/s_signbitf128.c         |   2 +
 sysdeps/ieee754/float128/s_significandf128.c     |   1 +
 sysdeps/ieee754/float128/s_sincosf128.c          |   2 +
 sysdeps/ieee754/float128/s_sinf128.c             |   2 +
 sysdeps/ieee754/float128/s_tanf128.c             |   2 +
 sysdeps/ieee754/float128/s_tanhf128.c            |   2 +
 sysdeps/ieee754/float128/s_totalorderf128.c      |   2 +
 sysdeps/ieee754/float128/s_totalordermagf128.c   |   2 +
 sysdeps/ieee754/float128/s_truncf128.c           |   2 +
 sysdeps/ieee754/float128/s_ufromfpf128.c         |   5 +
 sysdeps/ieee754/float128/s_ufromfpxf128.c        |   5 +
 sysdeps/ieee754/float128/t_sincosf128.c          |   2 +
 sysdeps/ieee754/float128/w_llogbf128.c           |   3 +
 sysdeps/ieee754/float128/x2y2m1f128.c            |   2 +
 sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h   |   3 +
 sysdeps/powerpc/powerpc64le/bits/floatn-compat.h |   1 +
 96 files changed, 722 insertions(+)
 create mode 100644 sysdeps/ieee754/float128/e_acosf128.c
 create mode 100644 sysdeps/ieee754/float128/e_acoshf128.c
 create mode 100644 sysdeps/ieee754/float128/e_asinf128.c
 create mode 100644 sysdeps/ieee754/float128/e_atan2f128.c
 create mode 100644 sysdeps/ieee754/float128/e_atanhf128.c
 create mode 100644 sysdeps/ieee754/float128/e_coshf128.c
 create mode 100644 sysdeps/ieee754/float128/e_exp10f128.c
 create mode 100644 sysdeps/ieee754/float128/e_exp2f128.c
 create mode 100644 sysdeps/ieee754/float128/e_expf128.c
 create mode 100644 sysdeps/ieee754/float128/e_fmodf128.c
 create mode 100644 sysdeps/ieee754/float128/e_gammaf128_r.c
 create mode 100644 sysdeps/ieee754/float128/e_hypotf128.c
 create mode 100644 sysdeps/ieee754/float128/e_ilogbf128.c
 create mode 100644 sysdeps/ieee754/float128/e_j0f128.c
 create mode 100644 sysdeps/ieee754/float128/e_j1f128.c
 create mode 100644 sysdeps/ieee754/float128/e_jnf128.c
 create mode 100644 sysdeps/ieee754/float128/e_lgammaf128.c
 create mode 100644 sysdeps/ieee754/float128/e_lgammaf128_r.c
 create mode 100644 sysdeps/ieee754/float128/e_log10f128.c
 create mode 100644 sysdeps/ieee754/float128/e_log2f128.c
 create mode 100644 sysdeps/ieee754/float128/e_logf128.c
 create mode 100644 sysdeps/ieee754/float128/e_powf128.c
 create mode 100644 sysdeps/ieee754/float128/e_rem_pio2f128.c
 create mode 100644 sysdeps/ieee754/float128/e_remainderf128.c
 create mode 100644 sysdeps/ieee754/float128/e_scalbf128.c
 create mode 100644 sysdeps/ieee754/float128/e_sinhf128.c
 create mode 100644 sysdeps/ieee754/float128/e_sqrtf128.c
 create mode 100644 sysdeps/ieee754/float128/float128_private.h
 create mode 100644 sysdeps/ieee754/float128/gamma_productf128.c
 create mode 100644 sysdeps/ieee754/float128/ieee754_float128.h
 create mode 100644 sysdeps/ieee754/float128/k_cosf128.c
 create mode 100644 sysdeps/ieee754/float128/k_rem_pio2f128.c
 create mode 100644 sysdeps/ieee754/float128/k_sincosf128.c
 create mode 100644 sysdeps/ieee754/float128/k_sinf128.c
 create mode 100644 sysdeps/ieee754/float128/k_tanf128.c
 create mode 100644 sysdeps/ieee754/float128/lgamma_negf128.c
 create mode 100644 sysdeps/ieee754/float128/lgamma_productf128.c
 create mode 100644 sysdeps/ieee754/float128/s_asinhf128.c
 create mode 100644 sysdeps/ieee754/float128/s_atanf128.c
 create mode 100644 sysdeps/ieee754/float128/s_canonicalizef128.c
 create mode 100644 sysdeps/ieee754/float128/s_cbrtf128.c
 create mode 100644 sysdeps/ieee754/float128/s_ceilf128.c
 create mode 100644 sysdeps/ieee754/float128/s_copysignf128.c
 create mode 100644 sysdeps/ieee754/float128/s_cosf128.c
 create mode 100644 sysdeps/ieee754/float128/s_erff128.c
 create mode 100644 sysdeps/ieee754/float128/s_expm1f128.c
 create mode 100644 sysdeps/ieee754/float128/s_fabsf128.c
 create mode 100644 sysdeps/ieee754/float128/s_finitef128.c
 create mode 100644 sysdeps/ieee754/float128/s_floorf128.c
 create mode 100644 sysdeps/ieee754/float128/s_fmaf128.c
 create mode 100644 sysdeps/ieee754/float128/s_fpclassifyf128.c
 create mode 100644 sysdeps/ieee754/float128/s_frexpf128.c
 create mode 100644 sysdeps/ieee754/float128/s_fromfpf128.c
 create mode 100644 sysdeps/ieee754/float128/s_fromfpxf128.c
 create mode 100644 sysdeps/ieee754/float128/s_getpayloadf128.c
 create mode 100644 sysdeps/ieee754/float128/s_isinff128.c
 create mode 100644 sysdeps/ieee754/float128/s_isnanf128.c
 create mode 100644 sysdeps/ieee754/float128/s_issignalingf128.c
 create mode 100644 sysdeps/ieee754/float128/s_llrintf128.c
 create mode 100644 sysdeps/ieee754/float128/s_llroundf128.c
 create mode 100644 sysdeps/ieee754/float128/s_log1pf128.c
 create mode 100644 sysdeps/ieee754/float128/s_logbf128.c
 create mode 100644 sysdeps/ieee754/float128/s_lrintf128.c
 create mode 100644 sysdeps/ieee754/float128/s_lroundf128.c
 create mode 100644 sysdeps/ieee754/float128/s_modff128.c
 create mode 100644 sysdeps/ieee754/float128/s_nearbyintf128.c
 create mode 100644 sysdeps/ieee754/float128/s_nextafterf128.c
 create mode 100644 sysdeps/ieee754/float128/s_nexttowardf128.c
 create mode 100644 sysdeps/ieee754/float128/s_nextupf128.c
 create mode 100644 sysdeps/ieee754/float128/s_remquof128.c
 create mode 100644 sysdeps/ieee754/float128/s_rintf128.c
 create mode 100644 sysdeps/ieee754/float128/s_roundevenf128.c
 create mode 100644 sysdeps/ieee754/float128/s_roundf128.c
 create mode 100644 sysdeps/ieee754/float128/s_scalblnf128.c
 create mode 100644 sysdeps/ieee754/float128/s_scalbnf128.c
 create mode 100644 sysdeps/ieee754/float128/s_setpayloadf128.c
 create mode 100644 sysdeps/ieee754/float128/s_setpayloadsigf128.c
 create mode 100644 sysdeps/ieee754/float128/s_signbitf128.c
 create mode 100644 sysdeps/ieee754/float128/s_significandf128.c
 create mode 100644 sysdeps/ieee754/float128/s_sincosf128.c
 create mode 100644 sysdeps/ieee754/float128/s_sinf128.c
 create mode 100644 sysdeps/ieee754/float128/s_tanf128.c
 create mode 100644 sysdeps/ieee754/float128/s_tanhf128.c
 create mode 100644 sysdeps/ieee754/float128/s_totalorderf128.c
 create mode 100644 sysdeps/ieee754/float128/s_totalordermagf128.c
 create mode 100644 sysdeps/ieee754/float128/s_truncf128.c
 create mode 100644 sysdeps/ieee754/float128/s_ufromfpf128.c
 create mode 100644 sysdeps/ieee754/float128/s_ufromfpxf128.c
 create mode 100644 sysdeps/ieee754/float128/t_sincosf128.c
 create mode 100644 sysdeps/ieee754/float128/w_llogbf128.c
 create mode 100644 sysdeps/ieee754/float128/x2y2m1f128.c

diff --git a/math/math.h b/math/math.h
index 4fc96ac..ed713df 100644
--- a/math/math.h
+++ b/math/math.h
@@ -63,6 +63,9 @@ __BEGIN_DECLS
 #  define SNAN (__builtin_nans (""))
 #  define SNANL (__builtin_nansl (""))
 # endif
+# if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
+#  define SNANF128 (__builtin_nansf128 (""))
+# endif
 #endif
 
 /* Get __GLIBC_FLT_EVAL_METHOD.  */
diff --git a/math/s_fmaxmag_template.c b/math/s_fmaxmag_template.c
index 6beef03..f7c8248 100644
--- a/math/s_fmaxmag_template.c
+++ b/math/s_fmaxmag_template.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <math.h>
+#include <math_private.h>
 
 FLOAT
 M_DECL_FUNC (__fmaxmag) (FLOAT x, FLOAT y)
diff --git a/math/s_fminmag_template.c b/math/s_fminmag_template.c
index a1e4c2b..1054c38 100644
--- a/math/s_fminmag_template.c
+++ b/math/s_fminmag_template.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <math.h>
+#include <math_private.h>
 
 FLOAT
 M_DECL_FUNC (__fminmag) (FLOAT x, FLOAT y)
diff --git a/sysdeps/ieee754/float128/e_acosf128.c b/sysdeps/ieee754/float128/e_acosf128.c
new file mode 100644
index 0000000..7ddf7dc
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_acosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_acosl.c"
diff --git a/sysdeps/ieee754/float128/e_acoshf128.c b/sysdeps/ieee754/float128/e_acoshf128.c
new file mode 100644
index 0000000..f6dd40c
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_acoshf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_acoshl.c"
diff --git a/sysdeps/ieee754/float128/e_asinf128.c b/sysdeps/ieee754/float128/e_asinf128.c
new file mode 100644
index 0000000..133ab8d
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_asinf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_asinl.c"
diff --git a/sysdeps/ieee754/float128/e_atan2f128.c b/sysdeps/ieee754/float128/e_atan2f128.c
new file mode 100644
index 0000000..9aa740f
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_atan2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_atan2l.c"
diff --git a/sysdeps/ieee754/float128/e_atanhf128.c b/sysdeps/ieee754/float128/e_atanhf128.c
new file mode 100644
index 0000000..f26c8d5
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_atanhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_atanhl.c"
diff --git a/sysdeps/ieee754/float128/e_coshf128.c b/sysdeps/ieee754/float128/e_coshf128.c
new file mode 100644
index 0000000..2abf067
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_coshf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_coshl.c"
diff --git a/sysdeps/ieee754/float128/e_exp10f128.c b/sysdeps/ieee754/float128/e_exp10f128.c
new file mode 100644
index 0000000..b3468d2
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_exp10f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_exp10l.c"
diff --git a/sysdeps/ieee754/float128/e_exp2f128.c b/sysdeps/ieee754/float128/e_exp2f128.c
new file mode 100644
index 0000000..6411ca7
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_exp2f128.c
@@ -0,0 +1,54 @@
+/* Compute 2^x.
+   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/>.  */
+
+#include <float128_private.h>
+
+_Float128
+__ieee754_exp2f128 (_Float128 x)
+{
+  if (__glibc_likely (isless (x, (_Float128) FLT128_MAX_EXP)))
+    {
+      if (__builtin_expect (isgreaterequal (x, (_Float128) (FLT128_MIN_EXP
+							    - FLT128_MANT_DIG
+							    - 1)), 1))
+	{
+	  int intx = (int) x;
+	  _Float128 fractx = x - intx;
+	  _Float128 result;
+	  if (fabsf128 (fractx) < FLT128_EPSILON / 4)
+	    result = __scalbnf128 (1 + fractx, intx);
+	  else
+	    result = __scalbnf128 (__ieee754_expf128 (M_LN2f128 * fractx),
+				   intx);
+	  math_check_force_underflow_nonneg (result);
+	  return result;
+	}
+      else
+	{
+	  /* Underflow or exact zero.  */
+	  if (isinf (x))
+	    return 0;
+	  else
+	    return FLT128_MIN * FLT128_MIN;
+	}
+    }
+  else
+    /* Infinity, NaN or overflow.  */
+    return FLT128_MAX * x;
+}
+strong_alias (__ieee754_exp2f128, __exp2f128_finite)
diff --git a/sysdeps/ieee754/float128/e_expf128.c b/sysdeps/ieee754/float128/e_expf128.c
new file mode 100644
index 0000000..b727b17
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_expf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_expl.c"
diff --git a/sysdeps/ieee754/float128/e_fmodf128.c b/sysdeps/ieee754/float128/e_fmodf128.c
new file mode 100644
index 0000000..ed8a749
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_fmodf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_fmodl.c"
diff --git a/sysdeps/ieee754/float128/e_gammaf128_r.c b/sysdeps/ieee754/float128/e_gammaf128_r.c
new file mode 100644
index 0000000..895ac63
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_gammaf128_r.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_gammal_r.c"
diff --git a/sysdeps/ieee754/float128/e_hypotf128.c b/sysdeps/ieee754/float128/e_hypotf128.c
new file mode 100644
index 0000000..1f06555
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_hypotf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_hypotl.c"
diff --git a/sysdeps/ieee754/float128/e_ilogbf128.c b/sysdeps/ieee754/float128/e_ilogbf128.c
new file mode 100644
index 0000000..2861801
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_ilogbf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_ilogbl.c"
diff --git a/sysdeps/ieee754/float128/e_j0f128.c b/sysdeps/ieee754/float128/e_j0f128.c
new file mode 100644
index 0000000..b624b5c
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_j0f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_j0l.c"
diff --git a/sysdeps/ieee754/float128/e_j1f128.c b/sysdeps/ieee754/float128/e_j1f128.c
new file mode 100644
index 0000000..445428e
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_j1f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_j1l.c"
diff --git a/sysdeps/ieee754/float128/e_jnf128.c b/sysdeps/ieee754/float128/e_jnf128.c
new file mode 100644
index 0000000..7854e11
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_jnf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_jnl.c"
diff --git a/sysdeps/ieee754/float128/e_lgammaf128.c b/sysdeps/ieee754/float128/e_lgammaf128.c
new file mode 100644
index 0000000..72f02ac
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_lgammaf128.c
@@ -0,0 +1 @@
+/* _FloatN uses tgamma instead.  */
diff --git a/sysdeps/ieee754/float128/e_lgammaf128_r.c b/sysdeps/ieee754/float128/e_lgammaf128_r.c
new file mode 100644
index 0000000..3517ac3
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_lgammaf128_r.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_lgammal_r.c"
diff --git a/sysdeps/ieee754/float128/e_log10f128.c b/sysdeps/ieee754/float128/e_log10f128.c
new file mode 100644
index 0000000..1c3341e
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_log10f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_log10l.c"
diff --git a/sysdeps/ieee754/float128/e_log2f128.c b/sysdeps/ieee754/float128/e_log2f128.c
new file mode 100644
index 0000000..36becaa
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_log2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_log2l.c"
diff --git a/sysdeps/ieee754/float128/e_logf128.c b/sysdeps/ieee754/float128/e_logf128.c
new file mode 100644
index 0000000..b0c9975
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_logf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_logl.c"
diff --git a/sysdeps/ieee754/float128/e_powf128.c b/sysdeps/ieee754/float128/e_powf128.c
new file mode 100644
index 0000000..3afaf7f
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_powf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_powl.c"
diff --git a/sysdeps/ieee754/float128/e_rem_pio2f128.c b/sysdeps/ieee754/float128/e_rem_pio2f128.c
new file mode 100644
index 0000000..86c2ca1
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_rem_pio2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_rem_pio2l.c"
diff --git a/sysdeps/ieee754/float128/e_remainderf128.c b/sysdeps/ieee754/float128/e_remainderf128.c
new file mode 100644
index 0000000..90c18f8
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_remainderf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_remainderl.c"
diff --git a/sysdeps/ieee754/float128/e_scalbf128.c b/sysdeps/ieee754/float128/e_scalbf128.c
new file mode 100644
index 0000000..067b724
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_scalbf128.c
@@ -0,0 +1 @@
+/* Not defined for _FloatN types.  */
diff --git a/sysdeps/ieee754/float128/e_sinhf128.c b/sysdeps/ieee754/float128/e_sinhf128.c
new file mode 100644
index 0000000..42a54e0
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_sinhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/e_sinhl.c"
diff --git a/sysdeps/ieee754/float128/e_sqrtf128.c b/sysdeps/ieee754/float128/e_sqrtf128.c
new file mode 100644
index 0000000..1ac216f
--- /dev/null
+++ b/sysdeps/ieee754/float128/e_sqrtf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include <math/e_sqrtl.c>
diff --git a/sysdeps/ieee754/float128/float128_private.h b/sysdeps/ieee754/float128/float128_private.h
new file mode 100644
index 0000000..c096560
--- /dev/null
+++ b/sysdeps/ieee754/float128/float128_private.h
@@ -0,0 +1,330 @@
+/* _Float128 overrides for building ldbl-128 as _Float128.
+   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/>.  */
+
+/* This must be included before the function renames below.  */
+#include <math.h>
+#undef HUGE_VALL
+#include <math/mul_splitl.h>
+
+/* Renames derived from math_private.h.  */
+#include <math_private.h>
+#include <ieee754_float128.h>
+#define ieee854_long_double_shape_type ieee854_float128_shape_type
+#define ieee854_long_double ieee854_float128
+
+#undef GET_LDOUBLE_LSW64
+#undef GET_LDOUBLE_MSW64
+#undef GET_LDOUBLE_WORDS64
+#undef SET_LDOUBLE_LSW64
+#undef SET_LDOUBLE_MSW64
+#undef SET_LDOUBLE_WORDS64
+#define GET_LDOUBLE_LSW64(x,y) GET_FLOAT128_LSW64 (x, y)
+#define GET_LDOUBLE_MSW64(x,y) GET_FLOAT128_MSW64 (x, y)
+#define GET_LDOUBLE_WORDS64(x,y,z) GET_FLOAT128_WORDS64 (x, y, z)
+#define SET_LDOUBLE_LSW64(x,y) SET_FLOAT128_LSW64 (x, y)
+#define SET_LDOUBLE_MSW64(x,y) SET_FLOAT128_MSW64 (x, y)
+#define SET_LDOUBLE_WORDS64(x,y,z) SET_FLOAT128_WORDS64 (x, y, z)
+
+#undef IEEE854_LONG_DOUBLE_BIAS
+#define IEEE854_LONG_DOUBLE_BIAS IEEE854_FLOAT128_BIAS
+
+#ifdef SET_RESTORE_ROUNDF128
+# undef SET_RESTORE_ROUNDL
+# define SET_RESTORE_ROUNDL() SET_RESTORE_ROUNDF128()
+#endif
+
+
+/* misc macros from the header below.  */
+#include <fix-fp-int-convert-overflow.h>
+#undef FIX_LDBL_LONG_CONVERT_OVERFLOW
+#undef FIX_LDBL_LLONG_CONVERT_OVERFLOW
+#define FIX_LDBL_LONG_CONVERT_OVERFLOW FIX_FLT128_LONG_CONVERT_OVERFLOW
+#define FIX_LDBL_LLONG_CONVERT_OVERFLOW FIX_FLT128_LLONG_CONVERT_OVERFLOW
+
+
+/* float.h constants.  */
+#include <float.h>
+#undef LDBL_DIG
+#undef LDBL_EPSILON
+#undef LDBL_MANT_DIG
+#undef LDBL_MAX
+#undef LDBL_MAX_10_EXP
+#undef LDBL_MAX_EXP
+#undef LDBL_MIN
+#undef LDBL_MIN_10_EXP
+#undef LDBL_MIN_EXP
+#undef LDBL_TRUE_MIN
+#define HUGE_VALL HUGE_VAL_F128
+#define LDBL_DIG FLT128_DIG
+#define LDBL_EPSILON FLT128_EPSILON
+#define LDBL_MANT_DIG FLT128_MANT_DIG
+#define LDBL_MAX FLT128_MAX
+#define LDBL_MAX_10_EXP FLT128_MAX_10_EXP
+#define LDBL_MAX_EXP FLT128_MAX_EXP
+#define LDBL_MIN FLT128_MIN
+#define LDBL_MIN_10_EXP FLT128_MIN_10_EXP
+#define LDBL_MIN_EXP FLT128_MIN_EXP
+#define LDBL_TRUE_MIN FLT128_TRUE_MIN
+
+
+/* math.h GNU constants.  */
+#undef M_El
+#undef M_LOG2El
+#undef M_LOG10El
+#undef M_LN2l
+#undef M_LN10l
+#undef M_PIl
+#undef M_PI_2l
+#undef M_PI_4l
+#undef M_1_PIl
+#undef M_2_PIl
+#undef M_2_SQRTPIl
+#undef M_SQRT2l
+#undef M_SQRT1_2l
+#define M_El M_Ef128
+#define M_LOG2El M_LOG2Ef128
+#define M_LOG10El M_LOG10Ef128
+#define M_LN2l M_LN2f128
+#define M_LN10l M_LN10f128
+#define M_PIl M_PIf128
+#define M_PI_2l M_PI_2f128
+#define M_PI_4l M_PI_4f128
+#define M_1_PIl M_1_PIf128
+#define M_2_PIl M_2_PIf128
+#define M_2_SQRTPIl M_2_SQRTPIf128
+#define M_SQRT2l M_SQRT2f128
+#define M_SQRT1_2l M_SQRT1_2f128
+
+
+/* IEEE function renames.  */
+#define __ieee754_acoshl __ieee754_acoshf128
+#define __ieee754_acosl __ieee754_acosf128
+#define __ieee754_asinhl __ieee754_asinhf128
+#define __ieee754_asinl __ieee754_asinf128
+#define __ieee754_atan2l __ieee754_atan2f128
+#define __ieee754_atanhl __ieee754_atanhf128
+#define __ieee754_coshl __ieee754_coshf128
+#define __ieee754_cosl __ieee754_cosf128
+#define __ieee754_exp10l __ieee754_exp10f128
+#define __ieee754_exp2l __ieee754_exp2f128
+#define __ieee754_expl __ieee754_expf128
+#define __ieee754_fmodl __ieee754_fmodf128
+#define __ieee754_gammal_r __ieee754_gammaf128_r
+#define __ieee754_hypotl __ieee754_hypotf128
+#define __ieee754_ilogbl __ieee754_ilogbf128
+#define __ieee754_j0l __ieee754_j0f128
+#define __ieee754_j1l __ieee754_j1f128
+#define __ieee754_jnl __ieee754_jnf128
+#define __ieee754_lgammal_r __ieee754_lgammaf128_r
+#define __ieee754_log10l __ieee754_log10f128
+#define __ieee754_log2l __ieee754_log2f128
+#define __ieee754_logl __ieee754_logf128
+#define __ieee754_powl __ieee754_powf128
+#define __ieee754_rem_pio2l __ieee754_rem_pio2f128
+#define __ieee754_remainderl __ieee754_remainderf128
+#define __ieee754_sinhl __ieee754_sinhf128
+#define __ieee754_sqrtl __ieee754_sqrtf128
+#define __ieee754_y0l __ieee754_y0f128
+#define __ieee754_y1l __ieee754_y1f128
+#define __ieee754_ynl __ieee754_ynf128
+
+
+/* finite math entry points.  */
+#define __acoshl_finite __acoshf128_finite
+#define __acosl_finite __acosf128_finite
+#define __asinl_finite __asinf128_finite
+#define __atan2l_finite __atan2f128_finite
+#define __atanhl_finite __atanhf128_finite
+#define __coshl_finite __coshf128_finite
+#define __cosl_finite __cosf128_finite
+#define __exp10l_finite __exp10f128_finite
+#define __exp2l_finite __exp2f128_finite
+#define __expl_finite __expf128_finite
+#define __fmodl_finite __fmodf128_finite
+#define __hypotl_finite __hypotf128_finite
+#define __ilogbl_finite __ilogbf128_finite
+#define __j0l_finite __j0f128_finite
+#define __j1l_finite __j1f128_finite
+#define __jnl_finite __jnf128_finite
+#define __lgammal_r_finite __lgammaf128_r_finite
+#define __log10l_finite __log10f128_finite
+#define __log2l_finite __log2f128_finite
+#define __logl_finite __logf128_finite
+#define __powl_finite __powf128_finite
+#define __remainderl_finite __remainderf128_finite
+#define __sinhl_finite __sinhf128_finite
+#define __y0l_finite __y0f128_finite
+#define __y1l_finite __y1f128_finite
+#define __ynl_finite __ynf128_finite
+
+
+/* internal function names.  */
+#define __asinhl __asinhf128
+#define __atanl __atanf128
+#define __cbrtl __cbrtf128
+#define __ceill __ceilf128
+#define __copysignl __copysignf128
+#define __cosl __cosf128
+#define __erfcl __erfcf128
+#define __erfl __erff128
+#define __expl __expf128
+#define __expm1l __expm1f128
+#define __fabsl __fabsf128
+#define __fdiml __fdimf128
+#define __finitel __finitef128
+#define __floorl __floorf128
+#define __fmal __fmaf128
+#define __fmaxl __fmaxf128
+#define __fminl __fminf128
+#define __fpclassifyl __fpclassifyf128
+#define __frexpl __frexpf128
+#define __gammal_r_finite __gammaf128_r_finite
+#define __isinfl __isinff128
+#define __isnanl __isnanf128
+#define __issignalingl __issignalingf128
+#define __ldexpl __ldexpf128
+#define __llrintl __llrintf128
+#define __llroundl __llroundf128
+#define __log1pl __log1pf128
+#define __logbl __logbf128
+#define __logl __logf128
+#define __lrintl __lrintf128
+#define __lroundl __lroundf128
+#define __modfl __modff128
+#define __nearbyintl __nearbyintf128
+#define __nextafterl __nextafterf128
+#define __nextdownl __nextdownf128
+#define __nextupl __nextupf128
+#define __remquol __remquof128
+#define __rintl __rintf128
+#define __roundl __roundf128
+#define __scalblnl __scalblnf128
+#define __scalbnl __scalbnf128
+#define __signbitl __signbitf128
+#define __sincosl __sincosf128
+#define __sinl __sinf128
+#define __sqrtl __sqrtf128
+#define __tanhl __tanhf128
+#define __tanl __tanf128
+#define __truncl __truncf128
+#define __x2y2m1l __x2y2m1f128
+
+/* __nexttowardf128 is not _Float128 API. */
+#define __nexttowardl __nexttowardf128_do_not_use
+#define nexttowardl nexttowardf128_do_not_use
+
+
+/* public entry points.  */
+#define asinhl asinhf128
+#define atanl atanf128
+#define cbrtl cbrtf128
+#define ceill ceilf128
+#define copysignl copysignf128
+#define cosl cosf128
+#define erfcl erfcf128
+#define erfl erff128
+#define expl expf128
+#define expm1l expm1f128
+#define fabsl fabsf128
+#define fdiml fdimf128
+#define finitel finitef128_do_not_use
+#define floorl floorf128
+#define fmal fmaf128
+#define fmaxl fmaxf128
+#define fminl fminf128
+#define frexpl frexpf128
+#define fromfpl fromfpf128
+#define fromfpxl fromfpxf128
+#define gammal_r_finite gammaf128_r_finite
+#define getpayloadl getpayloadf128
+#define isinfl isinff128_do_not_use
+#define isnanl isnanf128_do_not_use
+#define ldexpl ldexpf128
+#define llrintl llrintf128
+#define llroundl llroundf128
+#define log1pl log1pf128
+#define logbl logbf128
+#define logl logf128
+#define lrintl lrintf128
+#define lroundl lroundf128
+#define modfl modff128
+#define nanl nanf128
+#define nearbyintl nearbyintf128
+#define nextafterl nextafterf128
+#define nextdownl nextdownf128
+#define nextupl nextupf128
+#define remquol remquof128
+#define rintl rintf128
+#define roundevenl roundevenf128
+#define roundl roundf128
+#define scalbnl scalbnf128
+#define signbitl signbitf128
+#define sincosl sincosf128
+#define sinl sinf128
+#define sqrtl sqrtf128
+#define tanhl tanhf128
+#define tanl tanf128
+#define totalorderl totalorderf128
+#define totalordermagl totalordermagf128
+#define truncl truncf128
+#define ufromfpl ufromfpf128
+#define ufromfpxl ufromfpxf128
+
+
+/* misc internal renames.  */
+#define __builtin_fmal __builtin_fmaf128
+#define __expl_table __expf128_table
+#define __gamma_productl __gamma_productf128
+#define __kernel_cosl __kernel_cosf128
+#define __kernel_rem_pio2l __kernel_rem_pio2f128
+#define __kernel_sincosl __kernel_sincosf128
+#define __kernel_sinl __kernel_sinf128
+#define __kernel_tanl __kernel_tanf128
+#define __lgamma_negl __lgamma_negf128
+#define __lgamma_productl __lgamma_productf128
+#define __sincosl_table __sincosf128_table
+#define mul_splitl mul_splitf128
+
+/* Builtin renames.  */
+#define __builtin_copysignl __builtin_copysignf128
+#define __builtin_signbitl __builtin_signbitf128
+
+/* Get the constant suffix from bits/floatn-compat.h.  */
+#define L __L
+
+static inline void
+mul_splitf128 (_Float128 *hi, _Float128 *lo, _Float128 x, _Float128 y)
+{
+#ifdef __FP_FAST_FMAF128
+  /* Fast built-in fused multiply-add.  */
+  *hi = x * y;
+  *lo = __builtin_fmal (x, y, -*hi);
+#else
+  /* Apply Dekker's algorithm.  */
+  *hi = x * y;
+# define C ((1LL << (FLT128_MANT_DIG + 1) / 2) + 1)
+  _Float128 x1 = x * C;
+  _Float128 y1 = y * C;
+# undef C
+  x1 = (x - x1) + x1;
+  y1 = (y - y1) + y1;
+  _Float128 x2 = x - x1;
+  _Float128 y2 = y - y1;
+  *lo = (((x1 * y1 - *hi) + x1 * y2) + x2 * y1) + x2 * y2;
+#endif
+}
diff --git a/sysdeps/ieee754/float128/gamma_productf128.c b/sysdeps/ieee754/float128/gamma_productf128.c
new file mode 100644
index 0000000..be2271f
--- /dev/null
+++ b/sysdeps/ieee754/float128/gamma_productf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/gamma_productl.c"
diff --git a/sysdeps/ieee754/float128/ieee754_float128.h b/sysdeps/ieee754/float128/ieee754_float128.h
new file mode 100644
index 0000000..e8e7211
--- /dev/null
+++ b/sysdeps/ieee754/float128/ieee754_float128.h
@@ -0,0 +1,140 @@
+/* _Float128 IEEE like macros.
+   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 _IEEE754_FLOAT128_H
+#define _IEEE754_FLOAT128_H
+
+#include <endian.h>
+#include <stdint.h>
+
+# if __FLOAT_WORD_ORDER == BIG_ENDIAN
+#  define __FLT_EORDER2(t, a, b) t a; t b;
+#  define __FLT_EORDER4(t, a, b, c, d) \
+			t a; t b; t c; t d;
+#  define __FLT_EORDER6(t, a, b, c, d, e, f)  \
+			t a; t b; t c; t d; t e; t f;
+#  define __FLT_EORDER7(t, a, b, c, d, e, f, g)  \
+			t a; t b; t c; t d; t e; t f; t g;
+# else
+#  define __FLT_EORDER2(t, a, b) \
+			t b; t a;
+#  define __FLT_EORDER4(t, a, b, c, d) \
+			t d; t c; t b; t a;
+#  define __FLT_EORDER6(t, a, b, c, d, e, f)  \
+			t f; t e; t d; t c; t b; t a;
+#  define __FLT_EORDER7(t, a, b, c, d, e, f, g)  \
+			t g; t f; t e; t d; t c; t b; t a;
+# endif
+
+/* A union which permits us to convert between _Float128 and
+   four 32 bit ints or two 64 bit ints.  */
+
+typedef union
+{
+  _Float128 value;
+  struct
+  {
+    __FLT_EORDER2 (uint64_t, msw, lsw);
+  } parts64;
+  struct
+  {
+    __FLT_EORDER4 (uint32_t, w0, w1, w2, w3);
+  } parts32;
+} ieee854_float128_shape_type;
+
+/* Get two 64 bit ints from a _Float128.  */
+
+# define GET_FLOAT128_WORDS64(ix0,ix1,d)			\
+do {								\
+  ieee854_float128_shape_type qw_u;				\
+  qw_u.value = (d);						\
+  (ix0) = qw_u.parts64.msw;					\
+  (ix1) = qw_u.parts64.lsw;					\
+} while (0)
+
+/* Set a _Float128 from two 64 bit ints.  */
+
+# define SET_FLOAT128_WORDS64(d,ix0,ix1)			\
+do {								\
+  ieee854_float128_shape_type qw_u;				\
+  qw_u.parts64.msw = (ix0);					\
+  qw_u.parts64.lsw = (ix1);					\
+  (d) = qw_u.value;						\
+} while (0)
+
+/* Get the more significant 64 bits of a _Float128 mantissa.  */
+
+# define GET_FLOAT128_MSW64(v,d)				\
+do {								\
+  ieee854_float128_shape_type sh_u;				\
+  sh_u.value = (d);						\
+  (v) = sh_u.parts64.msw;					\
+} while (0)
+
+/* Set the more significant 64 bits of a _Float128 mantissa from an int.  */
+
+# define SET_FLOAT128_MSW64(d,v)				\
+do {								\
+  ieee854_float128_shape_type sh_u;				\
+  sh_u.value = (d);						\
+  sh_u.parts64.msw = (v);					\
+  (d) = sh_u.value;						\
+} while (0)
+
+/* Get the least significant 64 bits of a _Float128 mantissa.  */
+
+# define GET_FLOAT128_LSW64(v,d)				\
+do {								\
+  ieee854_float128_shape_type sh_u;				\
+  sh_u.value = (d);						\
+  (v) = sh_u.parts64.lsw;					\
+} while (0)
+
+/* Likewise, some helper macros which are exposed via ieee754.h for
+   C99 real types, but not _Float128.  */
+
+union ieee854_float128
+  {
+    _Float128 d;
+
+    /* This is the IEEE 854 quad-precision format.  */
+    struct
+      {
+	__FLT_EORDER6 (unsigned int, negative:1,
+				     exponent:15,
+				     mantissa0:16,
+				     mantissa1:32,
+				     mantissa2:32,
+				     mantissa3:32)
+      } ieee;
+
+    /* This format makes it easier to see if a NaN is a signalling NaN.  */
+    struct
+      {
+	__FLT_EORDER7 (unsigned int, negative:1,
+				     exponent:15,
+				     quiet_nan:1,
+				     mantissa0:15,
+				     mantissa1:32,
+				     mantissa2:32,
+				     mantissa3:32)
+      } ieee_nan;
+  };
+
+#define IEEE854_FLOAT128_BIAS 0x3fff /* Added to exponent.  */
+
+#endif
diff --git a/sysdeps/ieee754/float128/k_cosf128.c b/sysdeps/ieee754/float128/k_cosf128.c
new file mode 100644
index 0000000..9db0906
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_cosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_cosl.c"
diff --git a/sysdeps/ieee754/float128/k_rem_pio2f128.c b/sysdeps/ieee754/float128/k_rem_pio2f128.c
new file mode 100644
index 0000000..5140266
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_rem_pio2f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include <math/k_rem_pio2l.c>
diff --git a/sysdeps/ieee754/float128/k_sincosf128.c b/sysdeps/ieee754/float128/k_sincosf128.c
new file mode 100644
index 0000000..14c0f1e
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_sincosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_sincosl.c"
diff --git a/sysdeps/ieee754/float128/k_sinf128.c b/sysdeps/ieee754/float128/k_sinf128.c
new file mode 100644
index 0000000..f3acf1c
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_sinf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_sinl.c"
diff --git a/sysdeps/ieee754/float128/k_tanf128.c b/sysdeps/ieee754/float128/k_tanf128.c
new file mode 100644
index 0000000..ca6be53
--- /dev/null
+++ b/sysdeps/ieee754/float128/k_tanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/k_tanl.c"
diff --git a/sysdeps/ieee754/float128/lgamma_negf128.c b/sysdeps/ieee754/float128/lgamma_negf128.c
new file mode 100644
index 0000000..9c16f93
--- /dev/null
+++ b/sysdeps/ieee754/float128/lgamma_negf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/lgamma_negl.c"
diff --git a/sysdeps/ieee754/float128/lgamma_productf128.c b/sysdeps/ieee754/float128/lgamma_productf128.c
new file mode 100644
index 0000000..5efe5dd
--- /dev/null
+++ b/sysdeps/ieee754/float128/lgamma_productf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/lgamma_productl.c"
diff --git a/sysdeps/ieee754/float128/s_asinhf128.c b/sysdeps/ieee754/float128/s_asinhf128.c
new file mode 100644
index 0000000..7b93d8c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_asinhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_asinhl.c"
diff --git a/sysdeps/ieee754/float128/s_atanf128.c b/sysdeps/ieee754/float128/s_atanf128.c
new file mode 100644
index 0000000..9b4d7ec
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_atanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_atanl.c"
diff --git a/sysdeps/ieee754/float128/s_canonicalizef128.c b/sysdeps/ieee754/float128/s_canonicalizef128.c
new file mode 100644
index 0000000..7c7a0bd
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_canonicalizef128.c
@@ -0,0 +1,2 @@
+#include <math-type-macros-float128.h>
+#include <math/s_canonicalize_template.c>
diff --git a/sysdeps/ieee754/float128/s_cbrtf128.c b/sysdeps/ieee754/float128/s_cbrtf128.c
new file mode 100644
index 0000000..3bd5797
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_cbrtf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_cbrtl.c"
diff --git a/sysdeps/ieee754/float128/s_ceilf128.c b/sysdeps/ieee754/float128/s_ceilf128.c
new file mode 100644
index 0000000..0af15f5
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_ceilf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_ceill.c"
diff --git a/sysdeps/ieee754/float128/s_copysignf128.c b/sysdeps/ieee754/float128/s_copysignf128.c
new file mode 100644
index 0000000..808f7ab
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_copysignf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_copysignl.c"
diff --git a/sysdeps/ieee754/float128/s_cosf128.c b/sysdeps/ieee754/float128/s_cosf128.c
new file mode 100644
index 0000000..8ba5526
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_cosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_cosl.c"
diff --git a/sysdeps/ieee754/float128/s_erff128.c b/sysdeps/ieee754/float128/s_erff128.c
new file mode 100644
index 0000000..ac16ad6
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_erff128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_erfl.c"
diff --git a/sysdeps/ieee754/float128/s_expm1f128.c b/sysdeps/ieee754/float128/s_expm1f128.c
new file mode 100644
index 0000000..ea28d89
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_expm1f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_expm1l.c"
diff --git a/sysdeps/ieee754/float128/s_fabsf128.c b/sysdeps/ieee754/float128/s_fabsf128.c
new file mode 100644
index 0000000..79ba47c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fabsf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_fabsl.c"
diff --git a/sysdeps/ieee754/float128/s_finitef128.c b/sysdeps/ieee754/float128/s_finitef128.c
new file mode 100644
index 0000000..801de88
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_finitef128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_finitel.c"
diff --git a/sysdeps/ieee754/float128/s_floorf128.c b/sysdeps/ieee754/float128/s_floorf128.c
new file mode 100644
index 0000000..1829843
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_floorf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_floorl.c"
diff --git a/sysdeps/ieee754/float128/s_fmaf128.c b/sysdeps/ieee754/float128/s_fmaf128.c
new file mode 100644
index 0000000..6497895
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fmaf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_fmal.c"
diff --git a/sysdeps/ieee754/float128/s_fpclassifyf128.c b/sysdeps/ieee754/float128/s_fpclassifyf128.c
new file mode 100644
index 0000000..15131dc
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fpclassifyf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_fpclassifyl.c"
diff --git a/sysdeps/ieee754/float128/s_frexpf128.c b/sysdeps/ieee754/float128/s_frexpf128.c
new file mode 100644
index 0000000..7b040b3
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_frexpf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_frexpl.c"
diff --git a/sysdeps/ieee754/float128/s_fromfpf128.c b/sysdeps/ieee754/float128/s_fromfpf128.c
new file mode 100644
index 0000000..891de3d
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fromfpf128.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 0
+#define FUNC fromfpf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
diff --git a/sysdeps/ieee754/float128/s_fromfpxf128.c b/sysdeps/ieee754/float128/s_fromfpxf128.c
new file mode 100644
index 0000000..0159ae2
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_fromfpxf128.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 0
+#define INEXACT 1
+#define FUNC fromfpxl
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
diff --git a/sysdeps/ieee754/float128/s_getpayloadf128.c b/sysdeps/ieee754/float128/s_getpayloadf128.c
new file mode 100644
index 0000000..2e2607a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_getpayloadf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_getpayloadl.c"
diff --git a/sysdeps/ieee754/float128/s_isinff128.c b/sysdeps/ieee754/float128/s_isinff128.c
new file mode 100644
index 0000000..62cc424
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_isinff128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_isinfl.c"
diff --git a/sysdeps/ieee754/float128/s_isnanf128.c b/sysdeps/ieee754/float128/s_isnanf128.c
new file mode 100644
index 0000000..efba240
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_isnanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_isnanl.c"
diff --git a/sysdeps/ieee754/float128/s_issignalingf128.c b/sysdeps/ieee754/float128/s_issignalingf128.c
new file mode 100644
index 0000000..1d45995
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_issignalingf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_issignalingl.c"
diff --git a/sysdeps/ieee754/float128/s_llrintf128.c b/sysdeps/ieee754/float128/s_llrintf128.c
new file mode 100644
index 0000000..bb9ca58
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_llrintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_llrintl.c"
diff --git a/sysdeps/ieee754/float128/s_llroundf128.c b/sysdeps/ieee754/float128/s_llroundf128.c
new file mode 100644
index 0000000..be54a90
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_llroundf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_llroundl.c"
diff --git a/sysdeps/ieee754/float128/s_log1pf128.c b/sysdeps/ieee754/float128/s_log1pf128.c
new file mode 100644
index 0000000..48bb84f
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_log1pf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_log1pl.c"
diff --git a/sysdeps/ieee754/float128/s_logbf128.c b/sysdeps/ieee754/float128/s_logbf128.c
new file mode 100644
index 0000000..167384a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_logbf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_logbl.c"
diff --git a/sysdeps/ieee754/float128/s_lrintf128.c b/sysdeps/ieee754/float128/s_lrintf128.c
new file mode 100644
index 0000000..1cfa9d7
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_lrintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_lrintl.c"
diff --git a/sysdeps/ieee754/float128/s_lroundf128.c b/sysdeps/ieee754/float128/s_lroundf128.c
new file mode 100644
index 0000000..13ba9f2
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_lroundf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_lroundl.c"
diff --git a/sysdeps/ieee754/float128/s_modff128.c b/sysdeps/ieee754/float128/s_modff128.c
new file mode 100644
index 0000000..4618c6c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_modff128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_modfl.c"
diff --git a/sysdeps/ieee754/float128/s_nearbyintf128.c b/sysdeps/ieee754/float128/s_nearbyintf128.c
new file mode 100644
index 0000000..e61a3b3
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nearbyintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_nearbyintl.c"
diff --git a/sysdeps/ieee754/float128/s_nextafterf128.c b/sysdeps/ieee754/float128/s_nextafterf128.c
new file mode 100644
index 0000000..2c43a00
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nextafterf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_nextafterl.c"
diff --git a/sysdeps/ieee754/float128/s_nexttowardf128.c b/sysdeps/ieee754/float128/s_nexttowardf128.c
new file mode 100644
index 0000000..006e4c9
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nexttowardf128.c
@@ -0,0 +1 @@
+/* This function does not exist for _FloatN types.  */
diff --git a/sysdeps/ieee754/float128/s_nextupf128.c b/sysdeps/ieee754/float128/s_nextupf128.c
new file mode 100644
index 0000000..7d5d0b8
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_nextupf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_nextupl.c"
diff --git a/sysdeps/ieee754/float128/s_remquof128.c b/sysdeps/ieee754/float128/s_remquof128.c
new file mode 100644
index 0000000..1cef61a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_remquof128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_remquol.c"
diff --git a/sysdeps/ieee754/float128/s_rintf128.c b/sysdeps/ieee754/float128/s_rintf128.c
new file mode 100644
index 0000000..2adb95f
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_rintf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_rintl.c"
diff --git a/sysdeps/ieee754/float128/s_roundevenf128.c b/sysdeps/ieee754/float128/s_roundevenf128.c
new file mode 100644
index 0000000..5a9b3f3
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_roundevenf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_roundevenl.c"
diff --git a/sysdeps/ieee754/float128/s_roundf128.c b/sysdeps/ieee754/float128/s_roundf128.c
new file mode 100644
index 0000000..1eb36f2
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_roundf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_roundl.c"
diff --git a/sysdeps/ieee754/float128/s_scalblnf128.c b/sysdeps/ieee754/float128/s_scalblnf128.c
new file mode 100644
index 0000000..999223c
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_scalblnf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_scalblnl.c"
diff --git a/sysdeps/ieee754/float128/s_scalbnf128.c b/sysdeps/ieee754/float128/s_scalbnf128.c
new file mode 100644
index 0000000..0e7ab26
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_scalbnf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_scalbnl.c"
diff --git a/sysdeps/ieee754/float128/s_setpayloadf128.c b/sysdeps/ieee754/float128/s_setpayloadf128.c
new file mode 100644
index 0000000..63e046a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_setpayloadf128.c
@@ -0,0 +1,4 @@
+#include <float128_private.h>
+#define SIG 0
+#define FUNC setpayloadf128
+#include "../ldbl-128/s_setpayloadl_main.c"
diff --git a/sysdeps/ieee754/float128/s_setpayloadsigf128.c b/sysdeps/ieee754/float128/s_setpayloadsigf128.c
new file mode 100644
index 0000000..85b2c4a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_setpayloadsigf128.c
@@ -0,0 +1,4 @@
+#include <float128_private.h>
+#define SIG 1
+#define FUNC setpayloadsigf128
+#include "../ldbl-128/s_setpayloadl_main.c"
diff --git a/sysdeps/ieee754/float128/s_signbitf128.c b/sysdeps/ieee754/float128/s_signbitf128.c
new file mode 100644
index 0000000..71c1ca3
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_signbitf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_signbitl.c"
diff --git a/sysdeps/ieee754/float128/s_significandf128.c b/sysdeps/ieee754/float128/s_significandf128.c
new file mode 100644
index 0000000..067b724
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_significandf128.c
@@ -0,0 +1 @@
+/* Not defined for _FloatN types.  */
diff --git a/sysdeps/ieee754/float128/s_sincosf128.c b/sysdeps/ieee754/float128/s_sincosf128.c
new file mode 100644
index 0000000..472adde
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_sincosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_sincosl.c"
diff --git a/sysdeps/ieee754/float128/s_sinf128.c b/sysdeps/ieee754/float128/s_sinf128.c
new file mode 100644
index 0000000..d79a116
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_sinf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_sinl.c"
diff --git a/sysdeps/ieee754/float128/s_tanf128.c b/sysdeps/ieee754/float128/s_tanf128.c
new file mode 100644
index 0000000..382961a
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_tanf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_tanl.c"
diff --git a/sysdeps/ieee754/float128/s_tanhf128.c b/sysdeps/ieee754/float128/s_tanhf128.c
new file mode 100644
index 0000000..e02c9a6
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_tanhf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_tanhl.c"
diff --git a/sysdeps/ieee754/float128/s_totalorderf128.c b/sysdeps/ieee754/float128/s_totalorderf128.c
new file mode 100644
index 0000000..1b115d8
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_totalorderf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_totalorderl.c"
diff --git a/sysdeps/ieee754/float128/s_totalordermagf128.c b/sysdeps/ieee754/float128/s_totalordermagf128.c
new file mode 100644
index 0000000..e44c657
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_totalordermagf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_totalordermagl.c"
diff --git a/sysdeps/ieee754/float128/s_truncf128.c b/sysdeps/ieee754/float128/s_truncf128.c
new file mode 100644
index 0000000..474d9dc
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_truncf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/s_truncl.c"
diff --git a/sysdeps/ieee754/float128/s_ufromfpf128.c b/sysdeps/ieee754/float128/s_ufromfpf128.c
new file mode 100644
index 0000000..0cd2281
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_ufromfpf128.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 0
+#define FUNC ufromfpf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
diff --git a/sysdeps/ieee754/float128/s_ufromfpxf128.c b/sysdeps/ieee754/float128/s_ufromfpxf128.c
new file mode 100644
index 0000000..c0cd7e3
--- /dev/null
+++ b/sysdeps/ieee754/float128/s_ufromfpxf128.c
@@ -0,0 +1,5 @@
+#define UNSIGNED 1
+#define INEXACT 1
+#define FUNC ufromfpxf128
+#include <float128_private.h>
+#include "../ldbl-128/s_fromfpl_main.c"
diff --git a/sysdeps/ieee754/float128/t_sincosf128.c b/sysdeps/ieee754/float128/t_sincosf128.c
new file mode 100644
index 0000000..7e699d3
--- /dev/null
+++ b/sysdeps/ieee754/float128/t_sincosf128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/t_sincosl.c"
diff --git a/sysdeps/ieee754/float128/w_llogbf128.c b/sysdeps/ieee754/float128/w_llogbf128.c
new file mode 100644
index 0000000..f83657d
--- /dev/null
+++ b/sysdeps/ieee754/float128/w_llogbf128.c
@@ -0,0 +1,3 @@
+#define declare_mgen_alias(from, to) weak_alias (M_SUF (from), M_SUF (to))
+#include <math-type-macros-float128.h>
+#include <w_llogb_template.c>
diff --git a/sysdeps/ieee754/float128/x2y2m1f128.c b/sysdeps/ieee754/float128/x2y2m1f128.c
new file mode 100644
index 0000000..6888079
--- /dev/null
+++ b/sysdeps/ieee754/float128/x2y2m1f128.c
@@ -0,0 +1,2 @@
+#include <float128_private.h>
+#include "../ldbl-128/x2y2m1l.c"
diff --git a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
index 198234c..7ddb368 100644
--- a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
+++ b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
@@ -27,6 +27,9 @@ extern int __iscanonicall (long double __x)
      __THROW __attribute__ ((__const__));
 # define __iscanonicalf(x) ((void) (__typeof (x)) (x), 1)
 # define __iscanonical(x) ((void) (__typeof (x)) (x), 1)
+# if __HAVE_DISTINCT_FLOAT128
+#  define __iscanonicalf128(x) ((void) (__typeof (x)) (x), 1)
+# endif
 
 /* Return nonzero value if X is canonical.  In IEEE interchange binary
    formats, all values are canonical, but the argument must still be
diff --git a/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h b/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h
index 7a711a8..ff0c04f 100644
--- a/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h
+++ b/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h
@@ -48,6 +48,7 @@ typedef _Complex float __cfloat128 __attribute__ ((mode (KC)));
 #  define __builtin_fabsf128 __builtin_fabsq
 #  define __builtin_inff128 __builtin_infq
 #  define __builtin_nanf128 __builtin_nanq
+#  define __builtin_nansf128 __builtin_nansq
 # endif
 
 /* __builtin_signbit is type generic in GCC 6.2, which is the minimum
-- 
2.4.11

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v3 4/8] float128: Add public _Float128 declarations to libm.
  2017-05-09 18:49             ` [PATCH v3 " Gabriel F. T. Gomes
@ 2017-05-09 22:56               ` Joseph Myers
  2017-05-10 11:44                 ` Joseph Myers
  2017-05-11 20:49                 ` Gabriel F. T. Gomes
  0 siblings, 2 replies; 43+ messages in thread
From: Joseph Myers @ 2017-05-09 22:56 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

I don't see patch 7 in this patch set.  When resending a patch series, 
please make the resent series self-contained, even if some patches didn't 
get changed.  (And really it would be best to say patch N/5 rather than /8 
if the first three patches are now in, so no longer part of the new 
series.)

On Tue, 9 May 2017, Gabriel F. T. Gomes wrote:

> +# ifndef __FLOATN_TYPE

The preferred convention where possible is macros defined to nonzero or 0, 
rather than defined/undefined.  So for consistency with 
__MATH_DECLARING_DOUBLE, I think you should have a macro 
__MATH_DECLARING_FLOATN, defined to 1 when bits/mathcalls.h (etc.) is 
included for _Float128, 0 when it is included for float / double / long 
double.

I think this patch is a better place than patch 8 to include the 
definition of SNANF128.

> +/* Include the file of declarations again, this time using `_Float128'
> +   instead of `double' and appending f128 to each function name.  */
> +
> +#if __HAVE_DISTINCT_FLOAT128

That's not the right logically condition for when to declare (subject to 
__GLIBC_USE (IEC_60559_TYPES_EXT)) most functions.  I think 
__HAVE_FLOAT128 && !defined _LIBC might be better, by analogy with the 
conditions for declaring long double functions.  (long double tests 
_LIBC_TEST as well, but _LIBC_TEST use ought to be obsolete after Zack's 
patch to avoid internal declarations, including _LIBC, for most of the 
testsuite).

> +# include <bits/mathcalls-helper-functions.h>

Then, you'd add a test for __HAVE_DISTINCT_FLOAT128 around this include.

> +# if __GLIBC_USE (IEC_60559_TYPES_EXT)
> +#  include <bits/mathcalls.h>
> +# endif

And this one would stay as-is.

> +#if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT) && defined __USE_GNU
> +# if defined __GNUC__ && !__GNUC_PREREQ (7,0)
> +#  define __f128(x) x ## q
> +# else
> +#  define __f128(x) x ## f128
> +# endif

__USE_GNU implies __GLIBC_USE (IEC_60559_TYPES_EXT), so you don't need to 
test the latter here.

You have a default #undef of __CFLOAT128 in bits/floatn.h, but __f128 in 
math.h and __L in bits/floatn-compat.h.  We should have a coherent design 
for where the definitions of helper macros such as __CFLOAT128 and __f128 
go.  I wonder about the following:

* bits/floatn.h defines __f128 (when _Float128 is supported) to the 
definition concatenating f128 as a suffix.  The default bits/floatn.h 
would need a comment about this (but no definition).  It defines 
__CFLOAT128 to _Complex _Float128 when _Float128 is supported (the default 
is #undef when _Float128 is not supported) - not just for old compilers.

* bits/floatn-compat.h gives a #error if bits/floatn.h hasn't already been 
included.  It defines such things as __builtin_huge_valf128 that need 
overriding for old compilers.  In the old compiler case, it undefines and 
redefines __f128 and __CFLOAT128.  For the new compiler case, it has 
nothing to do.  __L disappears (replaced by __f128).

You also need to make headers that need bits/floatn-compat.h include it; I 
don't see any #includes of bits/floatn-compat.h in this patch.

Or maybe nothing actually requires bits/floatn.h and bits/floatn-compat.h 
to be separate and all the definitions should just go in bits/floatn.h 
unless and until there are two architectures that need different versions 
of one of the headers but the same version of the other.  That would avoid 
various places needing to #include bits/floatn-compat.h, and avoid the 
need to get includes in the correct order.

> diff --git a/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h b/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h

I think this file would better be in one of the patches actually adding 
support on powerpc rather than in the present series, but I may as well 
review the contents now.

> new file mode 100644
> index 0000000..7a711a8
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h

GCC supports a range of multilib configurations with both BE and LE 
libraries for powerpc64.

In such configurations, the same headers are shared between multilibs.  So 
you can't have a separate version of an installed header for powerpc64le.  
Instead, you need to have one header with appropriate preprocessor 
conditionals that express that _Float128 is supported for powerpc64le, but 
not for BE.  And it would go in sysdeps/powerpc so all powerpc 
configurations get that same header installed.

> +#if __HAVE_FLOAT128
> +
> +/* The type _Float128, as well as the literal suffix (F128), exist for powerpc
> +   only since GCC 7.0.  */
> +# if !__GNUC_PREREQ (7, 0)
> +#  define __L(x) x##Q
> +typedef __float128 _Float128;
> +# else
> +#  define __L(x) x##F128
> +# endif

As noted, combine with __f128.

> +/* Add a typedef for older GCC compilers which don't natively support
> +   _Complex _Float128.  */
> +# if !__GNUC_PREREQ (7, 0) && !defined __CFLOAT128
> +typedef _Complex float __cfloat128 __attribute__ ((mode (KC)));

This is not namespace-clean; you need to use __mode__ (__KC__).

> +/* __builtin_signbit is type generic in GCC 6.2, which is the minimum
> +   version required for float128 support on powerpc64le.  */
> +# define __builtin_signbitf128 __builtin_signbit

I think a better approach would be to have math.h use type-generic 
__builtin_signbit (without __MATH_TG) if __GNUC_PREREQ (6,0).  Then 
nothing will ever try to call __builtin_signbitf128, because bits/floatn.h 
won't declare any _Float128 support for GCC versions without type-generic 
__builtin_signbit, and so __MATH_TG will be defined for such versions 
without _Float128 support.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v3 5/8] float128: Include math-finite.h for _Float128
  2017-05-09 18:54     ` [PATCH v3 " Gabriel F. T. Gomes
@ 2017-05-09 22:57       ` Joseph Myers
  0 siblings, 0 replies; 43+ messages in thread
From: Joseph Myers @ 2017-05-09 22:57 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

On Tue, 9 May 2017, Gabriel F. T. Gomes wrote:

> +# if !__MATH_DECLARING_FLOAT128
>  __MATH_REDIRCALL_2 (pow10, , (_Mdouble_), exp10);
> +# endif

Should be __MATH_DECLARING_FLOATN (the same macro as I suggested for 
bits/mathcalls.h use), as this would apply to all _FloatN types.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v3 6/8] float128: Add private _Float128 declarations for libm.
  2017-05-09 18:58     ` [PATCH v3 " Gabriel F. T. Gomes
@ 2017-05-09 23:04       ` Joseph Myers
  2017-05-11 20:50         ` Gabriel F. T. Gomes
  0 siblings, 1 reply; 43+ messages in thread
From: Joseph Myers @ 2017-05-09 23:04 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

On Tue, 9 May 2017, Gabriel F. T. Gomes wrote:

> diff --git a/include/complex.h b/include/complex.h
> index 082e71f..238ecbe 100644
> --- a/include/complex.h
> +++ b/include/complex.h
> @@ -8,6 +8,13 @@
>  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
> +#   ifdef __CFLOAT128
> +extern __CFLOAT128 __kernel_casinhf128 (__CFLOAT128 z, int adj);
> +#   else
> +extern _Complex _Float128 __kernel_casinhf128 (_Complex _Float128 z, int adj);
> +#   endif
> +#  endif
>  # endif

If you arrange things so that __CFLOAT128 is always defined when _Float128 
is supported (but sometimes defined to _Complex _Float128, when the 
compiler is new enough), you no longer need the conditional on whether it 
is defined here.

> +#ifdef __CFLOAT128
> +# define CFLOAT __CFLOAT128
> +#else
> +# define CFLOAT _Complex _Float128
> +#endif

Likewise.

> +#define M_MLIT(c) c ## f128

I'd expect this to cause trouble when building glibc with GCC 6; don't you 
need to use __f128 to allow for that?

> +#if __HAVE_DISTINCT_FLOAT128
> +# define _Mdouble_ _Float128
> +# define _MSUF_ f128
> +# define __MATH_DECLARING_FLOAT128
> +# include <math_private_calls.h>
> +# undef __MATH_DECLARING_FLOAT128

__MATH_DECLARING_FLOATN, as elsewhere.

> +extern inline _Float128
> +signbitf128 (_Float128 x)
> +{
> +  return __builtin_signbit (x);

Why is this needed?  There should be no public or private interface 
signbitf128, and all glibc-internal calls should be using the type-generic 
signbit macro.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v3 8/8] float128: Add wrappers to override ldbl-128 as float128.
  2017-05-09 19:11     ` [PATCH v3 " Gabriel F. T. Gomes
@ 2017-05-09 23:14       ` Joseph Myers
  0 siblings, 0 replies; 43+ messages in thread
From: Joseph Myers @ 2017-05-09 23:14 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

On Tue, 9 May 2017, Gabriel F. T. Gomes wrote:

> 	* math/math.h [__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
> 	(SNANF128): New macro.

As noted, I think this belongs in patch 4 alongside HUGE_VAL_F128.

> 	* sysdeps/ieee754/float128/s_canonicalizef128.c: New file.

You shouldn't need this file.  The type-generic templates machinery should 
build canonicalizef128 from the template automatically when you enable 
float128 support.

> diff --git a/math/math.h b/math/math.h
> index 4fc96ac..ed713df 100644
> --- a/math/math.h
> +++ b/math/math.h
> @@ -63,6 +63,9 @@ __BEGIN_DECLS
>  #  define SNAN (__builtin_nans (""))
>  #  define SNANL (__builtin_nansl (""))
>  # endif
> +# if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
> +#  define SNANF128 (__builtin_nansf128 (""))
> +# endif
>  #endif

This (moved to patch 4) should move outside the __GLIBC_USE 
(IEC_60559_BFP_EXT) conditional (as with the function declarations, macros 
added in TS 18661-1 have their _FloatN versions defined with 
__STDC_WANT_IEC_60559_TYPES_EXT__, whether or not 
__STDC_WANT_IEC_60559_BFP_EXT__ is defined).

> diff --git a/sysdeps/ieee754/float128/s_fromfpf128.c b/sysdeps/ieee754/float128/s_fromfpf128.c
> new file mode 100644
> index 0000000..891de3d
> --- /dev/null
> +++ b/sysdeps/ieee754/float128/s_fromfpf128.c
> @@ -0,0 +1,5 @@
> +#define UNSIGNED 0
> +#define INEXACT 0
> +#define FUNC fromfpf128
> +#include <float128_private.h>
> +#include "../ldbl-128/s_fromfpl_main.c"
> diff --git a/sysdeps/ieee754/float128/s_fromfpxf128.c b/sysdeps/ieee754/float128/s_fromfpxf128.c
> new file mode 100644
> index 0000000..0159ae2
> --- /dev/null
> +++ b/sysdeps/ieee754/float128/s_fromfpxf128.c
> @@ -0,0 +1,5 @@
> +#define UNSIGNED 0
> +#define INEXACT 1
> +#define FUNC fromfpxl

I'd say that for the fromfp functions you should be consistent about 
whether the wrappers define FUNC to the *f128 name, or whether you use a 
separate define of the *l name to the *f128 name and define FUNC to the *l 
name.

> diff --git a/sysdeps/ieee754/float128/w_llogbf128.c b/sysdeps/ieee754/float128/w_llogbf128.c
> new file mode 100644
> index 0000000..f83657d
> --- /dev/null
> +++ b/sysdeps/ieee754/float128/w_llogbf128.c
> @@ -0,0 +1,3 @@
> +#define declare_mgen_alias(from, to) weak_alias (M_SUF (from), M_SUF (to))
> +#include <math-type-macros-float128.h>
> +#include <w_llogb_template.c>

That's the default definition of declare_mgen_alias.  You shouldn't need 
this file; the template machinery should do the right thing without it.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v3 4/8] float128: Add public _Float128 declarations to libm.
  2017-05-09 22:56               ` Joseph Myers
@ 2017-05-10 11:44                 ` Joseph Myers
  2017-05-11 20:49                 ` Gabriel F. T. Gomes
  1 sibling, 0 replies; 43+ messages in thread
From: Joseph Myers @ 2017-05-10 11:44 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

On Tue, 9 May 2017, Joseph Myers wrote:

> > +/* Include the file of declarations again, this time using `_Float128'
> > +   instead of `double' and appending f128 to each function name.  */
> > +
> > +#if __HAVE_DISTINCT_FLOAT128
> 
> That's not the right logically condition for when to declare (subject to 
> __GLIBC_USE (IEC_60559_TYPES_EXT)) most functions.  I think 
> __HAVE_FLOAT128 && !defined _LIBC might be better, by analogy with the 
> conditions for declaring long double functions.  (long double tests 
> _LIBC_TEST as well, but _LIBC_TEST use ought to be obsolete after Zack's 
> patch to avoid internal declarations, including _LIBC, for most of the 
> testsuite).

Correction:

If there's a distinct _Float128, the functions should be declared, both 
inside and outside libc.  If it exists but is not distinct, they should 
only be declared outside libc.  So:

#if __HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC)

should be right.

Also, for the patch where bits/floatn.h is added for powerpc64le: note 
that GCC 7 supports _Float128 and the f128 constant suffix for C, not for 
C++.  The header will need to do appropriate things for C++: either 
declare the feature not to be supported, or, if you want to be able to use 
the APIs for C++ (which seems sensible), map _Float128 to __float128 for 
C++ even for GCC 7 and later.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v3 4/8] float128: Add public _Float128 declarations to libm.
  2017-05-09 22:56               ` Joseph Myers
  2017-05-10 11:44                 ` Joseph Myers
@ 2017-05-11 20:49                 ` Gabriel F. T. Gomes
  2017-05-11 21:57                   ` Joseph Myers
  1 sibling, 1 reply; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-05-11 20:49 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1969 bytes --]

On Tue, 9 May 2017 22:56:22 +0000
Joseph Myers <joseph@codesourcery.com> wrote:

> On Tue, 9 May 2017, Gabriel F. T. Gomes wrote:
>
> > --- /dev/null
> > +++ b/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h  
> 
> GCC supports a range of multilib configurations with both BE and LE 
> libraries for powerpc64.
> 
> In such configurations, the same headers are shared between multilibs.  So 
> you can't have a separate version of an installed header for powerpc64le.  
> Instead, you need to have one header with appropriate preprocessor 
> conditionals that express that _Float128 is supported for powerpc64le, but 
> not for BE.  And it would go in sysdeps/powerpc so all powerpc 
> configurations get that same header installed.

OK.

> Or maybe nothing actually requires bits/floatn.h and bits/floatn-compat.h 
> to be separate and all the definitions should just go in bits/floatn.h 
> unless and until there are two architectures that need different versions 
> of one of the headers but the same version of the other.  That would avoid 
> various places needing to #include bits/floatn-compat.h, and avoid the 
> need to get includes in the correct order.

With bits/floatn.h moved from sysdeps/powerpc/powerpc64le to
sysdeps/powerpc (as explained above), merging bits/floatn-compat.h into
bits/floatn.h means that the workarounds for old compilers will be visible
in the headers for powerpc and powerpc64 installations.  That doesn't mean
that the workarounds will be defined (since they'll be inside #if
clauses).  Is that visibility a problem?

> > diff --git a/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h b/sysdeps/powerpc/powerpc64le/bits/floatn-compat.h  
> 
> I think this file would better be in one of the patches actually adding 
> support on powerpc rather than in the present series, but I may as well 
> review the contents now.

Since I moved this change to a future patch.  I attached the file here in
case you want to comment at this time.

[-- Attachment #2: floatn.h --]
[-- Type: text/x-chdr, Size: 3172 bytes --]

/* Macros to control TS 18661-3 glibc features on powerpc.
   Copyright (C) 2016 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/>.  */

#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
#include <bits/libc-header-start.h>

/* 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.  */
#if defined _ARCH_PWR8 && defined __LITTLE_ENDIAN__ && (_CALL_ELF == 2) \
    && defined __FLOAT128__
# define __HAVE_FLOAT128 1
#else
# define __HAVE_FLOAT128 0
#endif

/* 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.  */
#if __HAVE_FLOAT128
# define __HAVE_DISTINCT_FLOAT128 1
#else
# define __HAVE_DISTINCT_FLOAT128 0
#endif

/* Defined to concatenate the literal suffix to be used with _Float128
   types, if __HAVE_FLOAT128 is 1. */
#if __HAVE_FLOAT128
# if !__GNUC_PREREQ (7, 0)
/* The literal suffix (f128) exist for powerpc only since GCC 7.0.  */
#  define __f128(x) x##q
# else
#  define __f128(x) x##f128
# endif
#endif

/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.  */
#if __HAVE_FLOAT128
# if !__GNUC_PREREQ (7, 0)
/* Add a typedef for older GCC compilers which don't natively support
   _Complex _Float128.  */
typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__KC__)));
#  define __CFLOAT128 __cfloat128
# else
#  define __CFLOAT128 _Complex _Float128
# endif
#endif

/* The remaining of this file provides support for older compilers.  */
#if __HAVE_FLOAT128

/* The type _Float128 exist for powerpc only since GCC 7.0.  */
# if !__GNUC_PREREQ (7, 0)
typedef __float128 _Float128;
# endif

/* Builtin __builtin_huge_valf128 doesn't exist before GCC 7.0.  */
# if !__GNUC_PREREQ (7, 0)
#  define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ())
# endif

/* The following builtins (suffixed with 'q') are available in GCC >= 6.2,
   which is the minimum version required for float128 support on powerpc64le.
   Since GCC 7.0 the builtins suffixed with f128 are also available, then
   there is no need to redefined them.  */
# if !__GNUC_PREREQ (7, 0)
#  define __builtin_copysignf128 __builtin_copysignq
#  define __builtin_fabsf128 __builtin_fabsq
#  define __builtin_inff128 __builtin_infq
#  define __builtin_nanf128 __builtin_nanq
#  define __builtin_nansf128 __builtin_nansq
# endif

#endif

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v3 6/8] float128: Add private _Float128 declarations for libm.
  2017-05-09 23:04       ` Joseph Myers
@ 2017-05-11 20:50         ` Gabriel F. T. Gomes
  0 siblings, 0 replies; 43+ messages in thread
From: Gabriel F. T. Gomes @ 2017-05-11 20:50 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

On Tue, 9 May 2017 23:04:13 +0000
Joseph Myers <joseph@codesourcery.com> wrote:

> On Tue, 9 May 2017, Gabriel F. T. Gomes wrote:
> >
> > +#define M_MLIT(c) c ## f128  
> 
> I'd expect this to cause trouble when building glibc with GCC 6; don't you 
> need to use __f128 to allow for that?

The macro M_MLIT, as opposed to M_LIT, is used to concatenate the suffix
to macros such as M_E and M_LOG2E.  In our case, we get M_Ef128,
M_LOG2Ef128, etc., which are defined in math/math.h and already take care of
the workarounds for old compilers (through __f128()).

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v3 4/8] float128: Add public _Float128 declarations to libm.
  2017-05-11 20:49                 ` Gabriel F. T. Gomes
@ 2017-05-11 21:57                   ` Joseph Myers
  0 siblings, 0 replies; 43+ messages in thread
From: Joseph Myers @ 2017-05-11 21:57 UTC (permalink / raw)
  To: Gabriel F. T. Gomes; +Cc: libc-alpha

On Thu, 11 May 2017, Gabriel F. T. Gomes wrote:

> > Or maybe nothing actually requires bits/floatn.h and bits/floatn-compat.h 
> > to be separate and all the definitions should just go in bits/floatn.h 
> > unless and until there are two architectures that need different versions 
> > of one of the headers but the same version of the other.  That would avoid 
> > various places needing to #include bits/floatn-compat.h, and avoid the 
> > need to get includes in the correct order.
> 
> With bits/floatn.h moved from sysdeps/powerpc/powerpc64le to
> sysdeps/powerpc (as explained above), merging bits/floatn-compat.h into
> bits/floatn.h means that the workarounds for old compilers will be visible
> in the headers for powerpc and powerpc64 installations.  That doesn't mean
> that the workarounds will be defined (since they'll be inside #if
> clauses).  Is that visibility a problem?

No, it's expected.

> #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
> #include <bits/libc-header-start.h>

This shouldn't be necessary in bits/floatn.h, only in the including 
header.  (And I'd say that bits/floatn.h should have a multiple-inclusion 
guard.)

> /* Defined to concatenate the literal suffix to be used with _Float128
>    types, if __HAVE_FLOAT128 is 1. */
> #if __HAVE_FLOAT128
> # if !__GNUC_PREREQ (7, 0)
> /* The literal suffix (f128) exist for powerpc only since GCC 7.0.  */
> #  define __f128(x) x##q
> # else
> #  define __f128(x) x##f128
> # endif
> #endif

Needs to allow for C++ (given that you've defined __HAVE_FLOAT128 for C++, 
but C++ doesn't have the f128 suffix).

> /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.  */
> #if __HAVE_FLOAT128
> # if !__GNUC_PREREQ (7, 0)
> /* Add a typedef for older GCC compilers which don't natively support
>    _Complex _Float128.  */
> typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__KC__)));
> #  define __CFLOAT128 __cfloat128
> # else
> #  define __CFLOAT128 _Complex _Float128
> # endif
> #endif

Likewise.

> /* The type _Float128 exist for powerpc only since GCC 7.0.  */
> # if !__GNUC_PREREQ (7, 0)
> typedef __float128 _Float128;
> # endif

Would need to do this for C++ for newer compilers as well.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2017-05-11 21:57 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-28 21:35 [PATCH v2 0/8] Add float128 functions and declarations to libm Gabriel F. T. Gomes
2017-04-28 21:35 ` [PATCH v2 2/8] float128: Add _Float128 make bits " Gabriel F. T. Gomes
2017-05-01 12:00   ` Joseph Myers
2017-05-02 19:46     ` Gabriel F. T. Gomes
2017-05-02 20:33       ` Joseph Myers
2017-05-08 18:22         ` [PATCH v3 1/2] " Gabriel F. T. Gomes
2017-05-08 19:05           ` Tulio Magno Quites Machado Filho
2017-05-08 20:53             ` Gabriel F. T. Gomes
2017-05-08 21:11               ` Joseph Myers
2017-05-08 21:24           ` Joseph Myers
2017-05-09 14:54             ` Gabriel F. T. Gomes
2017-04-28 21:35 ` [PATCH v2 7/8] float128: Enable use of IEEE wrapper templates Gabriel F. T. Gomes
2017-04-28 21:35 ` [PATCH v2 5/8] float128: Include math-finite.h for _Float128 Gabriel F. T. Gomes
2017-04-28 22:53   ` Joseph Myers
2017-05-09 18:54     ` [PATCH v3 " Gabriel F. T. Gomes
2017-05-09 22:57       ` Joseph Myers
2017-04-28 21:36 ` [PATCH v2 6/8] float128: Add private _Float128 declarations for libm Gabriel F. T. Gomes
2017-05-03 11:39   ` Joseph Myers
2017-05-09 18:58     ` [PATCH v3 " Gabriel F. T. Gomes
2017-05-09 23:04       ` Joseph Myers
2017-05-11 20:50         ` Gabriel F. T. Gomes
2017-04-28 21:36 ` [PATCH v2 1/8] ldbl-128: Use mathx_hidden_def inplace of hidden_def Gabriel F. T. Gomes
2017-05-01 11:39   ` Joseph Myers
2017-04-28 21:36 ` [PATCH v2 4/8] float128: Add public _Float128 declarations to libm Gabriel F. T. Gomes
2017-04-28 22:49   ` Joseph Myers
2017-05-02 20:53     ` Gabriel F. T. Gomes
2017-05-02 21:40       ` Joseph Myers
2017-05-04 12:58         ` Gabriel F. T. Gomes
2017-05-04 13:34           ` Joseph Myers
2017-05-09 18:49             ` [PATCH v3 " Gabriel F. T. Gomes
2017-05-09 22:56               ` Joseph Myers
2017-05-10 11:44                 ` Joseph Myers
2017-05-11 20:49                 ` Gabriel F. T. Gomes
2017-05-11 21:57                   ` Joseph Myers
2017-04-28 21:36 ` [PATCH v2 3/8] Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__ Gabriel F. T. Gomes
2017-05-03 11:36   ` Joseph Myers
2017-05-08 18:23     ` [PATCH v3 2/2] " Gabriel F. T. Gomes
2017-05-08 21:13       ` Joseph Myers
2017-05-09 14:56         ` Gabriel F. T. Gomes
2017-04-28 21:36 ` [PATCH v2 8/8] float128: Add wrappers to override ldbl-128 as float128 Gabriel F. T. Gomes
2017-05-02 21:51   ` Joseph Myers
2017-05-09 19:11     ` [PATCH v3 " Gabriel F. T. Gomes
2017-05-09 23:14       ` Joseph Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).