public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Mikael Morin <morin-mikael@orange.fr>
Cc: Harald Anlauf <anlauf@gmx.de>,
	gcc-patches@gcc.gnu.org,
	"Joseph S. Myers" <joseph@codesourcery.com>,
	fortran@gcc.gnu.org
Subject: [PATCH] fortran, libgfortran, v3: Avoid using libquadmath for glibc 2.26+
Date: Mon, 27 Jun 2022 15:30:49 +0200	[thread overview]
Message-ID: <YrmxCTxa3L5ZhNmy@tucnak> (raw)
In-Reply-To: <38312dfa-76c6-ee85-9f6a-80c6e2f7bcdb@orange.fr>

On Mon, Jun 27, 2022 at 01:56:10PM +0200, Mikael Morin wrote:
> Le 27/06/2022 à 09:54, Jakub Jelinek a écrit :
> > Still, using __float128 when the APIs are declared for __float128 and
> > _Float128 when the APIs are declared for _Float128 can be better for
> > consistency.
> > 
> I agree with that.
> I was implicitly suggesting to change the libquadmath API to use the
> standard syntax and types, with the assumption that it’s an internal thing
> used only by fortran (on the frontend side and on the library side). After
> documenting myself further, it seems that’s a wrong assumption.
> 
> 
> > If HAVE_FLOAT128 and GFC_REAL_16_IS_FLOAT128 stand for
> > _Float128 and libquadmath or *f128 APIs, we'd need some macro
> > to tell which APIs to use, say
> > USE_LIBQUADMATH and USE_IEC_60559.
> 
> That would be my preference, even if we keep both __float128 and _Float128,
> as it avoids exposing the detail of the provider of the math functions in
> many places it’s not needed.
> Half of the changes from your patch have pattern blah__float128 ||
> blah_Float128 or the negation of that, and wouldn’t be needed if the
> *FLOAT128 conditions spanned both __float128 and _Float128 (or libquadmath
> and libc).

Ok, here is an updated patch that uses _Float128/_Complex _Float128 for all
of GFC_REAL_{16,17}_IS_FLOAT128, but still uses q/Q suffixes on literal
constants etc. when using libquadmath and f128/F128 otherwise.
This patch also includes the incremental powerpc64le fixes.

Ok if it passes testing?

2022-06-27  Jakub Jelinek  <jakub@redhat.com>

gcc/fortran/
	* gfortran.h (gfc_real_info): Add use_iec_60559 bitfield.
	* trans-types.h (gfc_real16_use_iec_60559): Declare.
	* trans-types.cc (gfc_real16_use_iec_60559): Define.
	(gfc_init_kinds): When building powerpc64le-linux libgfortran
	on glibc 2.26 to 2.31, set gfc_real16_use_iec_60559 and
	use_iec_60559.
	(gfc_build_real_type): Set gfc_real16_use_iec_60559 and use_iec_60559
	on glibc 2.26 or later.
	* trans-intrinsic.cc (gfc_build_intrinsic_lib_fndecls): Adjust
	comment.  Handle gfc_real16_use_iec_60559.
	(gfc_get_intrinsic_lib_fndecl): Handle use_iec_60559.
libgfortran/
	* configure.ac: Check for strtof128 and strfromf128.
	Check for math and complex *f128 functions.  Set
	have_iec_60559_libc_support to yes if *f128 support is around, for
	--enable-libquadmath-support default to "default" rather than yes if
	have_iec_60559_libc_support is yes.
	* acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Test
	_Float128/_Complex _Float128 rather than __float128 and
	_Complex float __attribute__((mode(TC))).  If libquadmath support
	is defaulted and have_iec_60559_libc_support is yes, define and subst
	USE_IEC_60559.  Remove unused LIBGFOR_BUILD_QUAD conditional.
	* Makefile.am (kinds.h): Pass @USE_IEC_60559@ as an extra
	mk-kinds-h.sh argument.
	* mk-kinds-h.sh: Accept 4th use_iec_60559 argument.  Use
	_Float128/_Complex _Float128 types instead of __float128 and
        _Complex float __attribute__((mode(TC))), and if use_iec_60559 is yes,
	use f128 suffix instead of q and define GFC_REAL_16_USE_IEC_60559.
	* kinds-override.h: Use _Float128/_Complex _Float128 types instead of
	__float128 and _Complex float __attribute__((mode(TC))), if
	USE_IEC_60559 is defined, use f128 suffixes instead of q and
	define GFC_REAL_17_USE_IEC_60559.
	* libgfortran.h: Don't include quadmath_weak.h if USE_IEC_60559 is
	defined.
	(GFC_REAL_16_INFINITY, GFC_REAL_16_QUIET_NAN): Define
	for GFC_REAL_16_USE_IEC_60559 differently.
	* caf/single.c (convert_type): Use _Float128/_Complex _Float128
	instead of __float128 and _Complex float __attribute__((mode(TC))).
	For HAVE_GFC_REAL_10 when HAVE_GFC_REAL_16 isn't defined use
	_Complex long double instead of long double.
	* ieee/issignaling_fallback.h (ieee854_float128_shape_type): Use
	_Float128 instead of __float128.
	(__issignalingf128): Change argument type to _Float128.
	(issignaling): Use _Float128 instead of __float128 in _Generic.
	* intrinsics/cshift0.c (cshift0): Use _Float128 instead of __float128
	in a comment.  Fix a comment typo, logn double -> long double.
	* intrinsics/erfc_scaled.c (_THRESH, _M_2_SQRTPI, _INF, _ERFC, _EXP):
	Use different definitions if GFC_REAL_16_USE_IEC_60559.
	(_THRESH, _M_2_SQRTPI): Use GFC_REAL_17_LITERAL macro.
	(_ERFC, _EXP): Use different definitions if GFC_REAL_17_USE_IEC_60559.
	* intrinsics/spread_generic.c (spread, spread_scalar): Use _Float128
	instead of __float128 in a comment.  Fix a comment typo,
	logn double -> long double.
	* intrinsics/trigd.c (ENABLE_SIND, ENABLE_COSD, ENABLE_TAND): Handle
	GFC_REAL_16_USE_IEC_60559.
	* intrinsics/pack_generic.c (pack): Use _Float128 instead of
	__float128 in a comment.  Fix a comment typo, logn double ->
	long double.
	* intrinsics/unpack_generic.c (unpack1, unpack0): Likewise.
	* runtime/in_pack_generic.c (internal_pack): Likewise.
	* runtime/in_unpack_generic.c (internal_unpack): Likewise.
	* io/read.c (convert_real, convert_infnan): Handle
	GFC_REAL_16_USE_IEC_60559 and GFC_REAL_17_USE_IEC_60559.
	* io/transfer128.c (tmp1, tmp2): Don't define if libquadmath
	isn't needed.
	* io/write_float.def (gfor_strfromf128): New function.
	(DTOA2Q, FDTOA2Q): Define differently if
	GFC_REAL_16_USE_IEC_60559 or GFC_REAL_17_USE_IEC_60559.
	* m4/mtype.m4: Use different suffix if GFC_REAL_16_USE_IEC_60559
	or GFC_REAL_17_USE_IEC_60559.
	* config.h.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
	* generated/bessel_r16.c: Regenerated.
	* generated/bessel_r17.c: Regenerated.
	* generated/norm2_r16.c: Regenerated.
	* generated/norm2_r17.c: Regenerated.

--- gcc/fortran/gfortran.h.jj	2022-06-27 11:17:35.350412132 +0200
+++ gcc/fortran/gfortran.h	2022-06-27 12:12:46.420396577 +0200
@@ -2665,6 +2665,9 @@ typedef struct
   unsigned int c_double : 1;
   unsigned int c_long_double : 1;
   unsigned int c_float128 : 1;
+  /* True if for _Float128 C2X IEC 60559 *f128 APIs should be used
+     instead of libquadmath *q APIs.  */
+  unsigned int use_iec_60559 : 1;
 }
 gfc_real_info;
 
--- gcc/fortran/trans-types.h.jj	2022-06-27 11:17:35.545409608 +0200
+++ gcc/fortran/trans-types.h	2022-06-27 12:22:55.122565884 +0200
@@ -58,6 +58,10 @@ extern GTY(()) tree gfc_charlen_type_nod
    and _Float128.  */
 extern bool gfc_real16_is_float128;
 
+/* True if IEC 60559 *f128 APIs should be used for _Float128 rather than
+   libquadmath *q APIs.  */
+extern bool gfc_real16_use_iec_60559;
+
 enum gfc_packed {
   PACKED_NO = 0,
   PACKED_PARTIAL,
--- gcc/fortran/trans-types.cc.jj	2022-06-27 11:17:35.490410320 +0200
+++ gcc/fortran/trans-types.cc	2022-06-27 12:25:51.900291718 +0200
@@ -72,6 +72,7 @@ tree gfc_float128_type_node = NULL_TREE;
 tree gfc_complex_float128_type_node = NULL_TREE;
 
 bool gfc_real16_is_float128 = false;
+bool gfc_real16_use_iec_60559 = false;
 
 static GTY(()) tree gfc_desc_dim_type;
 static GTY(()) tree gfc_max_array_element_size;
@@ -522,6 +523,11 @@ gfc_init_kinds (void)
 		&& (TARGET_GLIBC_MAJOR < 2
 		    || (TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR < 32)))
 	      {
+		if (TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR >= 26)
+		  {
+		    gfc_real16_use_iec_60559 = true;
+		    gfc_real_kinds[i].use_iec_60559 = 1;
+		  }
 		gfc_real16_is_float128 = true;
 		gfc_real_kinds[i].c_float128 = 1;
 	      }
@@ -878,6 +884,12 @@ gfc_build_real_type (gfc_real_info *info
       /* TODO: see PR101835.  */
       info->c_float128 = 1;
       gfc_real16_is_float128 = true;
+      if (TARGET_GLIBC_MAJOR > 2
+	  || (TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR >= 26))
+	{
+	  info->use_iec_60559 = 1;
+	  gfc_real16_use_iec_60559 = true;
+	}
     }
 
   if (TYPE_PRECISION (float_type_node) == mode_precision)
--- gcc/fortran/trans-intrinsic.cc.jj	2022-06-27 11:17:35.468410605 +0200
+++ gcc/fortran/trans-intrinsic.cc	2022-06-27 12:17:52.825454813 +0200
@@ -692,7 +692,7 @@ gfc_build_intrinsic_lib_fndecls (void)
   {
     /* If we have soft-float types, we create the decls for their
        C99-like library functions.  For now, we only handle _Float128
-       q-suffixed functions.  */
+       q-suffixed or IEC 60559 f128-suffixed functions.  */
 
     tree type, complex_type, func_1, func_2, func_cabs, func_frexp;
     tree func_iround, func_lround, func_llround, func_scalbn, func_cpow;
@@ -739,7 +739,10 @@ gfc_build_intrinsic_lib_fndecls (void)
        builtin_decl_for_float_type(). The others are all constructed by
        gfc_get_intrinsic_lib_fndecl().  */
 #define OTHER_BUILTIN(ID, NAME, TYPE, CONST) \
-  quad_decls[BUILT_IN_ ## ID] = define_quad_builtin (NAME "q", func_ ## TYPE, CONST);
+    quad_decls[BUILT_IN_ ## ID]						\
+      = define_quad_builtin (gfc_real16_use_iec_60559			\
+			     ? NAME "f128" : NAME "q", func_ ## TYPE,	\
+			     CONST);
 
 #include "mathbuiltins.def"
 
@@ -751,8 +754,9 @@ gfc_build_intrinsic_lib_fndecls (void)
     /* There is one built-in we defined manually, because it gets called
        with builtin_decl_for_precision() or builtin_decl_for_float_type()
        even though it is not an OTHER_BUILTIN: it is SQRT.  */
-    quad_decls[BUILT_IN_SQRT] = define_quad_builtin ("sqrtq", func_1, true);
-
+    quad_decls[BUILT_IN_SQRT]
+      = define_quad_builtin (gfc_real16_use_iec_60559
+			     ? "sqrtf128" : "sqrtq", func_1, true);
   }
 
   /* Add GCC builtin functions.  */
@@ -875,7 +879,8 @@ gfc_get_intrinsic_lib_fndecl (gfc_intrin
 		  ts->type == BT_COMPLEX ? "c" : "", m->name, "l");
       else if (gfc_real_kinds[n].c_float128)
 	snprintf (name, sizeof (name), "%s%s%s",
-		  ts->type == BT_COMPLEX ? "c" : "", m->name, "q");
+		  ts->type == BT_COMPLEX ? "c" : "", m->name,
+		  gfc_real_kinds[n].use_iec_60559 ? "f128" : "q");
       else
 	gcc_unreachable ();
     }
--- libgfortran/configure.ac.jj	2022-06-27 11:17:35.801406295 +0200
+++ libgfortran/configure.ac	2022-06-27 13:46:10.735986510 +0200
@@ -356,7 +356,7 @@ else
    getcwd localtime_r gmtime_r getpwuid_r ttyname_r clock_gettime \
    getgid getpid getuid geteuid umask getegid \
    secure_getenv __secure_getenv mkostemp strnlen strndup newlocale \
-   freelocale uselocale strerror_l)
+   freelocale uselocale strerror_l strtof128 strfromf128)
 fi
 
 # Check strerror_r, cannot be above as versions with two and three arguments exist
@@ -582,24 +582,101 @@ GCC_CHECK_MATH_INLINE_BUILTIN_FALLBACK2(
 GCC_CHECK_MATH_INLINE_BUILTIN_FALLBACK1([fabs], [double])
 GCC_CHECK_MATH_INLINE_BUILTIN_FALLBACK1([fabsl], [long double])
 
+GCC_CHECK_MATH_FUNC([acosf128])
+GCC_CHECK_MATH_FUNC([acoshf128])
+GCC_CHECK_MATH_FUNC([asinf128])
+GCC_CHECK_MATH_FUNC([asinhf128])
+GCC_CHECK_MATH_FUNC([atan2f128])
+GCC_CHECK_MATH_FUNC([atanf128])
+GCC_CHECK_MATH_FUNC([atanhf128])
+GCC_CHECK_MATH_FUNC([cargf128])
+GCC_CHECK_MATH_FUNC([ceilf128])
+GCC_CHECK_MATH_FUNC([copysignf128])
+GCC_CHECK_MATH_FUNC([cosf128])
+GCC_CHECK_MATH_FUNC([ccosf128])
+GCC_CHECK_MATH_FUNC([coshf128])
+GCC_CHECK_MATH_FUNC([ccoshf128])
+GCC_CHECK_MATH_FUNC([expf128])
+GCC_CHECK_MATH_FUNC([cexpf128])
+GCC_CHECK_MATH_FUNC([fabsf128])
+GCC_CHECK_MATH_FUNC([cabsf128])
+GCC_CHECK_MATH_FUNC([floorf128])
+GCC_CHECK_MATH_FUNC([fmaf128])
+GCC_CHECK_MATH_FUNC([fmodf128])
+GCC_CHECK_MATH_FUNC([frexpf128])
+GCC_CHECK_MATH_FUNC([hypotf128])
+GCC_CHECK_MATH_FUNC([ldexpf128])
+GCC_CHECK_MATH_FUNC([logf128])
+GCC_CHECK_MATH_FUNC([clogf128])
+GCC_CHECK_MATH_FUNC([log10f128])
+GCC_CHECK_MATH_FUNC([clog10f128])
+GCC_CHECK_MATH_FUNC([nextafterf128])
+GCC_CHECK_MATH_FUNC([powf128])
+GCC_CHECK_MATH_FUNC([cpowf128])
+GCC_CHECK_MATH_FUNC([roundf128])
+GCC_CHECK_MATH_FUNC([lroundf128])
+GCC_CHECK_MATH_FUNC([llroundf128])
+GCC_CHECK_MATH_FUNC([scalbnf128])
+GCC_CHECK_MATH_FUNC([sinf128])
+GCC_CHECK_MATH_FUNC([csinf128])
+GCC_CHECK_MATH_FUNC([sinhf128])
+GCC_CHECK_MATH_FUNC([csinhf128])
+GCC_CHECK_MATH_FUNC([sqrtf128])
+GCC_CHECK_MATH_FUNC([csqrtf128])
+GCC_CHECK_MATH_FUNC([tanf128])
+GCC_CHECK_MATH_FUNC([ctanf128])
+GCC_CHECK_MATH_FUNC([tanhf128])
+GCC_CHECK_MATH_FUNC([ctanhf128])
+GCC_CHECK_MATH_FUNC([truncf128])
+GCC_CHECK_MATH_FUNC([erff128])
+GCC_CHECK_MATH_FUNC([erfcf128])
+GCC_CHECK_MATH_FUNC([j0f128])
+GCC_CHECK_MATH_FUNC([j1f128])
+GCC_CHECK_MATH_FUNC([jnf128])
+GCC_CHECK_MATH_FUNC([y0f128])
+GCC_CHECK_MATH_FUNC([y1f128])
+GCC_CHECK_MATH_FUNC([ynf128])
+GCC_CHECK_MATH_FUNC([tgammaf128])
+GCC_CHECK_MATH_FUNC([lgammaf128])
+
+GCC_CHECK_MATH_FUNC([cacosf128])
+GCC_CHECK_MATH_FUNC([cacoshf128])
+GCC_CHECK_MATH_FUNC([casinf128])
+GCC_CHECK_MATH_FUNC([casinhf128])
+GCC_CHECK_MATH_FUNC([catanf128])
+GCC_CHECK_MATH_FUNC([catanhf128])
+
 # Check whether the system has a working stat()
 LIBGFOR_CHECK_WORKING_STAT
 
 # Check whether __mingw_snprintf() is present
 LIBGFOR_CHECK_MINGW_SNPRINTF
 
+have_iec_60559_libc_support=no
+if test "x$ac_cv_func_strtof128$ac_cv_func_strfromf128" = xyesyes \
+   && test "x$gcc_cv_math_func_sinf128$gcc_cv_math_func_cacosf128" = xyesyes; then
+  have_iec_60559_libc_support=yes
+fi
+
 # Check whether libquadmath should be used
 AC_ARG_ENABLE(libquadmath-support,
 AS_HELP_STRING([--disable-libquadmath-support],
   [disable libquadmath support for Fortran]),
 ENABLE_LIBQUADMATH_SUPPORT=$enableval,
-ENABLE_LIBQUADMATH_SUPPORT=yes)
+if test "x$have_iec_60559_libc_support" = xyes; then
+  ENABLE_LIBQUADMATH_SUPPORT=default
+else
+  ENABLE_LIBQUADMATH_SUPPORT=yes
+fi)
 enable_libquadmath_support=
 if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
   enable_libquadmath_support=no
+elif test "${ENABLE_LIBQUADMATH_SUPPORT}" = "default" ; then
+  enable_libquadmath_support=default
 fi
 
-# Check whether we have a __float128 type, depends on enable_libquadmath_support
+# Check whether we have a _Float128 type, depends on enable_libquadmath_support
+# and have_iec_60559_libc_support.
 LIBGFOR_CHECK_FLOAT128
 
 # Check for GNU libc feenableexcept
--- libgfortran/acinclude.m4.jj	2022-06-27 11:17:35.639408392 +0200
+++ libgfortran/acinclude.m4	2022-06-27 13:49:28.473452130 +0200
@@ -264,31 +264,35 @@ __mingw_snprintf (NULL, 0, "%d\n", 1);
 dnl Check whether we have a __float128 type
 AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
   LIBQUADSPEC=
+  LIBQUADLIB=
+  LIBQUADLIB_DEP=
+  LIBQUADINCLUDE=
+  USE_IEC_60559=no
 
   if test "x$enable_libquadmath_support" != xno; then
 
-  AC_CACHE_CHECK([whether we have a usable __float128 type],
+  AC_CACHE_CHECK([whether we have a usable _Float128 type],
                  libgfor_cv_have_float128, [
    GCC_TRY_COMPILE_OR_LINK([
-    typedef _Complex float __attribute__((mode(TC))) __complex128;
-
-    __float128 foo (__float128 x)
+    _Float128 foo (_Float128 x)
     {
 
-     __complex128 z1, z2;
+     _Complex _Float128 z1, z2;
 
      z1 = x;
-     z2 = x / 7.Q;
+     z2 = x / 7.F128;
      z2 /= z1;
 
-     return (__float128) z2;
+     return (_Float128) z2;
     }
 
-    __float128 bar (__float128 x)
+    _Float128 bar (_Float128 x)
     {
-      return x * __builtin_huge_valq ();
+      return x * __builtin_huge_valf128 ();
     }
   ],[
+    foo (1.2F128);
+    bar (1.2F128);
     foo (1.2Q);
     bar (1.2Q);
   ],[
@@ -297,8 +301,16 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
     libgfor_cv_have_float128=no
 ])])
 
+    if test "x$have_iec_60559_libc_support$enable_libquadmath_support$libgfor_cv_have_float128" = xyesdefaultyes; then
+      USE_IEC_60559=yes
+    fi
+
+
   if test "x$libgfor_cv_have_float128" = xyes; then
-    AC_DEFINE(HAVE_FLOAT128, 1, [Define if have a usable __float128 type.])
+    if test "x$USE_IEC_60559" = xyes; then
+      AC_DEFINE(USE_IEC_60559, 1, [Define if IEC 60559 *f128 APIs should be used for _Float128.])
+    fi
+    AC_DEFINE(HAVE_FLOAT128, 1, [Define if have a usable _Float128 type.])
 
     dnl Check whether -Wl,--as-needed resp. -Wl,-zignore is supported
     dnl 
@@ -339,26 +351,30 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
     ])
 
     dnl For static libgfortran linkage, depend on libquadmath only if needed.
+    dnl If using *f128 APIs from libc/libm, depend on libquadmath only if needed
+    dnl even for dynamic libgfortran linkage, and don't link libgfortran against
+    dnl -lquadmath.
     if test "x$libgfor_cv_have_as_needed" = xyes; then
-      LIBQUADSPEC="%{static-libgfortran:$libgfor_cv_as_needed_option} -lquadmath %{static-libgfortran:$libgfor_cv_no_as_needed_option}"
+      if test "x$USE_IEC_60559" = xyes; then
+	LIBQUADSPEC="$libgfor_cv_as_needed_option -lquadmath $libgfor_cv_no_as_needed_option"
+      else
+	LIBQUADSPEC="%{static-libgfortran:$libgfor_cv_as_needed_option} -lquadmath %{static-libgfortran:$libgfor_cv_no_as_needed_option}"
+      fi
     else
       LIBQUADSPEC="-lquadmath"
     fi
-    if test -f ../libquadmath/libquadmath.la; then
-      LIBQUADLIB=../libquadmath/libquadmath.la
-      LIBQUADLIB_DEP=../libquadmath/libquadmath.la
-      LIBQUADINCLUDE='-I$(srcdir)/../libquadmath'
-    else
-      LIBQUADLIB="-lquadmath"
-      LIBQUADLIB_DEP=
-      LIBQUADINCLUDE=
+    if test "x$USE_IEC_60559" != xyes; then
+      if test -f ../libquadmath/libquadmath.la; then
+	LIBQUADLIB=../libquadmath/libquadmath.la
+	LIBQUADLIB_DEP=../libquadmath/libquadmath.la
+	LIBQUADINCLUDE='-I$(srcdir)/../libquadmath'
+      else
+	LIBQUADLIB="-lquadmath"
+      fi
     fi
-  fi
   else
-    # for --disable-quadmath
-    LIBQUADLIB=
-    LIBQUADLIB_DEP=
-    LIBQUADINCLUDE=
+    USE_IEC_60559=no
+  fi
   fi
 
   dnl For the spec file
@@ -366,9 +382,7 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
   AC_SUBST(LIBQUADLIB)
   AC_SUBST(LIBQUADLIB_DEP)
   AC_SUBST(LIBQUADINCLUDE)
-
-  dnl We need a conditional for the Makefile
-  AM_CONDITIONAL(LIBGFOR_BUILD_QUAD, [test "x$libgfor_cv_have_float128" = xyes])
+  AC_SUBST(USE_IEC_60559)
 ])
 
 
--- libgfortran/Makefile.am.jj	2022-06-27 11:17:35.588409052 +0200
+++ libgfortran/Makefile.am	2022-06-27 12:42:50.712185121 +0200
@@ -1167,7 +1167,9 @@ I_M4_DEPS8=$(I_M4_DEPS) m4/ifindloc1.m4
 I_M4_DEPS9=$(I_M4_DEPS) m4/ifindloc2.m4
 
 kinds.h: $(srcdir)/mk-kinds-h.sh
-	$(SHELL) $(srcdir)/mk-kinds-h.sh '@LIBGOMP_CHECKED_INT_KINDS@' '@LIBGOMP_CHECKED_REAL_KINDS@' '$(FCCOMPILE)' > $@ || rm $@
+	$(SHELL) $(srcdir)/mk-kinds-h.sh '@LIBGOMP_CHECKED_INT_KINDS@' \
+					 '@LIBGOMP_CHECKED_REAL_KINDS@' \
+					 '$(FCCOMPILE)' '@USE_IEC_60559@' > $@ || rm $@
 
 kinds.inc: kinds.h $(srcdir)/kinds-override.h
 	cat kinds.h $(srcdir)/kinds-override.h | grep '^#' | grep -v include > $@
--- libgfortran/mk-kinds-h.sh.jj	2022-06-27 11:17:36.210401001 +0200
+++ libgfortran/mk-kinds-h.sh	2022-06-27 14:05:07.557500392 +0200
@@ -2,8 +2,8 @@
 LC_ALL=C
 export LC_ALL
 
-if test "$#" -ne 3; then
-  echo "Usage $0 int_kinds real_kinds compile"
+if test "$#" -ne 4; then
+  echo "Usage $0 int_kinds real_kinds compile use_iec_60559"
   exit 1
 fi
 
@@ -11,6 +11,7 @@ fi
 possible_integer_kinds="$1"
 possible_real_kinds="$2"
 compile="$3"
+use_iec_60559="$4"
 
 largest=""
 smallest=""
@@ -49,7 +50,7 @@ echo ""
 
 
 # Get the kind value for long double, so we may disambiguate it
-# from __float128.
+# from _Float128.
 echo "use iso_c_binding; print *, c_long_double ; end" > tmq$$.f90
 long_double_kind=`$compile -S -fdump-parse-tree tmq$$.f90 | grep TRANSFER \
 			| sed 's/ *TRANSFER *//'`
@@ -68,10 +69,15 @@ for k in $possible_real_kinds; do
       10) ctype="long double" ; cplxtype="complex long double" ; suffix="l" ;;
       # If we have a REAL(KIND=16), it is either long double or __float128
       16) if [ $long_double_kind -ne 16 ]; then
-	    ctype="__float128"
-	    cplxtype="_Complex float __attribute__((mode(TC)))"
-	    suffix="q"
+	    ctype="_Float128"
+	    cplxtype="_Complex _Float128"
 	    echo "#define GFC_REAL_16_IS_FLOAT128"
+	    if [ x$use_iec_60559 = xyes ]; then
+	      suffix="f128"
+	      echo "#define GFC_REAL_16_USE_IEC_60559"
+	    else
+	      suffix="q"
+	    fi
 	  else
 	    ctype="long double"
 	    cplxtype="complex long double"
--- libgfortran/kinds-override.h.jj	2022-06-27 11:17:36.157401687 +0200
+++ libgfortran/kinds-override.h	2022-06-27 12:48:52.111544104 +0200
@@ -26,18 +26,26 @@ see the files COPYING3 and COPYING.RUNTI
 /* Ensure that TFmode is available under.  */
 
 #if defined(GFC_REAL_16_IS_FLOAT128) && !defined(HAVE_FLOAT128)
-# error "Where has __float128 gone?"
+# error "Where has _Float128 gone?"
 #endif
 
 /* Keep these conditions on one line so grep can filter it out.  */
 #if defined(__powerpc64__)  && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__  && __SIZEOF_LONG_DOUBLE__ == 16
-typedef __float128 GFC_REAL_17;
-typedef _Complex float __attribute__((mode(KC))) GFC_COMPLEX_17;
+typedef _Float128 GFC_REAL_17;
+typedef _Complex _Float128 GFC_COMPLEX_17;
 #define HAVE_GFC_REAL_17
 #define HAVE_GFC_COMPLEX_17
+#define GFC_REAL_17_IS_FLOAT128
+#ifdef USE_IEC_60559
+#define GFC_REAL_17_USE_IEC_60559
+#define GFC_REAL_17_HUGE 1.18973149535723176508575932662800702e4932f128
+#define GFC_REAL_17_LITERAL_SUFFIX f128
+#define GFC_REAL_17_LITERAL(X) (X ## f128)
+#else
 #define GFC_REAL_17_HUGE 1.18973149535723176508575932662800702e4932q
 #define GFC_REAL_17_LITERAL_SUFFIX q
 #define GFC_REAL_17_LITERAL(X) (X ## q)
+#endif
 #define GFC_REAL_17_DIGITS 113
 #define GFC_REAL_17_RADIX 2
 #endif
--- libgfortran/libgfortran.h.jj	2022-06-27 11:17:36.171401506 +0200
+++ libgfortran/libgfortran.h	2022-06-27 14:02:23.379586215 +0200
@@ -58,8 +58,8 @@ see the files COPYING3 and COPYING.RUNTI
 
 /* If we're support quad-precision floating-point type, include the
    header to our support library.  */
-#ifdef HAVE_FLOAT128
-#  include "quadmath_weak.h"
+#if defined(HAVE_FLOAT128) && !defined(USE_IEC_60559)
+# include "quadmath_weak.h"
 #endif
 
 #ifdef __MINGW32__
@@ -322,6 +322,8 @@ typedef GFC_UINTEGER_4 gfc_char4_t;
 # ifdef HAVE_GFC_REAL_16
 #  ifdef GFC_REAL_16_IS_LONG_DOUBLE
 #   define GFC_REAL_16_INFINITY __builtin_infl ()
+#  elif defined GFC_REAL_16_USE_IEC_60559
+#   define GFC_REAL_16_INFINITY __builtin_inff128 ()
 #  else
 #   define GFC_REAL_16_INFINITY __builtin_infq ()
 #  endif
@@ -343,6 +345,8 @@ typedef GFC_UINTEGER_4 gfc_char4_t;
 # ifdef HAVE_GFC_REAL_16
 #  ifdef GFC_REAL_16_IS_LONG_DOUBLE
 #   define GFC_REAL_16_QUIET_NAN __builtin_nanl ("")
+#  elif defined GFC_REAL_16_USE_IEC_60559
+#   define GFC_REAL_16_QUIET_NAN __builtin_nanf128 ("")
 #  else
 #   define GFC_REAL_16_QUIET_NAN nanq ("")
 #  endif
--- libgfortran/caf/single.c.jj	2022-06-27 11:17:35.649408262 +0200
+++ libgfortran/caf/single.c	2022-06-27 12:52:56.765403412 +0200
@@ -478,12 +478,11 @@ convert_type (void *dst, int dst_type, i
   typedef long double real128t;
   typedef _Complex long double complex128t;
 #elif defined(HAVE_GFC_REAL_16)
-  typedef _Complex float __attribute__((mode(TC))) __complex128;
-  typedef __float128 real128t;
-  typedef __complex128 complex128t;
+  typedef _Float128 real128t;
+  typedef _Complex _Float128 complex128t;
 #elif defined(HAVE_GFC_REAL_10)
   typedef long double real128t;
-  typedef long double complex128t;
+  typedef _Complex long double complex128t;
 #else
   typedef double real128t;
   typedef _Complex double complex128t;
--- libgfortran/ieee/issignaling_fallback.h.jj	2022-06-27 11:17:35.962404211 +0200
+++ libgfortran/ieee/issignaling_fallback.h	2022-06-27 12:55:25.311496487 +0200
@@ -197,11 +197,11 @@ __issignalingl (long double x)
 
 #if defined(GFC_REAL_16_IS_FLOAT128)
 
-/* We have a __float128 type.  */
+/* We have a _Float128 type.  */
 
 typedef union
 {
-  __float128 value;
+  _Float128 value;
   struct
   {
 #if __FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__
@@ -215,7 +215,7 @@ typedef union
 } ieee854_float128_shape_type;
 
 static inline int
-__issignalingf128 (__float128 x)
+__issignalingf128 (_Float128 x)
 {
   uint64_t hxi, lxi;
   ieee854_float128_shape_type u;
@@ -237,7 +237,7 @@ __issignalingf128 (__float128 x)
 #if defined(GFC_REAL_16_IS_FLOAT128)
 # define issignaling(X) \
   _Generic ((X), \
-	    __float128: __issignalingf128, \
+	    _Float128: __issignalingf128, \
 	    float: __issignalingf, \
 	    double: __issignaling, \
 	    long double: __issignalingl)(X)
--- libgfortran/intrinsics/cshift0.c.jj	2022-06-27 11:17:35.993403810 +0200
+++ libgfortran/intrinsics/cshift0.c	2022-06-27 13:04:17.967659149 +0200
@@ -132,7 +132,7 @@ cshift0 (gfc_array_char * ret, const gfc
 /* FIXME: This here is a hack, which will have to be removed when
    the array descriptor is reworked.  Currently, we don't store the
    kind value for the type, but only the size.  Because on targets with
-   __float128, we have sizeof(logn double) == sizeof(__float128),
+   _Float128, we have sizeof(long double) == sizeof(_Float128),
    we cannot discriminate here and have to fall back to the generic
    handling (which is suboptimal).  */
 #if !defined(GFC_REAL_16_IS_FLOAT128)
@@ -162,7 +162,7 @@ cshift0 (gfc_array_char * ret, const gfc
 /* FIXME: This here is a hack, which will have to be removed when
    the array descriptor is reworked.  Currently, we don't store the
    kind value for the type, but only the size.  Because on targets with
-   __float128, we have sizeof(logn double) == sizeof(__float128),
+   _Float128, we have sizeof(long double) == sizeof(_Float128),
    we cannot discriminate here and have to fall back to the generic
    handling (which is suboptimal).  */
 #if !defined(GFC_REAL_16_IS_FLOAT128)
--- libgfortran/intrinsics/erfc_scaled.c.jj	2022-06-27 11:17:35.993403810 +0200
+++ libgfortran/intrinsics/erfc_scaled.c	2022-06-27 13:06:40.234833205 +0200
@@ -52,11 +52,19 @@ see the files COPYING3 and COPYING.RUNTI
 
 #ifdef GFC_REAL_16_IS_FLOAT128
 
-# define _THRESH -106.566990228185312813205074546585730Q
-# define _M_2_SQRTPI M_2_SQRTPIq
-# define _INF __builtin_infq()
-# define _ERFC(x) erfcq(x)
-# define _EXP(x) expq(x)
+# ifdef GFC_REAL_16_USE_IEC_60559
+#  define _THRESH -106.566990228185312813205074546585730F128
+#  define _M_2_SQRTPI M_2_SQRTPIf128
+#  define _INF __builtin_inff128()
+#  define _ERFC(x) erfcf128(x)
+#  define _EXP(x) expf128(x)
+# else
+#  define _THRESH -106.566990228185312813205074546585730Q
+#  define _M_2_SQRTPI M_2_SQRTPIq
+#  define _INF __builtin_infq()
+#  define _ERFC(x) erfcq(x)
+#  define _EXP(x) expq(x)
+# endif
 
 #else
 
@@ -139,12 +147,15 @@ ERFC_SCALED(16)
 /* For quadruple-precision, netlib's implementation is
    not accurate enough.  We provide another one.  */
 
-# define _THRESH -106.566990228185312813205074546585730Q
-# define _M_2_SQRTPI M_2_SQRTPIq
+# define _THRESH GFC_REAL_17_LITERAL(-106.566990228185312813205074546585730)
+# define _M_2_SQRTPI GFC_REAL_17_LITERAL(M_2_SQRTPI)
 # define _INF __builtin_inff128()
 # ifdef POWER_IEEE128
 #  define _ERFC(x) __erfcieee128(x)
 #  define _EXP(x) __expieee128(x)
+# elif defined(GFC_REAL_17_USE_IEC_60559)
+#  define _ERFC(x) erfcf128(x)
+#  define _EXP(x) expf128(x)
 # else
 #  define _ERFC(x) erfcq(x)
 #  define _EXP(x) expq(x)
--- libgfortran/intrinsics/spread_generic.c.jj	2022-06-27 11:17:36.026403383 +0200
+++ libgfortran/intrinsics/spread_generic.c	2022-06-27 13:09:24.226728425 +0200
@@ -320,7 +320,7 @@ spread (gfc_array_char *ret, const gfc_a
 /* FIXME: This here is a hack, which will have to be removed when
    the array descriptor is reworked.  Currently, we don't store the
    kind value for the type, but only the size.  Because on targets with
-   __float128, we have sizeof(logn double) == sizeof(__float128),
+   _Float128, we have sizeof(long double) == sizeof(_Float128),
    we cannot discriminate here and have to fall back to the generic
    handling (which is suboptimal).  */
 #if !defined(GFC_REAL_16_IS_FLOAT128)
@@ -352,7 +352,7 @@ spread (gfc_array_char *ret, const gfc_a
 /* FIXME: This here is a hack, which will have to be removed when
    the array descriptor is reworked.  Currently, we don't store the
    kind value for the type, but only the size.  Because on targets with
-   __float128, we have sizeof(logn double) == sizeof(__float128),
+   _Float128, we have sizeof(long double) == sizeof(_Float128),
    we cannot discriminate here and have to fall back to the generic
    handling (which is suboptimal).  */
 #if !defined(GFC_REAL_16_IS_FLOAT128)
@@ -524,7 +524,7 @@ spread_scalar (gfc_array_char *ret, cons
 /* FIXME: This here is a hack, which will have to be removed when
    the array descriptor is reworked.  Currently, we don't store the
    kind value for the type, but only the size.  Because on targets with
-   __float128, we have sizeof(logn double) == sizeof(__float128),
+   _Float128, we have sizeof(long double) == sizeof(_Float128),
    we cannot discriminate here and have to fall back to the generic
    handling (which is suboptimal).  */
 #if !defined(GFC_REAL_16_IS_FLOAT128)
@@ -556,7 +556,7 @@ spread_scalar (gfc_array_char *ret, cons
 /* FIXME: This here is a hack, which will have to be removed when
    the array descriptor is reworked.  Currently, we don't store the
    kind value for the type, but only the size.  Because on targets with
-   __float128, we have sizeof(logn double) == sizeof(__float128),
+   _Float128, we have sizeof(long double) == sizeof(_Float128),
    we cannot discriminate here and have to fall back to the generic
    handling (which is suboptimal).  */
 #if !defined(GFC_REAL_16_IS_FLOAT128)
--- libgfortran/intrinsics/trigd.c.jj	2022-06-27 11:17:36.052403046 +0200
+++ libgfortran/intrinsics/trigd.c	2022-06-27 13:14:26.397850181 +0200
@@ -261,6 +261,24 @@ see the files COPYING3 and COPYING.RUNTI
 
 #endif /* HAVE_FABSL && HAVE_FMODL && HAVE_COPYSIGNL */
 
+#elif defined(GFC_REAL_16_USE_IEC_60559)
+
+#if defined(HAVE_FABSF128) && defined(HAVE_FMODF128) && defined(HAVE_COPYSIGNF128)
+
+#ifdef HAVE_SINF128
+#define ENABLE_SIND
+#endif
+
+#ifdef HAVE_COSF128
+#define ENABLE_COSD
+#endif
+
+#ifdef HAVE_TANF128
+#define ENABLE_TAND
+#endif
+
+#endif /* HAVE_FABSF128 && HAVE_FMODF128 && HAVE_COPYSIGNF128 */
+
 #else
 
 /* libquadmath: HAVE_*Q are never defined.  They must be available.  */
--- libgfortran/intrinsics/pack_generic.c.jj	2022-06-27 11:17:36.009403603 +0200
+++ libgfortran/intrinsics/pack_generic.c	2022-06-27 13:08:29.485431013 +0200
@@ -307,7 +307,7 @@ pack (gfc_array_char *ret, const gfc_arr
 /* FIXME: This here is a hack, which will have to be removed when
    the array descriptor is reworked.  Currently, we don't store the
    kind value for the type, but only the size.  Because on targets with
-   __float128, we have sizeof(logn double) == sizeof(__float128),
+   _Float128, we have sizeof(long double) == sizeof(_Float128),
    we cannot discriminate here and have to fall back to the generic
    handling (which is suboptimal).  */
 #if !defined(GFC_REAL_16_IS_FLOAT128)
@@ -339,7 +339,7 @@ pack (gfc_array_char *ret, const gfc_arr
 /* FIXME: This here is a hack, which will have to be removed when
    the array descriptor is reworked.  Currently, we don't store the
    kind value for the type, but only the size.  Because on targets with
-   __float128, we have sizeof(logn double) == sizeof(__float128),
+   _Float128, we have sizeof(long double) == sizeof(_Float128),
    we cannot discriminate here and have to fall back to the generic
    handling (which is suboptimal).  */
 #if !defined(GFC_REAL_16_IS_FLOAT128)
--- libgfortran/intrinsics/unpack_generic.c.jj	2022-06-27 11:17:36.079402697 +0200
+++ libgfortran/intrinsics/unpack_generic.c	2022-06-27 13:15:26.965072823 +0200
@@ -265,7 +265,7 @@ unpack1 (gfc_array_char *ret, const gfc_
 /* FIXME: This here is a hack, which will have to be removed when
    the array descriptor is reworked.  Currently, we don't store the
    kind value for the type, but only the size.  Because on targets with
-   __float128, we have sizeof(logn double) == sizeof(__float128),
+   _Float128, we have sizeof(long double) == sizeof(_Float128),
    we cannot discriminate here and have to fall back to the generic
    handling (which is suboptimal).  */
 #if !defined(GFC_REAL_16_IS_FLOAT128)
@@ -297,7 +297,7 @@ unpack1 (gfc_array_char *ret, const gfc_
 /* FIXME: This here is a hack, which will have to be removed when
    the array descriptor is reworked.  Currently, we don't store the
    kind value for the type, but only the size.  Because on targets with
-   __float128, we have sizeof(logn double) == sizeof(__float128),
+   _Float128, we have sizeof(long double) == sizeof(_Float128),
    we cannot discriminate here and have to fall back to the generic
    handling (which is suboptimal).  */
 #if !defined(GFC_REAL_16_IS_FLOAT128)
@@ -486,7 +486,7 @@ unpack0 (gfc_array_char *ret, const gfc_
 /* FIXME: This here is a hack, which will have to be removed when
    the array descriptor is reworked.  Currently, we don't store the
    kind value for the type, but only the size.  Because on targets with
-   __float128, we have sizeof(logn double) == sizeof(__float128),
+   _Float128, we have sizeof(long double) == sizeof(_Float128),
    we cannot discriminate here and have to fall back to the generic
    handling (which is suboptimal).  */
 #if !defined(GFC_REAL_16_IS_FLOAT128)
@@ -518,7 +518,7 @@ unpack0 (gfc_array_char *ret, const gfc_
 /* FIXME: This here is a hack, which will have to be removed when
    the array descriptor is reworked.  Currently, we don't store the
    kind value for the type, but only the size.  Because on targets with
-   __float128, we have sizeof(logn double) == sizeof(__float128),
+   _Float128, we have sizeof(long double) == sizeof(_Float128),
    we cannot discriminate here and have to fall back to the generic
    handling (which is suboptimal).  */
 #if !defined(GFC_REAL_16_IS_FLOAT128)
--- libgfortran/runtime/in_pack_generic.c.jj	2022-06-27 11:17:36.220400872 +0200
+++ libgfortran/runtime/in_pack_generic.c	2022-06-27 13:37:03.506000304 +0200
@@ -82,7 +82,7 @@ internal_pack (gfc_array_char * source)
 /* FIXME: This here is a hack, which will have to be removed when
    the array descriptor is reworked.  Currently, we don't store the
    kind value for the type, but only the size.  Because on targets with
-   __float128, we have sizeof(logn double) == sizeof(__float128),
+   _Float128, we have sizeof(long double) == sizeof(_Float128),
    we cannot discriminate here and have to fall back to the generic
    handling (which is suboptimal).  */
 #if !defined(GFC_REAL_16_IS_FLOAT128)
@@ -106,7 +106,7 @@ internal_pack (gfc_array_char * source)
 /* FIXME: This here is a hack, which will have to be removed when
    the array descriptor is reworked.  Currently, we don't store the
    kind value for the type, but only the size.  Because on targets with
-   __float128, we have sizeof(logn double) == sizeof(__float128),
+   _Float128, we have sizeof(long double) == sizeof(_Float128),
    we cannot discriminate here and have to fall back to the generic
    handling (which is suboptimal).  */
 #if !defined(GFC_REAL_16_IS_FLOAT128)
--- libgfortran/runtime/in_unpack_generic.c.jj	2022-06-27 11:17:36.221400859 +0200
+++ libgfortran/runtime/in_unpack_generic.c	2022-06-27 13:37:34.371604702 +0200
@@ -89,7 +89,7 @@ internal_unpack (gfc_array_char * d, con
 /* FIXME: This here is a hack, which will have to be removed when
    the array descriptor is reworked.  Currently, we don't store the
    kind value for the type, but only the size.  Because on targets with
-   __float128, we have sizeof(logn double) == sizeof(__float128),
+   _Float128, we have sizeof(long double) == sizeof(_Float128),
    we cannot discriminate here and have to fall back to the generic
    handling (which is suboptimal).  */
 #if !defined(GFC_REAL_16_IS_FLOAT128)
@@ -117,7 +117,7 @@ internal_unpack (gfc_array_char * d, con
 /* FIXME: This here is a hack, which will have to be removed when
    the array descriptor is reworked.  Currently, we don't store the
    kind value for the type, but only the size.  Because on targets with
-   __float128, we have sizeof(logn double) == sizeof(__float128),
+   _Float128, we have sizeof(long double) == sizeof(_Float128),
    we cannot discriminate here and have to fall back to the generic
    handling (which is suboptimal).  */
 #if !defined(GFC_REAL_16_IS_FLOAT128)
--- libgfortran/io/read.c.jj	2022-06-27 11:17:36.103402386 +0200
+++ libgfortran/io/read.c	2022-06-27 13:19:48.817616814 +0200
@@ -186,7 +186,11 @@ convert_real (st_parameter_dt *dtp, void
 #if defined(HAVE_GFC_REAL_16)
 # if defined(GFC_REAL_16_IS_FLOAT128)
     case 16:
+#  if defined(GFC_REAL_16_USE_IEC_60559)
+      *((GFC_REAL_16*) dest) = strtof128 (buffer, &endptr);
+#  else
       *((GFC_REAL_16*) dest) = __qmath_(strtoflt128) (buffer, &endptr);
+#  endif
       break;
 # elif defined(HAVE_STRTOLD)
     case 16:
@@ -199,6 +203,8 @@ convert_real (st_parameter_dt *dtp, void
     case 17:
 # if defined(POWER_IEEE128)
       *((GFC_REAL_17*) dest) = __strtoieee128 (buffer, &endptr);
+# elif defined(GFC_REAL_17_USE_IEC_60559)
+      *((GFC_REAL_17*) dest) = strtof128 (buffer, &endptr);
 # else
       *((GFC_REAL_17*) dest) = __qmath_(strtoflt128) (buffer, &endptr);
 # endif
@@ -272,7 +278,14 @@ convert_infnan (st_parameter_dt *dtp, vo
 #if defined(HAVE_GFC_REAL_16)
 # if defined(GFC_REAL_16_IS_FLOAT128)
     case 16:
+#  if defined(GFC_REAL_16_USE_IEC_60559)
+      if (is_inf)
+	*((GFC_REAL_16*) dest) = plus ? __builtin_inff128 () : -__builtin_inff128 ();
+      else
+	*((GFC_REAL_16*) dest) = plus ? __builtin_nanf128 ("") : -__builtin_nanf128 ("");
+#  else
       *((GFC_REAL_16*) dest) = __qmath_(strtoflt128) (buffer, NULL);
+#  endif
       break;
 # else
     case 16:
--- libgfortran/io/transfer128.c.jj	2022-06-27 11:17:36.117402205 +0200
+++ libgfortran/io/transfer128.c	2022-06-27 13:26:37.332063120 +0200
@@ -65,7 +65,9 @@ export_proto(transfer_complex128_write);
    write_float; the pointer assignment with USED attribute make sure
    that there is a non-weakref dependence if the quadmath functions
    are used. That avoids segfault when libquadmath is statically linked.  */
-# if !defined(HAVE_GFC_REAL_17) || !defined(POWER_IEEE128)
+# if (defined(HAVE_GFC_REAL_17) && !defined(POWER_IEEE128) \
+      && !defined(GFC_REAL_17_USE_IEC_60559)) \
+     || (!defined(HAVE_GFC_REAL_17) && !defined(GFC_REAL_16_USE_IEC_60559))
 static void __attribute__((used)) *tmp1 = strtoflt128;
 static void __attribute__((used)) *tmp2 = quadmath_snprintf;
 # endif
--- libgfortran/io/write_float.def.jj	2022-06-27 11:17:36.147401817 +0200
+++ libgfortran/io/write_float.def	2022-06-27 13:31:17.516452277 +0200
@@ -837,18 +837,60 @@ snprintf (buffer, size, "%+-#.*e", (prec
 #define DTOA2L(prec,val) \
 snprintf (buffer, size, "%+-#.*Le", (prec), (val))
 
+#if defined(GFC_REAL_16_USE_IEC_60559) || defined(GFC_REAL_17_USE_IEC_60559)
+/* strfromf128 unfortunately doesn't allow +, - and # modifiers
+   nor .* (only allows .number).  For +, work around it by adding
+   leading + manually for !signbit values.  For - I don't see why
+   we need it, when we don't specify field minimum width.
+   For #, add . if it is missing.  Assume size is at least 2.  */
+static int
+gfor_strfromf128 (char *buffer, size_t size, int kind, int prec, _Float128 val)
+{
+  int ret, n = 0;
+  char fmt[sizeof (int) * 3 + 5];
+  snprintf (fmt, sizeof fmt, "%%.%d%c", prec, kind);
+  if (!__builtin_signbit (val))
+    {
+      n = 1;
+      buffer[0] = '+';
+    }
+  ret = strfromf128 (buffer + n, size - n, fmt, val) + n;
+  if ((size_t) ret < size - 1)
+    {
+      size_t s = strcspn (buffer, ".e");
+      if (buffer[s] != '.')
+	{
+	  if (buffer[s] == '\0')
+	    buffer[s + 1] = '\0';
+	  else
+	    memmove (buffer + s + 1, buffer + s, ret + 1 - s);
+	  buffer[s] = '.';
+	  ++ret;
+	}
+    }
+  return ret;
+}
+#endif
 
 #if defined(HAVE_GFC_REAL_17)
 # if defined(POWER_IEEE128)
 #  define DTOA2Q(prec,val) \
 __snprintfieee128 (buffer, size, "%+-#.*Le", (prec), (val))
+# elif defined(GFC_REAL_17_USE_IEC_60559)
+#  define DTOA2Q(prec,val) \
+gfor_strfromf128 (buffer, size, 'e', (prec), (val))
 # else
 #  define DTOA2Q(prec,val) \
 quadmath_snprintf (buffer, size, "%+-#.*Qe", (prec), (val))
 # endif
 #elif defined(GFC_REAL_16_IS_FLOAT128)
-# define DTOA2Q(prec,val) \
+# if defined(GFC_REAL_16_USE_IEC_60559)
+#  define DTOA2Q(prec,val) \
+gfor_strfromf128 (buffer, size, 'e', (prec), (val))
+# else
+#  define DTOA2Q(prec,val) \
 quadmath_snprintf (buffer, size, "%+-#.*Qe", (prec), (val))
+# endif
 #endif
 
 #define FDTOA(suff,prec,val) TOKENPASTE(FDTOA2,suff)(prec,val)
@@ -865,13 +907,21 @@ snprintf (buffer, size, "%+-#.*Lf", (pre
 # if defined(POWER_IEEE128)
 #  define FDTOA2Q(prec,val) \
 __snprintfieee128 (buffer, size, "%+-#.*Lf", (prec), (val))
+# elif defined(GFC_REAL_17_USE_IEC_60559)
+#  define FDTOA2Q(prec,val) \
+gfor_strfromf128 (buffer, size, 'f', (prec), (val))
 # else
 # define FDTOA2Q(prec,val) \
 quadmath_snprintf (buffer, size, "%+-#.*Qf", (prec), (val))
 # endif
 #elif defined(GFC_REAL_16_IS_FLOAT128)
-# define FDTOA2Q(prec,val) \
+# if defined(GFC_REAL_16_USE_IEC_60559)
+#  define FDTOA2Q(prec,val) \
+gfor_strfromf128 (buffer, size, 'f', (prec), (val))
+# else
+#  define FDTOA2Q(prec,val) \
 quadmath_snprintf (buffer, size, "%+-#.*Qf", (prec), (val))
+# endif
 #endif
 
 
--- libgfortran/m4/mtype.m4.jj	2022-06-27 11:17:36.200401131 +0200
+++ libgfortran/m4/mtype.m4	2022-06-27 13:32:33.697470491 +0200
@@ -15,12 +15,18 @@ ifelse(kind,17,`1 /* FIXME: figure this
 define(mathfunc_macro,`ifelse(kind,17,dnl
 `#if defined(POWER_IEEE128)
 #define MATHFUNC(funcname) __ ## funcname ## ieee128
+#elif defined(GFC_REAL_17_USE_IEC_60559)
+#define MATHFUNC(funcname) funcname ## f128
 #else
 #define MATHFUNC(funcname) funcname ## q
 #endif',dnl
 `ifelse(kind,16,dnl
 `#if defined(GFC_REAL_16_IS_FLOAT128)
+#if defined(GFC_REAL_16_USE_IEC_60559)
+#define MATHFUNC(funcname) funcname ## f128
+#else
 #define MATHFUNC(funcname) funcname ## q
+#endif
 #else
 #define MATHFUNC(funcname) funcname ## l
 #endif',dnl
--- libgfortran/config.h.in.jj	2022-06-27 11:17:35.688407758 +0200
+++ libgfortran/config.h.in	2022-06-27 12:43:15.503866196 +0200
@@ -12,12 +12,18 @@
 /* Define to 1 if you have the `acosf' function. */
 #undef HAVE_ACOSF
 
+/* Define to 1 if you have the `acosf128' function. */
+#undef HAVE_ACOSF128
+
 /* Define to 1 if you have the `acosh' function. */
 #undef HAVE_ACOSH
 
 /* Define to 1 if you have the `acoshf' function. */
 #undef HAVE_ACOSHF
 
+/* Define to 1 if you have the `acoshf128' function. */
+#undef HAVE_ACOSHF128
+
 /* Define to 1 if you have the `acoshl' function. */
 #undef HAVE_ACOSHL
 
@@ -33,12 +39,18 @@
 /* Define to 1 if you have the `asinf' function. */
 #undef HAVE_ASINF
 
+/* Define to 1 if you have the `asinf128' function. */
+#undef HAVE_ASINF128
+
 /* Define to 1 if you have the `asinh' function. */
 #undef HAVE_ASINH
 
 /* Define to 1 if you have the `asinhf' function. */
 #undef HAVE_ASINHF
 
+/* Define to 1 if you have the `asinhf128' function. */
+#undef HAVE_ASINHF128
+
 /* Define to 1 if you have the `asinhl' function. */
 #undef HAVE_ASINHL
 
@@ -54,18 +66,27 @@
 /* Define to 1 if you have the `atan2f' function. */
 #undef HAVE_ATAN2F
 
+/* Define to 1 if you have the `atan2f128' function. */
+#undef HAVE_ATAN2F128
+
 /* Define to 1 if you have the `atan2l' function. */
 #undef HAVE_ATAN2L
 
 /* Define to 1 if you have the `atanf' function. */
 #undef HAVE_ATANF
 
+/* Define to 1 if you have the `atanf128' function. */
+#undef HAVE_ATANF128
+
 /* Define to 1 if you have the `atanh' function. */
 #undef HAVE_ATANH
 
 /* Define to 1 if you have the `atanhf' function. */
 #undef HAVE_ATANHF
 
+/* Define to 1 if you have the `atanhf128' function. */
+#undef HAVE_ATANHF128
+
 /* Define to 1 if you have the `atanhl' function. */
 #undef HAVE_ATANHL
 
@@ -99,6 +120,9 @@
 /* Define to 1 if you have the `cabsf' function. */
 #undef HAVE_CABSF
 
+/* Define to 1 if you have the `cabsf128' function. */
+#undef HAVE_CABSF128
+
 /* Define to 1 if you have the `cabsl' function. */
 #undef HAVE_CABSL
 
@@ -108,12 +132,18 @@
 /* Define to 1 if you have the `cacosf' function. */
 #undef HAVE_CACOSF
 
+/* Define to 1 if you have the `cacosf128' function. */
+#undef HAVE_CACOSF128
+
 /* Define to 1 if you have the `cacosh' function. */
 #undef HAVE_CACOSH
 
 /* Define to 1 if you have the `cacoshf' function. */
 #undef HAVE_CACOSHF
 
+/* Define to 1 if you have the `cacoshf128' function. */
+#undef HAVE_CACOSHF128
+
 /* Define to 1 if you have the `cacoshl' function. */
 #undef HAVE_CACOSHL
 
@@ -126,6 +156,9 @@
 /* Define to 1 if you have the `cargf' function. */
 #undef HAVE_CARGF
 
+/* Define to 1 if you have the `cargf128' function. */
+#undef HAVE_CARGF128
+
 /* Define to 1 if you have the `cargl' function. */
 #undef HAVE_CARGL
 
@@ -135,12 +168,18 @@
 /* Define to 1 if you have the `casinf' function. */
 #undef HAVE_CASINF
 
+/* Define to 1 if you have the `casinf128' function. */
+#undef HAVE_CASINF128
+
 /* Define to 1 if you have the `casinh' function. */
 #undef HAVE_CASINH
 
 /* Define to 1 if you have the `casinhf' function. */
 #undef HAVE_CASINHF
 
+/* Define to 1 if you have the `casinhf128' function. */
+#undef HAVE_CASINHF128
+
 /* Define to 1 if you have the `casinhl' function. */
 #undef HAVE_CASINHL
 
@@ -153,12 +192,18 @@
 /* Define to 1 if you have the `catanf' function. */
 #undef HAVE_CATANF
 
+/* Define to 1 if you have the `catanf128' function. */
+#undef HAVE_CATANF128
+
 /* Define to 1 if you have the `catanh' function. */
 #undef HAVE_CATANH
 
 /* Define to 1 if you have the `catanhf' function. */
 #undef HAVE_CATANHF
 
+/* Define to 1 if you have the `catanhf128' function. */
+#undef HAVE_CATANHF128
+
 /* Define to 1 if you have the `catanhl' function. */
 #undef HAVE_CATANHL
 
@@ -171,12 +216,18 @@
 /* Define to 1 if you have the `ccosf' function. */
 #undef HAVE_CCOSF
 
+/* Define to 1 if you have the `ccosf128' function. */
+#undef HAVE_CCOSF128
+
 /* Define to 1 if you have the `ccosh' function. */
 #undef HAVE_CCOSH
 
 /* Define to 1 if you have the `ccoshf' function. */
 #undef HAVE_CCOSHF
 
+/* Define to 1 if you have the `ccoshf128' function. */
+#undef HAVE_CCOSHF128
+
 /* Define to 1 if you have the `ccoshl' function. */
 #undef HAVE_CCOSHL
 
@@ -189,6 +240,9 @@
 /* Define to 1 if you have the `ceilf' function. */
 #undef HAVE_CEILF
 
+/* Define to 1 if you have the `ceilf128' function. */
+#undef HAVE_CEILF128
+
 /* Define to 1 if you have the `ceill' function. */
 #undef HAVE_CEILL
 
@@ -198,6 +252,9 @@
 /* Define to 1 if you have the `cexpf' function. */
 #undef HAVE_CEXPF
 
+/* Define to 1 if you have the `cexpf128' function. */
+#undef HAVE_CEXPF128
+
 /* Define to 1 if you have the `cexpl' function. */
 #undef HAVE_CEXPL
 
@@ -222,12 +279,18 @@
 /* Define to 1 if you have the `clog10f' function. */
 #undef HAVE_CLOG10F
 
+/* Define to 1 if you have the `clog10f128' function. */
+#undef HAVE_CLOG10F128
+
 /* Define to 1 if you have the `clog10l' function. */
 #undef HAVE_CLOG10L
 
 /* Define to 1 if you have the `clogf' function. */
 #undef HAVE_CLOGF
 
+/* Define to 1 if you have the `clogf128' function. */
+#undef HAVE_CLOGF128
+
 /* Define to 1 if you have the `clogl' function. */
 #undef HAVE_CLOGL
 
@@ -240,6 +303,9 @@
 /* Define to 1 if you have the `copysignf' function. */
 #undef HAVE_COPYSIGNF
 
+/* Define to 1 if you have the `copysignf128' function. */
+#undef HAVE_COPYSIGNF128
+
 /* Define to 1 if you have the `copysignl' function. */
 #undef HAVE_COPYSIGNL
 
@@ -249,12 +315,18 @@
 /* Define to 1 if you have the `cosf' function. */
 #undef HAVE_COSF
 
+/* Define to 1 if you have the `cosf128' function. */
+#undef HAVE_COSF128
+
 /* Define to 1 if you have the `cosh' function. */
 #undef HAVE_COSH
 
 /* Define to 1 if you have the `coshf' function. */
 #undef HAVE_COSHF
 
+/* Define to 1 if you have the `coshf128' function. */
+#undef HAVE_COSHF128
+
 /* Define to 1 if you have the `coshl' function. */
 #undef HAVE_COSHL
 
@@ -267,6 +339,9 @@
 /* Define to 1 if you have the `cpowf' function. */
 #undef HAVE_CPOWF
 
+/* Define to 1 if you have the `cpowf128' function. */
+#undef HAVE_CPOWF128
+
 /* Define to 1 if you have the `cpowl' function. */
 #undef HAVE_CPOWL
 
@@ -279,12 +354,18 @@
 /* Define to 1 if you have the `csinf' function. */
 #undef HAVE_CSINF
 
+/* Define to 1 if you have the `csinf128' function. */
+#undef HAVE_CSINF128
+
 /* Define to 1 if you have the `csinh' function. */
 #undef HAVE_CSINH
 
 /* Define to 1 if you have the `csinhf' function. */
 #undef HAVE_CSINHF
 
+/* Define to 1 if you have the `csinhf128' function. */
+#undef HAVE_CSINHF128
+
 /* Define to 1 if you have the `csinhl' function. */
 #undef HAVE_CSINHL
 
@@ -297,6 +378,9 @@
 /* Define to 1 if you have the `csqrtf' function. */
 #undef HAVE_CSQRTF
 
+/* Define to 1 if you have the `csqrtf128' function. */
+#undef HAVE_CSQRTF128
+
 /* Define to 1 if you have the `csqrtl' function. */
 #undef HAVE_CSQRTL
 
@@ -306,12 +390,18 @@
 /* Define to 1 if you have the `ctanf' function. */
 #undef HAVE_CTANF
 
+/* Define to 1 if you have the `ctanf128' function. */
+#undef HAVE_CTANF128
+
 /* Define to 1 if you have the `ctanh' function. */
 #undef HAVE_CTANH
 
 /* Define to 1 if you have the `ctanhf' function. */
 #undef HAVE_CTANHF
 
+/* Define to 1 if you have the `ctanhf128' function. */
+#undef HAVE_CTANHF128
+
 /* Define to 1 if you have the `ctanhl' function. */
 #undef HAVE_CTANHL
 
@@ -333,18 +423,27 @@
 /* Define to 1 if you have the `erfcf' function. */
 #undef HAVE_ERFCF
 
+/* Define to 1 if you have the `erfcf128' function. */
+#undef HAVE_ERFCF128
+
 /* Define to 1 if you have the `erfcl' function. */
 #undef HAVE_ERFCL
 
 /* Define to 1 if you have the `erff' function. */
 #undef HAVE_ERFF
 
+/* Define to 1 if you have the `erff128' function. */
+#undef HAVE_ERFF128
+
 /* Define to 1 if you have the `exp' function. */
 #undef HAVE_EXP
 
 /* Define to 1 if you have the `expf' function. */
 #undef HAVE_EXPF
 
+/* Define to 1 if you have the `expf128' function. */
+#undef HAVE_EXPF128
+
 /* Define to 1 if you have the `expl' function. */
 #undef HAVE_EXPL
 
@@ -354,6 +453,9 @@
 /* Define to 1 if you have the `fabsf' function. */
 #undef HAVE_FABSF
 
+/* Define to 1 if you have the `fabsf128' function. */
+#undef HAVE_FABSF128
+
 /* Define to 1 if you have the `fabsl' function. */
 #undef HAVE_FABSL
 
@@ -366,7 +468,7 @@
 /* Define to 1 if you have the <fenv.h> header file. */
 #undef HAVE_FENV_H
 
-/* Define if have a usable __float128 type. */
+/* Define if have a usable _Float128 type. */
 #undef HAVE_FLOAT128
 
 /* Define to 1 if you have the <floatingpoint.h> header file. */
@@ -378,6 +480,9 @@
 /* Define to 1 if you have the `floorf' function. */
 #undef HAVE_FLOORF
 
+/* Define to 1 if you have the `floorf128' function. */
+#undef HAVE_FLOORF128
+
 /* Define to 1 if you have the `floorl' function. */
 #undef HAVE_FLOORL
 
@@ -393,6 +498,9 @@
 /* Define to 1 if you have the `fmaf' function. */
 #undef HAVE_FMAF
 
+/* Define to 1 if you have the `fmaf128' function. */
+#undef HAVE_FMAF128
+
 /* Define to 1 if you have the `fmal' function. */
 #undef HAVE_FMAL
 
@@ -402,6 +510,9 @@
 /* Define to 1 if you have the `fmodf' function. */
 #undef HAVE_FMODF
 
+/* Define to 1 if you have the `fmodf128' function. */
+#undef HAVE_FMODF128
+
 /* Define to 1 if you have the `fmodl' function. */
 #undef HAVE_FMODL
 
@@ -450,6 +561,9 @@
 /* Define to 1 if you have the `frexpf' function. */
 #undef HAVE_FREXPF
 
+/* Define to 1 if you have the `frexpf128' function. */
+#undef HAVE_FREXPF128
+
 /* Define to 1 if you have the `frexpl' function. */
 #undef HAVE_FREXPL
 
@@ -507,6 +621,9 @@
 /* Define to 1 if you have the `hypotf' function. */
 #undef HAVE_HYPOTF
 
+/* Define to 1 if you have the `hypotf128' function. */
+#undef HAVE_HYPOTF128
+
 /* Define to 1 if you have the `hypotl' function. */
 #undef HAVE_HYPOTL
 
@@ -537,18 +654,27 @@
 /* Define to 1 if you have the `j0f' function. */
 #undef HAVE_J0F
 
+/* Define to 1 if you have the `j0f128' function. */
+#undef HAVE_J0F128
+
 /* Define to 1 if you have the `j1' function. */
 #undef HAVE_J1
 
 /* Define to 1 if you have the `j1f' function. */
 #undef HAVE_J1F
 
+/* Define to 1 if you have the `j1f128' function. */
+#undef HAVE_J1F128
+
 /* Define to 1 if you have the `jn' function. */
 #undef HAVE_JN
 
 /* Define to 1 if you have the `jnf' function. */
 #undef HAVE_JNF
 
+/* Define to 1 if you have the `jnf128' function. */
+#undef HAVE_JNF128
+
 /* Define to 1 if you have the `jnl' function. */
 #undef HAVE_JNL
 
@@ -561,6 +687,9 @@
 /* Define to 1 if you have the `ldexpf' function. */
 #undef HAVE_LDEXPF
 
+/* Define to 1 if you have the `ldexpf128' function. */
+#undef HAVE_LDEXPF128
+
 /* Define to 1 if you have the `ldexpl' function. */
 #undef HAVE_LDEXPL
 
@@ -570,6 +699,9 @@
 /* Define to 1 if you have the `lgammaf' function. */
 #undef HAVE_LGAMMAF
 
+/* Define to 1 if you have the `lgammaf128' function. */
+#undef HAVE_LGAMMAF128
+
 /* Define to 1 if you have the `m' library (-lm). */
 #undef HAVE_LIBM
 
@@ -582,6 +714,9 @@
 /* Define to 1 if you have the `llroundf' function. */
 #undef HAVE_LLROUNDF
 
+/* Define to 1 if you have the `llroundf128' function. */
+#undef HAVE_LLROUNDF128
+
 /* Define to 1 if you have the `llroundl' function. */
 #undef HAVE_LLROUNDL
 
@@ -597,12 +732,18 @@
 /* Define to 1 if you have the `log10f' function. */
 #undef HAVE_LOG10F
 
+/* Define to 1 if you have the `log10f128' function. */
+#undef HAVE_LOG10F128
+
 /* Define to 1 if you have the `log10l' function. */
 #undef HAVE_LOG10L
 
 /* Define to 1 if you have the `logf' function. */
 #undef HAVE_LOGF
 
+/* Define to 1 if you have the `logf128' function. */
+#undef HAVE_LOGF128
+
 /* Define to 1 if you have the `logl' function. */
 #undef HAVE_LOGL
 
@@ -612,6 +753,9 @@
 /* Define to 1 if you have the `lroundf' function. */
 #undef HAVE_LROUNDF
 
+/* Define to 1 if you have the `lroundf128' function. */
+#undef HAVE_LROUNDF128
+
 /* Define to 1 if you have the `lroundl' function. */
 #undef HAVE_LROUNDL
 
@@ -642,6 +786,9 @@
 /* Define to 1 if you have the `nextafterf' function. */
 #undef HAVE_NEXTAFTERF
 
+/* Define to 1 if you have the `nextafterf128' function. */
+#undef HAVE_NEXTAFTERF128
+
 /* Define to 1 if you have the `nextafterl' function. */
 #undef HAVE_NEXTAFTERL
 
@@ -657,6 +804,9 @@
 /* Define to 1 if you have the `powf' function. */
 #undef HAVE_POWF
 
+/* Define to 1 if you have the `powf128' function. */
+#undef HAVE_POWF128
+
 /* Define to 1 if the system has the type `ptrdiff_t'. */
 #undef HAVE_PTRDIFF_T
 
@@ -672,6 +822,9 @@
 /* Define to 1 if you have the `roundf' function. */
 #undef HAVE_ROUNDF
 
+/* Define to 1 if you have the `roundf128' function. */
+#undef HAVE_ROUNDF128
+
 /* Define to 1 if you have the `roundl' function. */
 #undef HAVE_ROUNDL
 
@@ -681,6 +834,9 @@
 /* Define to 1 if you have the `scalbnf' function. */
 #undef HAVE_SCALBNF
 
+/* Define to 1 if you have the `scalbnf128' function. */
+#undef HAVE_SCALBNF128
+
 /* Define to 1 if you have the `scalbnl' function. */
 #undef HAVE_SCALBNL
 
@@ -699,12 +855,18 @@
 /* Define to 1 if you have the `sinf' function. */
 #undef HAVE_SINF
 
+/* Define to 1 if you have the `sinf128' function. */
+#undef HAVE_SINF128
+
 /* Define to 1 if you have the `sinh' function. */
 #undef HAVE_SINH
 
 /* Define to 1 if you have the `sinhf' function. */
 #undef HAVE_SINHF
 
+/* Define to 1 if you have the `sinhf128' function. */
+#undef HAVE_SINHF128
+
 /* Define to 1 if you have the `sinhl' function. */
 #undef HAVE_SINHL
 
@@ -723,6 +885,9 @@
 /* Define to 1 if you have the `sqrtf' function. */
 #undef HAVE_SQRTF
 
+/* Define to 1 if you have the `sqrtf128' function. */
+#undef HAVE_SQRTF128
+
 /* Define to 1 if you have the `sqrtl' function. */
 #undef HAVE_SQRTL
 
@@ -744,6 +909,9 @@
 /* Define if strerror_r takes two arguments and is available in <string.h>. */
 #undef HAVE_STRERROR_R_2ARGS
 
+/* Define to 1 if you have the `strfromf128' function. */
+#undef HAVE_STRFROMF128
+
 /* Define to 1 if you have the <strings.h> header file. */
 #undef HAVE_STRINGS_H
 
@@ -759,6 +927,9 @@
 /* Define to 1 if you have the `strtof' function. */
 #undef HAVE_STRTOF
 
+/* Define to 1 if you have the `strtof128' function. */
+#undef HAVE_STRTOF128
+
 /* Define to 1 if you have the `strtold' function. */
 #undef HAVE_STRTOLD
 
@@ -804,12 +975,18 @@
 /* Define to 1 if you have the `tanf' function. */
 #undef HAVE_TANF
 
+/* Define to 1 if you have the `tanf128' function. */
+#undef HAVE_TANF128
+
 /* Define to 1 if you have the `tanh' function. */
 #undef HAVE_TANH
 
 /* Define to 1 if you have the `tanhf' function. */
 #undef HAVE_TANHF
 
+/* Define to 1 if you have the `tanhf128' function. */
+#undef HAVE_TANHF128
+
 /* Define to 1 if you have the `tanhl' function. */
 #undef HAVE_TANHL
 
@@ -822,6 +999,9 @@
 /* Define to 1 if you have the `tgammaf' function. */
 #undef HAVE_TGAMMAF
 
+/* Define to 1 if you have the `tgammaf128' function. */
+#undef HAVE_TGAMMAF128
+
 /* Define to 1 if you have the `times' function. */
 #undef HAVE_TIMES
 
@@ -831,6 +1011,9 @@
 /* Define to 1 if you have the `truncf' function. */
 #undef HAVE_TRUNCF
 
+/* Define to 1 if you have the `truncf128' function. */
+#undef HAVE_TRUNCF128
+
 /* Define to 1 if you have the `truncl' function. */
 #undef HAVE_TRUNCL
 
@@ -876,18 +1059,27 @@
 /* Define to 1 if you have the `y0f' function. */
 #undef HAVE_Y0F
 
+/* Define to 1 if you have the `y0f128' function. */
+#undef HAVE_Y0F128
+
 /* Define to 1 if you have the `y1' function. */
 #undef HAVE_Y1
 
 /* Define to 1 if you have the `y1f' function. */
 #undef HAVE_Y1F
 
+/* Define to 1 if you have the `y1f128' function. */
+#undef HAVE_Y1F128
+
 /* Define to 1 if you have the `yn' function. */
 #undef HAVE_YN
 
 /* Define to 1 if you have the `ynf' function. */
 #undef HAVE_YNF
 
+/* Define to 1 if you have the `ynf128' function. */
+#undef HAVE_YNF128
+
 /* Define to 1 if you have the `ynl' function. */
 #undef HAVE_YNL
 
@@ -1006,6 +1198,9 @@
 /* Define to 1 if the target supports weakref */
 #undef SUPPORTS_WEAKREF
 
+/* Define if IEC 60559 *f128 APIs should be used for _Float128. */
+#undef USE_IEC_60559
+
 /* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
--- libgfortran/configure.jj	2022-06-27 11:17:35.767406735 +0200
+++ libgfortran/configure	2022-06-27 13:49:58.994060957 +0200
@@ -645,8 +645,7 @@ IEEE_SUPPORT
 IEEE_SUPPORT_FALSE
 IEEE_SUPPORT_TRUE
 FPU_HOST_HEADER
-LIBGFOR_BUILD_QUAD_FALSE
-LIBGFOR_BUILD_QUAD_TRUE
+USE_IEC_60559
 LIBQUADINCLUDE
 LIBQUADLIB_DEP
 LIBQUADLIB
@@ -2673,6 +2672,8 @@ as_fn_append ac_func_list " newlocale"
 as_fn_append ac_func_list " freelocale"
 as_fn_append ac_func_list " uselocale"
 as_fn_append ac_func_list " strerror_l"
+as_fn_append ac_func_list " strtof128"
+as_fn_append ac_func_list " strfromf128"
 as_fn_append ac_header_list " math.h"
 # Check that the precious variables saved in the cache have kept the same
 # value.
@@ -12766,7 +12767,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12769 "configure"
+#line 12770 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12872,7 +12873,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12875 "configure"
+#line 12876 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -17184,6 +17185,10 @@ done
 
 
 
+
+
+
+
 fi
 
 # Check strerror_r, cannot be above as versions with two and three arguments exist
@@ -26997,6 +27002,2984 @@ _ACEOF
   fi
 fi
 
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acosf128" >&5
+$as_echo_n "checking for acosf128... " >&6; }
+if ${gcc_cv_math_func_acosf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())acosf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_acosf128=yes
+else
+  gcc_cv_math_func_acosf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_acosf128" >&5
+$as_echo "$gcc_cv_math_func_acosf128" >&6; }
+  if test $gcc_cv_math_func_acosf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ACOSF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acoshf128" >&5
+$as_echo_n "checking for acoshf128... " >&6; }
+if ${gcc_cv_math_func_acoshf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())acoshf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_acoshf128=yes
+else
+  gcc_cv_math_func_acoshf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_acoshf128" >&5
+$as_echo "$gcc_cv_math_func_acoshf128" >&6; }
+  if test $gcc_cv_math_func_acoshf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ACOSHF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinf128" >&5
+$as_echo_n "checking for asinf128... " >&6; }
+if ${gcc_cv_math_func_asinf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())asinf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_asinf128=yes
+else
+  gcc_cv_math_func_asinf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_asinf128" >&5
+$as_echo "$gcc_cv_math_func_asinf128" >&6; }
+  if test $gcc_cv_math_func_asinf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ASINF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinhf128" >&5
+$as_echo_n "checking for asinhf128... " >&6; }
+if ${gcc_cv_math_func_asinhf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())asinhf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_asinhf128=yes
+else
+  gcc_cv_math_func_asinhf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_asinhf128" >&5
+$as_echo "$gcc_cv_math_func_asinhf128" >&6; }
+  if test $gcc_cv_math_func_asinhf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ASINHF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan2f128" >&5
+$as_echo_n "checking for atan2f128... " >&6; }
+if ${gcc_cv_math_func_atan2f128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())atan2f128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_atan2f128=yes
+else
+  gcc_cv_math_func_atan2f128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_atan2f128" >&5
+$as_echo "$gcc_cv_math_func_atan2f128" >&6; }
+  if test $gcc_cv_math_func_atan2f128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ATAN2F128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanf128" >&5
+$as_echo_n "checking for atanf128... " >&6; }
+if ${gcc_cv_math_func_atanf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())atanf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_atanf128=yes
+else
+  gcc_cv_math_func_atanf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_atanf128" >&5
+$as_echo "$gcc_cv_math_func_atanf128" >&6; }
+  if test $gcc_cv_math_func_atanf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ATANF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanhf128" >&5
+$as_echo_n "checking for atanhf128... " >&6; }
+if ${gcc_cv_math_func_atanhf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())atanhf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_atanhf128=yes
+else
+  gcc_cv_math_func_atanhf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_atanhf128" >&5
+$as_echo "$gcc_cv_math_func_atanhf128" >&6; }
+  if test $gcc_cv_math_func_atanhf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ATANHF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cargf128" >&5
+$as_echo_n "checking for cargf128... " >&6; }
+if ${gcc_cv_math_func_cargf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())cargf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_cargf128=yes
+else
+  gcc_cv_math_func_cargf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_cargf128" >&5
+$as_echo "$gcc_cv_math_func_cargf128" >&6; }
+  if test $gcc_cv_math_func_cargf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CARGF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceilf128" >&5
+$as_echo_n "checking for ceilf128... " >&6; }
+if ${gcc_cv_math_func_ceilf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())ceilf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_ceilf128=yes
+else
+  gcc_cv_math_func_ceilf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_ceilf128" >&5
+$as_echo "$gcc_cv_math_func_ceilf128" >&6; }
+  if test $gcc_cv_math_func_ceilf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CEILF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for copysignf128" >&5
+$as_echo_n "checking for copysignf128... " >&6; }
+if ${gcc_cv_math_func_copysignf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())copysignf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_copysignf128=yes
+else
+  gcc_cv_math_func_copysignf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_copysignf128" >&5
+$as_echo "$gcc_cv_math_func_copysignf128" >&6; }
+  if test $gcc_cv_math_func_copysignf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_COPYSIGNF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cosf128" >&5
+$as_echo_n "checking for cosf128... " >&6; }
+if ${gcc_cv_math_func_cosf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())cosf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_cosf128=yes
+else
+  gcc_cv_math_func_cosf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_cosf128" >&5
+$as_echo "$gcc_cv_math_func_cosf128" >&6; }
+  if test $gcc_cv_math_func_cosf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_COSF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ccosf128" >&5
+$as_echo_n "checking for ccosf128... " >&6; }
+if ${gcc_cv_math_func_ccosf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())ccosf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_ccosf128=yes
+else
+  gcc_cv_math_func_ccosf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_ccosf128" >&5
+$as_echo "$gcc_cv_math_func_ccosf128" >&6; }
+  if test $gcc_cv_math_func_ccosf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CCOSF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for coshf128" >&5
+$as_echo_n "checking for coshf128... " >&6; }
+if ${gcc_cv_math_func_coshf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())coshf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_coshf128=yes
+else
+  gcc_cv_math_func_coshf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_coshf128" >&5
+$as_echo "$gcc_cv_math_func_coshf128" >&6; }
+  if test $gcc_cv_math_func_coshf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_COSHF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ccoshf128" >&5
+$as_echo_n "checking for ccoshf128... " >&6; }
+if ${gcc_cv_math_func_ccoshf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())ccoshf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_ccoshf128=yes
+else
+  gcc_cv_math_func_ccoshf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_ccoshf128" >&5
+$as_echo "$gcc_cv_math_func_ccoshf128" >&6; }
+  if test $gcc_cv_math_func_ccoshf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CCOSHF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for expf128" >&5
+$as_echo_n "checking for expf128... " >&6; }
+if ${gcc_cv_math_func_expf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())expf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_expf128=yes
+else
+  gcc_cv_math_func_expf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_expf128" >&5
+$as_echo "$gcc_cv_math_func_expf128" >&6; }
+  if test $gcc_cv_math_func_expf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_EXPF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cexpf128" >&5
+$as_echo_n "checking for cexpf128... " >&6; }
+if ${gcc_cv_math_func_cexpf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())cexpf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_cexpf128=yes
+else
+  gcc_cv_math_func_cexpf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_cexpf128" >&5
+$as_echo "$gcc_cv_math_func_cexpf128" >&6; }
+  if test $gcc_cv_math_func_cexpf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CEXPF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabsf128" >&5
+$as_echo_n "checking for fabsf128... " >&6; }
+if ${gcc_cv_math_func_fabsf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())fabsf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_fabsf128=yes
+else
+  gcc_cv_math_func_fabsf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_fabsf128" >&5
+$as_echo "$gcc_cv_math_func_fabsf128" >&6; }
+  if test $gcc_cv_math_func_fabsf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_FABSF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cabsf128" >&5
+$as_echo_n "checking for cabsf128... " >&6; }
+if ${gcc_cv_math_func_cabsf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())cabsf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_cabsf128=yes
+else
+  gcc_cv_math_func_cabsf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_cabsf128" >&5
+$as_echo "$gcc_cv_math_func_cabsf128" >&6; }
+  if test $gcc_cv_math_func_cabsf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CABSF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for floorf128" >&5
+$as_echo_n "checking for floorf128... " >&6; }
+if ${gcc_cv_math_func_floorf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())floorf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_floorf128=yes
+else
+  gcc_cv_math_func_floorf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_floorf128" >&5
+$as_echo "$gcc_cv_math_func_floorf128" >&6; }
+  if test $gcc_cv_math_func_floorf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_FLOORF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fmaf128" >&5
+$as_echo_n "checking for fmaf128... " >&6; }
+if ${gcc_cv_math_func_fmaf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())fmaf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_fmaf128=yes
+else
+  gcc_cv_math_func_fmaf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_fmaf128" >&5
+$as_echo "$gcc_cv_math_func_fmaf128" >&6; }
+  if test $gcc_cv_math_func_fmaf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_FMAF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fmodf128" >&5
+$as_echo_n "checking for fmodf128... " >&6; }
+if ${gcc_cv_math_func_fmodf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())fmodf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_fmodf128=yes
+else
+  gcc_cv_math_func_fmodf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_fmodf128" >&5
+$as_echo "$gcc_cv_math_func_fmodf128" >&6; }
+  if test $gcc_cv_math_func_fmodf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_FMODF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for frexpf128" >&5
+$as_echo_n "checking for frexpf128... " >&6; }
+if ${gcc_cv_math_func_frexpf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())frexpf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_frexpf128=yes
+else
+  gcc_cv_math_func_frexpf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_frexpf128" >&5
+$as_echo "$gcc_cv_math_func_frexpf128" >&6; }
+  if test $gcc_cv_math_func_frexpf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_FREXPF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hypotf128" >&5
+$as_echo_n "checking for hypotf128... " >&6; }
+if ${gcc_cv_math_func_hypotf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())hypotf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_hypotf128=yes
+else
+  gcc_cv_math_func_hypotf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_hypotf128" >&5
+$as_echo "$gcc_cv_math_func_hypotf128" >&6; }
+  if test $gcc_cv_math_func_hypotf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_HYPOTF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldexpf128" >&5
+$as_echo_n "checking for ldexpf128... " >&6; }
+if ${gcc_cv_math_func_ldexpf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())ldexpf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_ldexpf128=yes
+else
+  gcc_cv_math_func_ldexpf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_ldexpf128" >&5
+$as_echo "$gcc_cv_math_func_ldexpf128" >&6; }
+  if test $gcc_cv_math_func_ldexpf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_LDEXPF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for logf128" >&5
+$as_echo_n "checking for logf128... " >&6; }
+if ${gcc_cv_math_func_logf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())logf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_logf128=yes
+else
+  gcc_cv_math_func_logf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_logf128" >&5
+$as_echo "$gcc_cv_math_func_logf128" >&6; }
+  if test $gcc_cv_math_func_logf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_LOGF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clogf128" >&5
+$as_echo_n "checking for clogf128... " >&6; }
+if ${gcc_cv_math_func_clogf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())clogf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_clogf128=yes
+else
+  gcc_cv_math_func_clogf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_clogf128" >&5
+$as_echo "$gcc_cv_math_func_clogf128" >&6; }
+  if test $gcc_cv_math_func_clogf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CLOGF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log10f128" >&5
+$as_echo_n "checking for log10f128... " >&6; }
+if ${gcc_cv_math_func_log10f128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())log10f128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_log10f128=yes
+else
+  gcc_cv_math_func_log10f128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_log10f128" >&5
+$as_echo "$gcc_cv_math_func_log10f128" >&6; }
+  if test $gcc_cv_math_func_log10f128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_LOG10F128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clog10f128" >&5
+$as_echo_n "checking for clog10f128... " >&6; }
+if ${gcc_cv_math_func_clog10f128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())clog10f128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_clog10f128=yes
+else
+  gcc_cv_math_func_clog10f128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_clog10f128" >&5
+$as_echo "$gcc_cv_math_func_clog10f128" >&6; }
+  if test $gcc_cv_math_func_clog10f128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CLOG10F128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nextafterf128" >&5
+$as_echo_n "checking for nextafterf128... " >&6; }
+if ${gcc_cv_math_func_nextafterf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())nextafterf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_nextafterf128=yes
+else
+  gcc_cv_math_func_nextafterf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_nextafterf128" >&5
+$as_echo "$gcc_cv_math_func_nextafterf128" >&6; }
+  if test $gcc_cv_math_func_nextafterf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_NEXTAFTERF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for powf128" >&5
+$as_echo_n "checking for powf128... " >&6; }
+if ${gcc_cv_math_func_powf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())powf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_powf128=yes
+else
+  gcc_cv_math_func_powf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_powf128" >&5
+$as_echo "$gcc_cv_math_func_powf128" >&6; }
+  if test $gcc_cv_math_func_powf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_POWF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cpowf128" >&5
+$as_echo_n "checking for cpowf128... " >&6; }
+if ${gcc_cv_math_func_cpowf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())cpowf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_cpowf128=yes
+else
+  gcc_cv_math_func_cpowf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_cpowf128" >&5
+$as_echo "$gcc_cv_math_func_cpowf128" >&6; }
+  if test $gcc_cv_math_func_cpowf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CPOWF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for roundf128" >&5
+$as_echo_n "checking for roundf128... " >&6; }
+if ${gcc_cv_math_func_roundf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())roundf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_roundf128=yes
+else
+  gcc_cv_math_func_roundf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_roundf128" >&5
+$as_echo "$gcc_cv_math_func_roundf128" >&6; }
+  if test $gcc_cv_math_func_roundf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ROUNDF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lroundf128" >&5
+$as_echo_n "checking for lroundf128... " >&6; }
+if ${gcc_cv_math_func_lroundf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())lroundf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_lroundf128=yes
+else
+  gcc_cv_math_func_lroundf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_lroundf128" >&5
+$as_echo "$gcc_cv_math_func_lroundf128" >&6; }
+  if test $gcc_cv_math_func_lroundf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_LROUNDF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for llroundf128" >&5
+$as_echo_n "checking for llroundf128... " >&6; }
+if ${gcc_cv_math_func_llroundf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())llroundf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_llroundf128=yes
+else
+  gcc_cv_math_func_llroundf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_llroundf128" >&5
+$as_echo "$gcc_cv_math_func_llroundf128" >&6; }
+  if test $gcc_cv_math_func_llroundf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_LLROUNDF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for scalbnf128" >&5
+$as_echo_n "checking for scalbnf128... " >&6; }
+if ${gcc_cv_math_func_scalbnf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())scalbnf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_scalbnf128=yes
+else
+  gcc_cv_math_func_scalbnf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_scalbnf128" >&5
+$as_echo "$gcc_cv_math_func_scalbnf128" >&6; }
+  if test $gcc_cv_math_func_scalbnf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SCALBNF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinf128" >&5
+$as_echo_n "checking for sinf128... " >&6; }
+if ${gcc_cv_math_func_sinf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())sinf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_sinf128=yes
+else
+  gcc_cv_math_func_sinf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_sinf128" >&5
+$as_echo "$gcc_cv_math_func_sinf128" >&6; }
+  if test $gcc_cv_math_func_sinf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SINF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for csinf128" >&5
+$as_echo_n "checking for csinf128... " >&6; }
+if ${gcc_cv_math_func_csinf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())csinf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_csinf128=yes
+else
+  gcc_cv_math_func_csinf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_csinf128" >&5
+$as_echo "$gcc_cv_math_func_csinf128" >&6; }
+  if test $gcc_cv_math_func_csinf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CSINF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinhf128" >&5
+$as_echo_n "checking for sinhf128... " >&6; }
+if ${gcc_cv_math_func_sinhf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())sinhf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_sinhf128=yes
+else
+  gcc_cv_math_func_sinhf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_sinhf128" >&5
+$as_echo "$gcc_cv_math_func_sinhf128" >&6; }
+  if test $gcc_cv_math_func_sinhf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SINHF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for csinhf128" >&5
+$as_echo_n "checking for csinhf128... " >&6; }
+if ${gcc_cv_math_func_csinhf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())csinhf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_csinhf128=yes
+else
+  gcc_cv_math_func_csinhf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_csinhf128" >&5
+$as_echo "$gcc_cv_math_func_csinhf128" >&6; }
+  if test $gcc_cv_math_func_csinhf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CSINHF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrtf128" >&5
+$as_echo_n "checking for sqrtf128... " >&6; }
+if ${gcc_cv_math_func_sqrtf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())sqrtf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_sqrtf128=yes
+else
+  gcc_cv_math_func_sqrtf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_sqrtf128" >&5
+$as_echo "$gcc_cv_math_func_sqrtf128" >&6; }
+  if test $gcc_cv_math_func_sqrtf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SQRTF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for csqrtf128" >&5
+$as_echo_n "checking for csqrtf128... " >&6; }
+if ${gcc_cv_math_func_csqrtf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())csqrtf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_csqrtf128=yes
+else
+  gcc_cv_math_func_csqrtf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_csqrtf128" >&5
+$as_echo "$gcc_cv_math_func_csqrtf128" >&6; }
+  if test $gcc_cv_math_func_csqrtf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CSQRTF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanf128" >&5
+$as_echo_n "checking for tanf128... " >&6; }
+if ${gcc_cv_math_func_tanf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())tanf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_tanf128=yes
+else
+  gcc_cv_math_func_tanf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_tanf128" >&5
+$as_echo "$gcc_cv_math_func_tanf128" >&6; }
+  if test $gcc_cv_math_func_tanf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_TANF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ctanf128" >&5
+$as_echo_n "checking for ctanf128... " >&6; }
+if ${gcc_cv_math_func_ctanf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())ctanf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_ctanf128=yes
+else
+  gcc_cv_math_func_ctanf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_ctanf128" >&5
+$as_echo "$gcc_cv_math_func_ctanf128" >&6; }
+  if test $gcc_cv_math_func_ctanf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CTANF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanhf128" >&5
+$as_echo_n "checking for tanhf128... " >&6; }
+if ${gcc_cv_math_func_tanhf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())tanhf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_tanhf128=yes
+else
+  gcc_cv_math_func_tanhf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_tanhf128" >&5
+$as_echo "$gcc_cv_math_func_tanhf128" >&6; }
+  if test $gcc_cv_math_func_tanhf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_TANHF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ctanhf128" >&5
+$as_echo_n "checking for ctanhf128... " >&6; }
+if ${gcc_cv_math_func_ctanhf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())ctanhf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_ctanhf128=yes
+else
+  gcc_cv_math_func_ctanhf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_ctanhf128" >&5
+$as_echo "$gcc_cv_math_func_ctanhf128" >&6; }
+  if test $gcc_cv_math_func_ctanhf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CTANHF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for truncf128" >&5
+$as_echo_n "checking for truncf128... " >&6; }
+if ${gcc_cv_math_func_truncf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())truncf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_truncf128=yes
+else
+  gcc_cv_math_func_truncf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_truncf128" >&5
+$as_echo "$gcc_cv_math_func_truncf128" >&6; }
+  if test $gcc_cv_math_func_truncf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_TRUNCF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for erff128" >&5
+$as_echo_n "checking for erff128... " >&6; }
+if ${gcc_cv_math_func_erff128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())erff128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_erff128=yes
+else
+  gcc_cv_math_func_erff128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_erff128" >&5
+$as_echo "$gcc_cv_math_func_erff128" >&6; }
+  if test $gcc_cv_math_func_erff128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ERFF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for erfcf128" >&5
+$as_echo_n "checking for erfcf128... " >&6; }
+if ${gcc_cv_math_func_erfcf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())erfcf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_erfcf128=yes
+else
+  gcc_cv_math_func_erfcf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_erfcf128" >&5
+$as_echo "$gcc_cv_math_func_erfcf128" >&6; }
+  if test $gcc_cv_math_func_erfcf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ERFCF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for j0f128" >&5
+$as_echo_n "checking for j0f128... " >&6; }
+if ${gcc_cv_math_func_j0f128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())j0f128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_j0f128=yes
+else
+  gcc_cv_math_func_j0f128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_j0f128" >&5
+$as_echo "$gcc_cv_math_func_j0f128" >&6; }
+  if test $gcc_cv_math_func_j0f128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_J0F128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for j1f128" >&5
+$as_echo_n "checking for j1f128... " >&6; }
+if ${gcc_cv_math_func_j1f128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())j1f128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_j1f128=yes
+else
+  gcc_cv_math_func_j1f128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_j1f128" >&5
+$as_echo "$gcc_cv_math_func_j1f128" >&6; }
+  if test $gcc_cv_math_func_j1f128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_J1F128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jnf128" >&5
+$as_echo_n "checking for jnf128... " >&6; }
+if ${gcc_cv_math_func_jnf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())jnf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_jnf128=yes
+else
+  gcc_cv_math_func_jnf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_jnf128" >&5
+$as_echo "$gcc_cv_math_func_jnf128" >&6; }
+  if test $gcc_cv_math_func_jnf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_JNF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for y0f128" >&5
+$as_echo_n "checking for y0f128... " >&6; }
+if ${gcc_cv_math_func_y0f128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())y0f128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_y0f128=yes
+else
+  gcc_cv_math_func_y0f128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_y0f128" >&5
+$as_echo "$gcc_cv_math_func_y0f128" >&6; }
+  if test $gcc_cv_math_func_y0f128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_Y0F128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for y1f128" >&5
+$as_echo_n "checking for y1f128... " >&6; }
+if ${gcc_cv_math_func_y1f128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())y1f128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_y1f128=yes
+else
+  gcc_cv_math_func_y1f128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_y1f128" >&5
+$as_echo "$gcc_cv_math_func_y1f128" >&6; }
+  if test $gcc_cv_math_func_y1f128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_Y1F128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ynf128" >&5
+$as_echo_n "checking for ynf128... " >&6; }
+if ${gcc_cv_math_func_ynf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())ynf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_ynf128=yes
+else
+  gcc_cv_math_func_ynf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_ynf128" >&5
+$as_echo "$gcc_cv_math_func_ynf128" >&6; }
+  if test $gcc_cv_math_func_ynf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_YNF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgammaf128" >&5
+$as_echo_n "checking for tgammaf128... " >&6; }
+if ${gcc_cv_math_func_tgammaf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())tgammaf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_tgammaf128=yes
+else
+  gcc_cv_math_func_tgammaf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_tgammaf128" >&5
+$as_echo "$gcc_cv_math_func_tgammaf128" >&6; }
+  if test $gcc_cv_math_func_tgammaf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_TGAMMAF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lgammaf128" >&5
+$as_echo_n "checking for lgammaf128... " >&6; }
+if ${gcc_cv_math_func_lgammaf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())lgammaf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_lgammaf128=yes
+else
+  gcc_cv_math_func_lgammaf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_lgammaf128" >&5
+$as_echo "$gcc_cv_math_func_lgammaf128" >&6; }
+  if test $gcc_cv_math_func_lgammaf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_LGAMMAF128 1
+_ACEOF
+
+  fi
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cacosf128" >&5
+$as_echo_n "checking for cacosf128... " >&6; }
+if ${gcc_cv_math_func_cacosf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())cacosf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_cacosf128=yes
+else
+  gcc_cv_math_func_cacosf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_cacosf128" >&5
+$as_echo "$gcc_cv_math_func_cacosf128" >&6; }
+  if test $gcc_cv_math_func_cacosf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CACOSF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cacoshf128" >&5
+$as_echo_n "checking for cacoshf128... " >&6; }
+if ${gcc_cv_math_func_cacoshf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())cacoshf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_cacoshf128=yes
+else
+  gcc_cv_math_func_cacoshf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_cacoshf128" >&5
+$as_echo "$gcc_cv_math_func_cacoshf128" >&6; }
+  if test $gcc_cv_math_func_cacoshf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CACOSHF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for casinf128" >&5
+$as_echo_n "checking for casinf128... " >&6; }
+if ${gcc_cv_math_func_casinf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())casinf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_casinf128=yes
+else
+  gcc_cv_math_func_casinf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_casinf128" >&5
+$as_echo "$gcc_cv_math_func_casinf128" >&6; }
+  if test $gcc_cv_math_func_casinf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CASINF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for casinhf128" >&5
+$as_echo_n "checking for casinhf128... " >&6; }
+if ${gcc_cv_math_func_casinhf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())casinhf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_casinhf128=yes
+else
+  gcc_cv_math_func_casinhf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_casinhf128" >&5
+$as_echo "$gcc_cv_math_func_casinhf128" >&6; }
+  if test $gcc_cv_math_func_casinhf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CASINHF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catanf128" >&5
+$as_echo_n "checking for catanf128... " >&6; }
+if ${gcc_cv_math_func_catanf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())catanf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_catanf128=yes
+else
+  gcc_cv_math_func_catanf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_catanf128" >&5
+$as_echo "$gcc_cv_math_func_catanf128" >&6; }
+  if test $gcc_cv_math_func_catanf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CATANF128 1
+_ACEOF
+
+  fi
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catanhf128" >&5
+$as_echo_n "checking for catanhf128... " >&6; }
+if ${gcc_cv_math_func_catanhf128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test x$gcc_no_link = xyes; then
+  as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())catanhf128;
+
+int
+main ()
+{
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gcc_cv_math_func_catanhf128=yes
+else
+  gcc_cv_math_func_catanhf128=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_math_func_catanhf128" >&5
+$as_echo "$gcc_cv_math_func_catanhf128" >&6; }
+  if test $gcc_cv_math_func_catanhf128 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_CATANHF128 1
+_ACEOF
+
+  fi
+
+
 # Check whether the system has a working stat()
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target stat is reliable" >&5
@@ -27099,27 +30082,44 @@ $as_echo "#define HAVE_MINGW_SNPRINTF 1"
   fi
 
 
+have_iec_60559_libc_support=no
+if test "x$ac_cv_func_strtof128$ac_cv_func_strfromf128" = xyesyes \
+   && test "x$gcc_cv_math_func_sinf128$gcc_cv_math_func_cacosf128" = xyesyes; then
+  have_iec_60559_libc_support=yes
+fi
+
 # Check whether libquadmath should be used
 # Check whether --enable-libquadmath-support was given.
 if test "${enable_libquadmath_support+set}" = set; then :
   enableval=$enable_libquadmath_support; ENABLE_LIBQUADMATH_SUPPORT=$enableval
 else
+  if test "x$have_iec_60559_libc_support" = xyes; then
+  ENABLE_LIBQUADMATH_SUPPORT=default
+else
   ENABLE_LIBQUADMATH_SUPPORT=yes
 fi
+fi
 
 enable_libquadmath_support=
 if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
   enable_libquadmath_support=no
+elif test "${ENABLE_LIBQUADMATH_SUPPORT}" = "default" ; then
+  enable_libquadmath_support=default
 fi
 
-# Check whether we have a __float128 type, depends on enable_libquadmath_support
+# Check whether we have a _Float128 type, depends on enable_libquadmath_support
+# and have_iec_60559_libc_support.
 
   LIBQUADSPEC=
+  LIBQUADLIB=
+  LIBQUADLIB_DEP=
+  LIBQUADINCLUDE=
+  USE_IEC_60559=no
 
   if test "x$enable_libquadmath_support" != xno; then
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have a usable __float128 type" >&5
-$as_echo_n "checking whether we have a usable __float128 type... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have a usable _Float128 type" >&5
+$as_echo_n "checking whether we have a usable _Float128 type... " >&6; }
 if ${libgfor_cv_have_float128+:} false; then :
   $as_echo_n "(cached) " >&6
 else
@@ -27128,29 +30128,29 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-    typedef _Complex float __attribute__((mode(TC))) __complex128;
-
-    __float128 foo (__float128 x)
+    _Float128 foo (_Float128 x)
     {
 
-     __complex128 z1, z2;
+     _Complex _Float128 z1, z2;
 
      z1 = x;
-     z2 = x / 7.Q;
+     z2 = x / 7.F128;
      z2 /= z1;
 
-     return (__float128) z2;
+     return (_Float128) z2;
     }
 
-    __float128 bar (__float128 x)
+    _Float128 bar (_Float128 x)
     {
-      return x * __builtin_huge_valq ();
+      return x * __builtin_huge_valf128 ();
     }
 
 int
 main ()
 {
 
+    foo (1.2F128);
+    bar (1.2F128);
     foo (1.2Q);
     bar (1.2Q);
 
@@ -27175,29 +30175,29 @@ fi
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-    typedef _Complex float __attribute__((mode(TC))) __complex128;
-
-    __float128 foo (__float128 x)
+    _Float128 foo (_Float128 x)
     {
 
-     __complex128 z1, z2;
+     _Complex _Float128 z1, z2;
 
      z1 = x;
-     z2 = x / 7.Q;
+     z2 = x / 7.F128;
      z2 /= z1;
 
-     return (__float128) z2;
+     return (_Float128) z2;
     }
 
-    __float128 bar (__float128 x)
+    _Float128 bar (_Float128 x)
     {
-      return x * __builtin_huge_valq ();
+      return x * __builtin_huge_valf128 ();
     }
 
 int
 main ()
 {
 
+    foo (1.2F128);
+    bar (1.2F128);
     foo (1.2Q);
     bar (1.2Q);
 
@@ -27221,7 +30221,17 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_float128" >&5
 $as_echo "$libgfor_cv_have_float128" >&6; }
 
+    if test "x$have_iec_60559_libc_support$enable_libquadmath_support$libgfor_cv_have_float128" = xyesdefaultyes; then
+      USE_IEC_60559=yes
+    fi
+
+
   if test "x$libgfor_cv_have_float128" = xyes; then
+    if test "x$USE_IEC_60559" = xyes; then
+
+$as_echo "#define USE_IEC_60559 1" >>confdefs.h
+
+    fi
 
 $as_echo "#define HAVE_FLOAT128 1" >>confdefs.h
 
@@ -27301,26 +30311,27 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_as_needed" >&5
 $as_echo "$libgfor_cv_have_as_needed" >&6; }
 
-        if test "x$libgfor_cv_have_as_needed" = xyes; then
-      LIBQUADSPEC="%{static-libgfortran:$libgfor_cv_as_needed_option} -lquadmath %{static-libgfortran:$libgfor_cv_no_as_needed_option}"
+                    if test "x$libgfor_cv_have_as_needed" = xyes; then
+      if test "x$USE_IEC_60559" = xyes; then
+	LIBQUADSPEC="$libgfor_cv_as_needed_option -lquadmath $libgfor_cv_no_as_needed_option"
+      else
+	LIBQUADSPEC="%{static-libgfortran:$libgfor_cv_as_needed_option} -lquadmath %{static-libgfortran:$libgfor_cv_no_as_needed_option}"
+      fi
     else
       LIBQUADSPEC="-lquadmath"
     fi
-    if test -f ../libquadmath/libquadmath.la; then
-      LIBQUADLIB=../libquadmath/libquadmath.la
-      LIBQUADLIB_DEP=../libquadmath/libquadmath.la
-      LIBQUADINCLUDE='-I$(srcdir)/../libquadmath'
-    else
-      LIBQUADLIB="-lquadmath"
-      LIBQUADLIB_DEP=
-      LIBQUADINCLUDE=
+    if test "x$USE_IEC_60559" != xyes; then
+      if test -f ../libquadmath/libquadmath.la; then
+	LIBQUADLIB=../libquadmath/libquadmath.la
+	LIBQUADLIB_DEP=../libquadmath/libquadmath.la
+	LIBQUADINCLUDE='-I$(srcdir)/../libquadmath'
+      else
+	LIBQUADLIB="-lquadmath"
+      fi
     fi
-  fi
   else
-    # for --disable-quadmath
-    LIBQUADLIB=
-    LIBQUADLIB_DEP=
-    LIBQUADINCLUDE=
+    USE_IEC_60559=no
+  fi
   fi
 
 
@@ -27328,14 +30339,6 @@ $as_echo "$libgfor_cv_have_as_needed" >&
 
 
 
-     if test "x$libgfor_cv_have_float128" = xyes; then
-  LIBGFOR_BUILD_QUAD_TRUE=
-  LIBGFOR_BUILD_QUAD_FALSE='#'
-else
-  LIBGFOR_BUILD_QUAD_TRUE='#'
-  LIBGFOR_BUILD_QUAD_FALSE=
-fi
-
 
 
 # Check for GNU libc feenableexcept
@@ -28519,10 +31522,6 @@ if test -z "${HAVE_HWCAP_TRUE}" && test
   as_fn_error $? "conditional \"HAVE_HWCAP\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${LIBGFOR_BUILD_QUAD_TRUE}" && test -z "${LIBGFOR_BUILD_QUAD_FALSE}"; then
-  as_fn_error $? "conditional \"LIBGFOR_BUILD_QUAD\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${IEEE_SUPPORT_TRUE}" && test -z "${IEEE_SUPPORT_FALSE}"; then
   as_fn_error $? "conditional \"IEEE_SUPPORT\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
--- libgfortran/Makefile.in.jj	2022-06-27 11:17:35.620408638 +0200
+++ libgfortran/Makefile.in	2022-06-27 13:50:05.008983865 +0200
@@ -664,6 +664,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+USE_IEC_60559 = @USE_IEC_60559@
 VERSION = @VERSION@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -7674,7 +7675,9 @@ ieee_arithmetic.mod: ieee_arithmetic.lo
 @onestep_TRUE@	$(LTCOMPILE) -c -o $@ $^ -combine
 
 kinds.h: $(srcdir)/mk-kinds-h.sh
-	$(SHELL) $(srcdir)/mk-kinds-h.sh '@LIBGOMP_CHECKED_INT_KINDS@' '@LIBGOMP_CHECKED_REAL_KINDS@' '$(FCCOMPILE)' > $@ || rm $@
+	$(SHELL) $(srcdir)/mk-kinds-h.sh '@LIBGOMP_CHECKED_INT_KINDS@' \
+					 '@LIBGOMP_CHECKED_REAL_KINDS@' \
+					 '$(FCCOMPILE)' '@USE_IEC_60559@' > $@ || rm $@
 
 kinds.inc: kinds.h $(srcdir)/kinds-override.h
 	cat kinds.h $(srcdir)/kinds-override.h | grep '^#' | grep -v include > $@
--- libgfortran/generated/bessel_r16.c.jj	2022-06-27 11:17:35.843405751 +0200
+++ libgfortran/generated/bessel_r16.c	2022-06-27 13:33:37.301650783 +0200
@@ -29,7 +29,11 @@ see the files COPYING3 and COPYING.RUNTI
 
 
 #if defined(GFC_REAL_16_IS_FLOAT128)
+#if defined(GFC_REAL_16_USE_IEC_60559)
+#define MATHFUNC(funcname) funcname ## f128
+#else
 #define MATHFUNC(funcname) funcname ## q
+#endif
 #else
 #define MATHFUNC(funcname) funcname ## l
 #endif
--- libgfortran/generated/bessel_r17.c.jj	2022-06-27 11:17:35.880405273 +0200
+++ libgfortran/generated/bessel_r17.c	2022-06-27 13:34:12.325199418 +0200
@@ -30,6 +30,8 @@ see the files COPYING3 and COPYING.RUNTI
 
 #if defined(POWER_IEEE128)
 #define MATHFUNC(funcname) __ ## funcname ## ieee128
+#elif defined(GFC_REAL_17_USE_IEC_60559)
+#define MATHFUNC(funcname) funcname ## f128
 #else
 #define MATHFUNC(funcname) funcname ## q
 #endif
--- libgfortran/generated/norm2_r16.c.jj	2022-06-27 11:17:35.898405040 +0200
+++ libgfortran/generated/norm2_r16.c	2022-06-27 13:35:16.046378216 +0200
@@ -30,7 +30,11 @@ see the files COPYING3 and COPYING.RUNTI
 #if defined (HAVE_GFC_REAL_16) && defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_SQRTL)) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FABSL))
 
 #if defined(GFC_REAL_16_IS_FLOAT128)
+#if defined(GFC_REAL_16_USE_IEC_60559)
+#define MATHFUNC(funcname) funcname ## f128
+#else
 #define MATHFUNC(funcname) funcname ## q
+#endif
 #else
 #define MATHFUNC(funcname) funcname ## l
 #endif
--- libgfortran/generated/norm2_r17.c.jj	2022-06-27 11:17:35.929404638 +0200
+++ libgfortran/generated/norm2_r17.c	2022-06-27 13:35:50.575935032 +0200
@@ -31,6 +31,8 @@ see the files COPYING3 and COPYING.RUNTI
 
 #if defined(POWER_IEEE128)
 #define MATHFUNC(funcname) __ ## funcname ## ieee128
+#elif defined(GFC_REAL_17_USE_IEC_60559)
+#define MATHFUNC(funcname) funcname ## f128
 #else
 #define MATHFUNC(funcname) funcname ## q
 #endif


	Jakub


  reply	other threads:[~2022-06-27 13:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23 12:04 [PATCH] fortran, libgfortran: " Jakub Jelinek
2022-06-23 20:49 ` Harald Anlauf
2022-06-23 21:17   ` Jakub Jelinek
2022-06-24 10:29     ` [PATCH] fortran, libgfortran, v2: " Jakub Jelinek
2022-06-24 21:06       ` Harald Anlauf
2022-06-26 18:45       ` Mikael Morin
2022-06-27  7:54         ` Jakub Jelinek
2022-06-27 11:56           ` Mikael Morin
2022-06-27 13:30             ` Jakub Jelinek [this message]
2022-06-28  7:01               ` [PATCH] fortran, libgfortran, v3: " Jakub Jelinek
2022-06-28  8:35               ` Tobias Burnus
2022-06-28 10:57                 ` Jakub Jelinek
2022-06-27 20:54           ` [PATCH] fortran, libgfortran, v2: " Joseph Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YrmxCTxa3L5ZhNmy@tucnak \
    --to=jakub@redhat.com \
    --cc=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=morin-mikael@orange.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).