public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] fortran, libgfortran: Avoid using libquadmath for glibc 2.26+
@ 2022-06-23 12:04 Jakub Jelinek
  2022-06-23 20:49 ` Harald Anlauf
  0 siblings, 1 reply; 13+ messages in thread
From: Jakub Jelinek @ 2022-06-23 12:04 UTC (permalink / raw)
  To: gcc-patches, fortran; +Cc: Joseph S. Myers

Hi!

As mentioned by Joseph in PR105101, glibc 2.26 or later has on x86
(both -m32/-m64), powerpc64le, ia64 and mips support for
*f128 math/complex APIs plus strtof128 and strfromf128, and these APIs allow
us to avoid libquadmath for Fortran purposes on these architectures,
replace *q math/complex APIs, strtof128 instead of strtoflt128 and,
while strfromf128 unfortunately isn't a perfect replacement to
quadmath_snprintf, it can be made to work.

The advantage of this is that when configured against such glibcs
(2.26 is now almost 5 years old), we can avoid linking against an extra shared
library and the math support in glibc is maintained better than libquadmath.

We need both a compiler change (so that for glibc 2.26+ it uses *f128 APIs
instead of *q) and library change.

The above mentioned problem with strfromf128 is that the strfrom* functions
are severely restricted versions of snprintf.  In libgfortran, we handle
!isfinite differently and just use snprintf/quadmath_snprintf for
%+-#.*{L,Q}{f,e} printing.
strfrom* doesn't allow +, -, # modifiers and it only supports .34 or
similar precision, not .* .  The L/Q etc. letters are omitted.
The + is there to force + sign at the start if it is positive.
Workaround in the patch is to add the + at the start manually for
!signbit (val).
The - (left alignment instead of right) I don't understand why we need it,
when minimum field width isn't specified (for strfrom* can't be specified),
no padding is ever added anywhere I believe.
The # is to force adding . - workaround is to search for first . or e or '\0'
character, if it is '\0', just append ., if it is e, insert . before e and
memmove the rest (which is just a few bytes, e, +/- and at most a few digits)
one byte later.
The .* case is handled by creating the format string for strfrom* by
snprintf into a temporary buffer.

So far lightly tested on x86_64-linux with glibc 2.35 (removed libgfortran
dirs, rebuilt stage3 f951 and make all-target-libgfortran + make
check-gfortran), ok for trunk if it passes full testing?

On powerpc64le-linux, guess we'll need to test 3 configurations, glibc < 2.26,
glibc 2.26 to 2.31 and glibc 2.32 and later.

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

gcc/fortran/
	* gfortran.h (gfc_real_inf0: Add c__Float128 bitfield.
	* trans-types.h (gfc_real16_is_float128): Update comment.
	(gfc_real16_is__Float128): Declare.
	* trans-types.cc (gfc_real16_is__Float128): Define.
	(gfc_init_kinds): When building powerpc64le-linux libgfortran
	on glibc 2.26 to 2.31, set gfc_real16_is__Float128 and
	c__Float128 instead of gfc_real16_is_float128 and c_float128.
	(gfc_build_real_type): Don't set c_long_double if c__Float128.
	Set gfc_real16_is__Float128 and c__Float128 instead of
	gfc_real16_is_float128 and c_float128 on glibc 2.26 or later.
	(gfc_init_types): Handle c__Float128 like c_float128.
	* trans-intrinsic.cc (builtin_decl_for_precision): Handle
	gfc_real16_is__Float128 like gfc_real16_is_float128.
	(gfc_builtin_decl_for_float_kind): Handle c__Float128 like c_float128.
	(gfc_build_intrinsic_lib_fndecls): For gfc_real16_is__Float128
	use *f128 APIs rather than *q APIs used for gfc_real16_is_float128.
	(gfc_get_intrinsic_lib_fndecl): Likewise.
	* trans-expr.cc (gfc_conv_power_op): Handle gfc_real16_is__Float128
	like gfc_real16_is_float128.
libgfortran/
	* configure.ac: Check for strtof128 and strfromf128.
	Check for math and complex *f128 functions.  Set
	have__Float128_libc_support to yes if *f128 support is around, for
	--enable-libquadmath-support default to no rather than yes if
	have__Float128_libc_support is yes.
	* acinclude.m4 (LIBGFOR_CHECK_FLOAT128): If libquadmath support
	isn't enabled and have__Float128_libc_support is yes, test
	_Float128/_Complex _Float128 support and define and subst
	HAVE__FLOAT128.
	* Makefile.am (kinds.h): Pass @HAVE__FLOAT128@ as an extra
	mk-kinds-h.sh argument.
	* mk-kinds-h.sh: Accept 4th have__float128 argument, if it is yes,
	use _Float128/_Complex _Float128 types insted of __float128 and
	_Complex float __attribute__((mode(TC))), use f128 suffix instead
	of q and define GFC_REAL_16_IS__FLOAT128 instead of
	GFC_REAL_16_IS_FLOAT128.
	* kinds-override.h: Add consistency check for GFC_REAL_16_IS__FLOAT128.
	* libgfortran.h (GFC_REAL_16_INFINITY, GFC_REAL_16_QUIET_NAN): Define
	for GFC_REAL_16_IS__FLOAT128.
	* caf/single.c (convert_type): Use _Float128/_Complex _Float128 for
	GFC_REAL_16_IS__FLOAT128.  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 (__issignalingf128): Handle
	GFC_REAL_16_IS__FLOAT128.
	(issignaling): Likewise.
	* ieee/ieee_helper.c: Handle GFC_REAL_16_IS__FLOAT128 like
	GFC_REAL_16_IS_FLOAT128.
	* intrinsics/cshift0.c (cshift0): Likewise.  Fix a comment typo,
	logn double -> long double.
	* intrinsics/erfc_scaled.c (_THRESH, _M_2_SQRTPI, _INF, _ERFC, _EXP):
	Handle GFC_REAL_16_IS_FLOAT128.
	* intrinsics/spread_generic.c (spread, spread_scalar): Handle
	GFC_REAL_16_IS__FLOAT128 like GFC_REAL_16_IS_FLOAT128.  Fix a comment
	typo, logn double -> long double.
	* intrinsics/trigd.c (GFC_REAL_16_IS_LONG_DOUBLE): Handle
	GFC_REAL_16_IS_LONG_DOUBLE.
	* intrinsics/pack_generic.c (pack): Handle GFC_REAL_16_IS__FLOAT128
	like GFC_REAL_16_IS_FLOAT128.  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_IS__FLOAT128.
	* io/transfer128.c: Enable also for GFC_REAL_16_IS__FLOAT128,
	but don't define tmp1 and tmp2 vars in that case.
	* io/write_float.def (gfor_strfromf128): New function.
	(DTOA2F128, FDTOA2F128): Define.
	(determine_en_precision, get_float_string): Handle
	GFC_REAL_16_IS__FLOAT128.
	* m4/mtype.m4: Likewise.
	* config.h.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
	* generated/norm2_r16.c: Regenerated.
	* generated/bessel_r16.c: Regenerated.

--- gcc/fortran/gfortran.h.jj	2022-05-30 14:07:12.277196546 +0200
+++ gcc/fortran/gfortran.h	2022-06-23 11:34:55.550568362 +0200
@@ -2665,6 +2665,7 @@ typedef struct
   unsigned int c_double : 1;
   unsigned int c_long_double : 1;
   unsigned int c_float128 : 1;
+  unsigned int c__Float128 : 1;
 }
 gfc_real_info;
 
--- gcc/fortran/trans-types.h.jj	2022-01-18 11:58:59.579982099 +0100
+++ gcc/fortran/trans-types.h	2022-06-23 11:35:04.446450491 +0200
@@ -55,9 +55,12 @@ extern GTY(()) tree gfc_charlen_type_nod
 
 /* The following flags give us information on the correspondence of
    real (and complex) kinds with C floating-point types long double
-   and _Float128.  */
+   and _Float128 and using libquadmath APIs.  */
 extern bool gfc_real16_is_float128;
 
+/* Similarly, but using glibc *f128 APIs.  */
+extern bool gfc_real16_is__Float128;
+
 enum gfc_packed {
   PACKED_NO = 0,
   PACKED_PARTIAL,
--- gcc/fortran/trans-types.cc.jj	2022-05-16 11:14:57.587427707 +0200
+++ gcc/fortran/trans-types.cc	2022-06-23 11:55:15.194406144 +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_is__Float128 = false;
 
 static GTY(()) tree gfc_desc_dim_type;
 static GTY(()) tree gfc_max_array_element_size;
@@ -522,8 +523,16 @@ gfc_init_kinds (void)
 		&& (TARGET_GLIBC_MAJOR < 2
 		    || (TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR < 32)))
 	      {
-		gfc_real16_is_float128 = true;
-		gfc_real_kinds[i].c_float128 = 1;
+		if (TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR >= 26)
+		  {
+		    gfc_real16_is__Float128 = true;
+		    gfc_real_kinds[i].c__Float128 = 1;
+		  }
+		else
+		  {
+		    gfc_real16_is_float128 = true;
+		    gfc_real_kinds[i].c_float128 = 1;
+		  }
 	      }
 	  }
     }
@@ -871,13 +880,24 @@ gfc_build_real_type (gfc_real_info *info
     info->c_float = 1;
   if (mode_precision == DOUBLE_TYPE_SIZE)
     info->c_double = 1;
-  if (mode_precision == LONG_DOUBLE_TYPE_SIZE && !info->c_float128)
+  if (mode_precision == LONG_DOUBLE_TYPE_SIZE
+      && !info->c_float128
+      && !info->c__Float128)
     info->c_long_double = 1;
   if (mode_precision != LONG_DOUBLE_TYPE_SIZE && mode_precision == 128)
     {
       /* 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->c__Float128 = 1;
+	  gfc_real16_is__Float128 = true;
+	}
+      else
+	{
+	  info->c_float128 = 1;
+	  gfc_real16_is_float128 = true;
+	}
     }
 
   if (TYPE_PRECISION (float_type_node) == mode_precision)
@@ -981,7 +1001,8 @@ gfc_init_types (void)
 		gfc_real_kinds[index].kind);
       PUSH_TYPE (name_buf, type);
 
-      if (gfc_real_kinds[index].c_float128)
+      if (gfc_real_kinds[index].c_float128
+	  || gfc_real_kinds[index].c__Float128)
 	gfc_float128_type_node = type;
 
       type = gfc_build_complex_type (type);
@@ -990,7 +1011,8 @@ gfc_init_types (void)
 		gfc_real_kinds[index].kind);
       PUSH_TYPE (name_buf, type);
 
-      if (gfc_real_kinds[index].c_float128)
+      if (gfc_real_kinds[index].c_float128
+	  || gfc_real_kinds[index].c__Float128)
 	gfc_complex_float128_type_node = type;
     }
 
--- gcc/fortran/trans-intrinsic.cc.jj	2022-05-16 11:14:57.587427707 +0200
+++ gcc/fortran/trans-intrinsic.cc	2022-06-23 11:42:03.355899271 +0200
@@ -155,7 +155,7 @@ builtin_decl_for_precision (enum built_i
   else if (precision == TYPE_PRECISION (double_type_node))
     i = m->double_built_in;
   else if (precision == TYPE_PRECISION (long_double_type_node)
-	   && (!gfc_real16_is_float128
+	   && ((!gfc_real16_is_float128 & !gfc_real16_is__Float128)
 	       || long_double_type_node != gfc_float128_type_node))
     i = m->long_double_built_in;
   else if (precision == TYPE_PRECISION (gfc_float128_type_node))
@@ -175,7 +175,7 @@ gfc_builtin_decl_for_float_kind (enum bu
 {
   int i = gfc_validate_kind (BT_REAL, kind, false);
 
-  if (gfc_real_kinds[i].c_float128)
+  if (gfc_real_kinds[i].c_float128 || gfc_real_kinds[i].c__Float128)
     {
       /* For _Float128, the story is a bit different, because we return
 	 a decl to a library function rather than a built-in.  */
@@ -688,7 +688,7 @@ gfc_build_intrinsic_lib_fndecls (void)
   gfc_intrinsic_map_t *m;
   tree quad_decls[END_BUILTINS + 1];
 
-  if (gfc_real16_is_float128)
+  if (gfc_real16_is_float128 || gfc_real16_is__Float128)
   {
     /* If we have soft-float types, we create the decls for their
        C99-like library functions.  For now, we only handle _Float128
@@ -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_is__Float128			\
+			     ? 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_is__Float128
+			     ? "sqrtf128" : "sqrtq", func_1, true);
   }
 
   /* Add GCC builtin functions.  */
@@ -775,7 +779,7 @@ gfc_build_intrinsic_lib_fndecls (void)
 	m->complex10_decl
 	  = builtin_decl_explicit (m->complex_long_double_built_in);
 
-      if (!gfc_real16_is_float128)
+      if (!gfc_real16_is_float128 && !gfc_real16_is__Float128)
 	{
 	  if (m->long_double_built_in != END_BUILTINS)
 	    m->real16_decl = builtin_decl_explicit (m->long_double_built_in);
@@ -876,6 +880,9 @@ gfc_get_intrinsic_lib_fndecl (gfc_intrin
       else if (gfc_real_kinds[n].c_float128)
 	snprintf (name, sizeof (name), "%s%s%s",
 		  ts->type == BT_COMPLEX ? "c" : "", m->name, "q");
+      else if (gfc_real_kinds[n].c__Float128)
+	snprintf (name, sizeof (name), "%s%s%s",
+		  ts->type == BT_COMPLEX ? "c" : "", m->name, "f128");
       else
 	gcc_unreachable ();
     }
--- gcc/fortran/trans-expr.cc.jj	2022-04-23 10:10:51.146097072 +0200
+++ gcc/fortran/trans-expr.cc	2022-06-23 11:49:31.191964727 +0200
@@ -3582,7 +3582,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr
 		case 3:
 		  /* Use the __builtin_powil() only if real(kind=16) is
 		     actually the C long double type.  */
-		  if (!gfc_real16_is_float128)
+		  if (!gfc_real16_is_float128 & !gfc_real16_is__Float128)
 		    fndecl = builtin_decl_explicit (BUILT_IN_POWIL);
 		  break;
 
--- libgfortran/configure.ac.jj	2022-01-11 23:45:58.230109340 +0100
+++ libgfortran/configure.ac	2022-06-22 12:12:42.160032375 +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,18 +582,92 @@ 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__Float128_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__Float128_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__Float128_libc_support" = xyes; then
+  ENABLE_LIBQUADMATH_SUPPORT=no
+else
+  ENABLE_LIBQUADMATH_SUPPORT=yes
+fi)
 enable_libquadmath_support=
 if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
   enable_libquadmath_support=no
--- libgfortran/acinclude.m4.jj	2022-01-11 23:40:33.935662686 +0100
+++ libgfortran/acinclude.m4	2022-06-22 12:35:18.200005055 +0200
@@ -264,6 +264,7 @@ __mingw_snprintf (NULL, 0, "%d\n", 1);
 dnl Check whether we have a __float128 type
 AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
   LIBQUADSPEC=
+  HAVE__FLOAT128=no
 
   if test "x$enable_libquadmath_support" != xno; then
 
@@ -355,6 +356,42 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
     fi
   fi
   else
+
+    if test "x$have__Float128_libc_support" = xyes; then
+      AC_CACHE_CHECK([whether we have a usable _Float128 type],
+		     libgfor_cv_have__Float128, [
+   GCC_TRY_COMPILE_OR_LINK([
+    _Float128 foo (_Float128 x)
+    {
+
+     _Complex _Float128 z1, z2;
+
+     z1 = x;
+     z2 = x / 7.F128;
+     z2 /= z1;
+
+     return (_Float128) z2;
+    }
+
+    _Float128 bar (_Float128 x)
+    {
+      return x * __builtin_huge_valf128 ();
+    }
+  ],[
+    foo (1.2F128);
+    bar (1.2F128);
+  ],[
+    libgfor_cv_have__Float128=yes
+  ],[
+    libgfor_cv_have__Float128=no
+])])
+
+      if test "x$libgfor_cv_have__Float128" = xyes; then
+	AC_DEFINE(HAVE__FLOAT128, 1, [Define if have a usable _Float128 type.])
+	HAVE__FLOAT128=yes
+      fi
+    fi
+
     # for --disable-quadmath
     LIBQUADLIB=
     LIBQUADLIB_DEP=
@@ -366,6 +403,7 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
   AC_SUBST(LIBQUADLIB)
   AC_SUBST(LIBQUADLIB_DEP)
   AC_SUBST(LIBQUADINCLUDE)
+  AC_SUBST(HAVE__FLOAT128)
 
   dnl We need a conditional for the Makefile
   AM_CONDITIONAL(LIBGFOR_BUILD_QUAD, [test "x$libgfor_cv_have_float128" = xyes])
--- libgfortran/Makefile.am.jj	2022-01-14 12:10:56.429770387 +0100
+++ libgfortran/Makefile.am	2022-06-22 12:49:18.835924603 +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)' '@HAVE__FLOAT128@' > $@ || 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-01-17 13:37:39.763683227 +0100
+++ libgfortran/mk-kinds-h.sh	2022-06-22 12:38:47.606246183 +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 have__float128"
   exit 1
 fi
 
@@ -11,6 +11,7 @@ fi
 possible_integer_kinds="$1"
 possible_real_kinds="$2"
 compile="$3"
+have__float128="$4"
 
 largest=""
 smallest=""
@@ -49,7 +50,7 @@ echo ""
 
 
 # Get the kind value for long double, so we may disambiguate it
-# from __float128.
+# from __float128/_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,17 @@ 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"
-	    echo "#define GFC_REAL_16_IS_FLOAT128"
+	    if [ x$have__float128 = xyes ]; then
+	      ctype="_Float128"
+	      cplxtype="_Complex _Float128"
+	      suffix="f128"
+	      echo "#define GFC_REAL_16_IS__FLOAT128"
+	    else
+	      ctype="__float128"
+	      cplxtype="_Complex float __attribute__((mode(TC)))"
+	      suffix="q"
+	      echo "#define GFC_REAL_16_IS_FLOAT128"
+	    fi
 	  else
 	    ctype="long double"
 	    cplxtype="complex long double"
--- libgfortran/kinds-override.h.jj	2022-01-11 23:45:58.233109298 +0100
+++ libgfortran/kinds-override.h	2022-06-22 12:40:05.170224299 +0200
@@ -28,6 +28,9 @@ see the files COPYING3 and COPYING.RUNTI
 #if defined(GFC_REAL_16_IS_FLOAT128) && !defined(HAVE_FLOAT128)
 # error "Where has __float128 gone?"
 #endif
+#if defined(GFC_REAL_16_IS__FLOAT128) && !defined(HAVE__FLOAT128)
+# 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
--- libgfortran/libgfortran.h.jj	2022-01-12 09:41:48.779107854 +0100
+++ libgfortran/libgfortran.h	2022-06-22 12:50:41.107837321 +0200
@@ -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_IS__FLOAT128
+#   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_IS__FLOAT128
+#   define GFC_REAL_16_QUIET_NAN __builtin_nanf128 ("")
 #  else
 #   define GFC_REAL_16_QUIET_NAN nanq ("")
 #  endif
--- libgfortran/caf/single.c.jj	2022-01-11 23:11:23.815270129 +0100
+++ libgfortran/caf/single.c	2022-06-22 12:55:11.529263502 +0200
@@ -477,13 +477,16 @@ convert_type (void *dst, int dst_type, i
 #if defined(GFC_REAL_16_IS_LONG_DOUBLE)
   typedef long double real128t;
   typedef _Complex long double complex128t;
+#elif defined(GFC_REAL_16_IS__FLOAT128)
+  typedef _Float128 real128t;
+  typedef _Complex _Float128 complex128t;
 #elif defined(HAVE_GFC_REAL_16)
   typedef _Complex float __attribute__((mode(TC))) __complex128;
   typedef __float128 real128t;
   typedef __complex128 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-02-04 14:36:56.536583916 +0100
+++ libgfortran/ieee/issignaling_fallback.h	2022-06-22 13:00:14.657257457 +0200
@@ -195,13 +195,17 @@ __issignalingl (long double x)
 #endif
 
 
-#if defined(GFC_REAL_16_IS_FLOAT128)
+#if defined(GFC_REAL_16_IS_FLOAT128) || defined(GFC_REAL_16_IS__FLOAT128)
 
-/* We have a __float128 type.  */
+/* We have a __float128 or _Float128 type.  */
 
 typedef union
 {
+#ifdef GFC_REAL_16_IS_FLOAT128
   __float128 value;
+#else
+  _Float128 value;
+#endif
   struct
   {
 #if __FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__
@@ -215,7 +219,11 @@ typedef union
 } ieee854_float128_shape_type;
 
 static inline int
+#ifdef GFC_REAL_16_IS_FLOAT128
 __issignalingf128 (__float128 x)
+#else
+__issignalingf128 (_Float128 x)
+#endif
 {
   uint64_t hxi, lxi;
   ieee854_float128_shape_type u;
@@ -241,6 +249,13 @@ __issignalingf128 (__float128 x)
 	    float: __issignalingf, \
 	    double: __issignaling, \
 	    long double: __issignalingl)(X)
+#elif defined(GFC_REAL_16_IS__FLOAT128)
+# define issignaling(X) \
+  _Generic ((X), \
+	    _Float128: __issignalingf128, \
+	    float: __issignalingf, \
+	    double: __issignaling, \
+	    long double: __issignalingl)(X)
 #else
 # define issignaling(X) \
   _Generic ((X), \
--- libgfortran/ieee/ieee_helper.c.jj	2022-02-04 14:36:56.536583916 +0100
+++ libgfortran/ieee/ieee_helper.c	2022-06-22 12:57:38.676318840 +0200
@@ -181,7 +181,7 @@ VALUEMACRO(10, l)
 #endif
 
 #ifdef HAVE_GFC_REAL_16
-# ifdef GFC_REAL_16_IS_FLOAT128
+# if defined (GFC_REAL_16_IS_FLOAT128) || defined (GFC_REAL_16_IS__FLOAT128)
 VALUEMACRO(16, f128)
 # else
 VALUEMACRO(16, l)
--- libgfortran/intrinsics/cshift0.c.jj	2022-01-11 23:11:23.856269553 +0100
+++ libgfortran/intrinsics/cshift0.c	2022-06-22 13:02:03.549818352 +0200
@@ -132,10 +132,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_REAL_10
     case GFC_DTYPE_REAL_10:
       cshift0_r10 ((gfc_array_r10 *)ret, (gfc_array_r10 *) array, shift,
@@ -162,10 +162,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_COMPLEX_10
     case GFC_DTYPE_COMPLEX_10:
       cshift0_c10 ((gfc_array_c10 *)ret, (gfc_array_c10 *) array, shift,
--- libgfortran/intrinsics/erfc_scaled.c.jj	2022-01-11 23:49:50.119853428 +0100
+++ libgfortran/intrinsics/erfc_scaled.c	2022-06-22 13:03:36.998583350 +0200
@@ -58,6 +58,14 @@ see the files COPYING3 and COPYING.RUNTI
 # define _ERFC(x) erfcq(x)
 # define _EXP(x) expq(x)
 
+#elif defined(GFC_REAL_16_IS__FLOAT128)
+
+# 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.566990228185312813205074546585730L
--- libgfortran/intrinsics/spread_generic.c.jj	2022-01-11 23:11:23.860269497 +0100
+++ libgfortran/intrinsics/spread_generic.c	2022-06-22 13:10:36.933063544 +0200
@@ -320,10 +320,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef GFC_HAVE_REAL_10
     case GFC_DTYPE_REAL_10:
       spread_r10 ((gfc_array_r10 *) ret, (gfc_array_r10 *) source,
@@ -352,10 +352,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef GFC_HAVE_COMPLEX_10
     case GFC_DTYPE_COMPLEX_10:
       spread_c10 ((gfc_array_c10 *) ret, (gfc_array_c10 *) source,
@@ -524,10 +524,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_REAL_10
     case GFC_DTYPE_REAL_10:
       spread_scalar_r10 ((gfc_array_r10 *) ret, (GFC_REAL_10 *) source,
@@ -556,10 +556,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_COMPLEX_10
     case GFC_DTYPE_COMPLEX_10:
       spread_scalar_c10 ((gfc_array_c10 *) ret, (GFC_COMPLEX_10 *) source,
--- libgfortran/intrinsics/trigd.c.jj	2022-01-11 23:49:51.737830710 +0100
+++ libgfortran/intrinsics/trigd.c	2022-06-22 13:12:47.019354915 +0200
@@ -261,6 +261,24 @@ see the files COPYING3 and COPYING.RUNTI
 
 #endif /* HAVE_FABSL && HAVE_FMODL && HAVE_COPYSIGNL */
 
+#elif defined(GFC_REAL_16_IS_LONG_DOUBLE)
+
+#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-01-11 23:11:23.859269511 +0100
+++ libgfortran/intrinsics/pack_generic.c	2022-06-22 13:05:56.324749208 +0200
@@ -307,10 +307,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_REAL_10
     case GFC_DTYPE_REAL_10:
       pack_r10 ((gfc_array_r10 *) ret, (gfc_array_r10 *) array,
@@ -339,10 +339,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_COMPLEX_10
     case GFC_DTYPE_COMPLEX_10:
       pack_c10 ((gfc_array_c10 *) ret, (gfc_array_c10 *) array,
--- libgfortran/intrinsics/unpack_generic.c.jj	2022-01-11 23:11:23.860269497 +0100
+++ libgfortran/intrinsics/unpack_generic.c	2022-06-22 13:14:18.896148161 +0200
@@ -265,10 +265,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_REAL_10
     case GFC_DTYPE_REAL_10:
       unpack1_r10 ((gfc_array_r10 *) ret, (gfc_array_r10 *) vector,
@@ -297,10 +297,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_COMPLEX_10
     case GFC_DTYPE_COMPLEX_10:
       unpack1_c10 ((gfc_array_c10 *) ret, (gfc_array_c10 *) vector,
@@ -486,10 +486,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_REAL_10
     case GFC_DTYPE_REAL_10:
       unpack0_r10 ((gfc_array_r10 *) ret, (gfc_array_r10 *) vector,
@@ -518,10 +518,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_COMPLEX_10
     case GFC_DTYPE_COMPLEX_10:
       unpack0_c10 ((gfc_array_c10 *) ret, (gfc_array_c10 *) vector,
--- libgfortran/runtime/in_pack_generic.c.jj	2022-01-11 23:11:23.883269174 +0100
+++ libgfortran/runtime/in_pack_generic.c	2022-06-22 14:14:43.239670210 +0200
@@ -82,10 +82,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # if defined (HAVE_GFC_REAL_10)
     case GFC_DTYPE_REAL_10:
       return internal_pack_r10 ((gfc_array_r10 *) source);
@@ -106,10 +106,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # if defined (HAVE_GFC_COMPLEX_10)
     case GFC_DTYPE_COMPLEX_10:
       return internal_pack_c10 ((gfc_array_c10 *) source);
--- libgfortran/runtime/in_unpack_generic.c.jj	2022-01-11 23:11:23.883269174 +0100
+++ libgfortran/runtime/in_unpack_generic.c	2022-06-22 14:15:12.485283638 +0200
@@ -89,10 +89,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # if defined(HAVE_GFC_REAL_10)
     case GFC_DTYPE_REAL_10:
       internal_unpack_r10 ((gfc_array_r10 *) d, (const GFC_REAL_10 *) s);
@@ -117,10 +117,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # if defined(HAVE_GFC_COMPLEX_10)
     case GFC_DTYPE_COMPLEX_10:
       internal_unpack_c10 ((gfc_array_c10 *) d, (const GFC_COMPLEX_10 *) s);
--- libgfortran/io/read.c.jj	2022-01-11 23:49:49.597860757 +0100
+++ libgfortran/io/read.c	2022-06-22 14:13:35.351567588 +0200
@@ -188,6 +188,10 @@ convert_real (st_parameter_dt *dtp, void
     case 16:
       *((GFC_REAL_16*) dest) = __qmath_(strtoflt128) (buffer, &endptr);
       break;
+# elif defined(GFC_REAL_16_IS__FLOAT128)
+    case 16:
+      *((GFC_REAL_16*) dest) = strtof128 (buffer, &endptr);
+      break;
 # elif defined(HAVE_STRTOLD)
     case 16:
       *((GFC_REAL_16*) dest) = gfc_strtold (buffer, &endptr);
@@ -274,6 +278,13 @@ convert_infnan (st_parameter_dt *dtp, vo
     case 16:
       *((GFC_REAL_16*) dest) = __qmath_(strtoflt128) (buffer, NULL);
       break;
+# elif defined(GFC_REAL_16_IS__FLOAT128)
+    case 16:
+      if (is_inf)
+	*((GFC_REAL_16*) dest) = plus ? __builtin_inff128 () : -__builtin_inff128 ();
+      else
+	*((GFC_REAL_16*) dest) = plus ? __builtin_nanf128 ("") : -__builtin_nanf128 ("");
+      break;
 # else
     case 16:
       if (is_inf)
--- libgfortran/io/transfer128.c.jj	2022-01-11 23:49:48.624874419 +0100
+++ libgfortran/io/transfer128.c	2022-06-22 13:20:31.657252114 +0200
@@ -28,7 +28,8 @@ see the files COPYING3 and COPYING.RUNTI
 #include "io.h"
 
 
-#if defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_GFC_REAL_17)
+#if defined(GFC_REAL_16_IS_FLOAT128) || defined(GFC_REAL_16_IS__FLOAT128) \
+    || defined(HAVE_GFC_REAL_17)
 
 /* The prototypes for the called procedures in transfer.c.  */
 
@@ -65,9 +66,11 @@ 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)
+# ifndef GFC_REAL_16_IS__FLOAT128
+#  if !defined(HAVE_GFC_REAL_17) || !defined(POWER_IEEE128)
 static void __attribute__((used)) *tmp1 = strtoflt128;
 static void __attribute__((used)) *tmp2 = quadmath_snprintf;
+#  endif
 # endif
 
 void
--- libgfortran/io/write_float.def.jj	2022-01-11 23:49:49.130867314 +0100
+++ libgfortran/io/write_float.def	2022-06-22 19:30:15.403155935 +0200
@@ -837,6 +837,42 @@ snprintf (buffer, size, "%+-#.*e", (prec
 #define DTOA2L(prec,val) \
 snprintf (buffer, size, "%+-#.*Le", (prec), (val))
 
+#ifdef GFC_REAL_16_IS__FLOAT128
+/* 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;
+}
+# define DTOA2F128(prec,val) \
+gfor_strfromf128 (buffer, size, 'e', (prec), (val))
+#endif
 
 #if defined(HAVE_GFC_REAL_17)
 # if defined(POWER_IEEE128)
@@ -860,6 +896,10 @@ snprintf (buffer, size, "%+-#.*f", (prec
 #define FDTOA2L(prec,val) \
 snprintf (buffer, size, "%+-#.*Lf", (prec), (val))
 
+#ifdef GFC_REAL_16_IS__FLOAT128
+# define FDTOA2F128(prec,val) \
+gfor_strfromf128 (buffer, size, 'f', (prec), (val))
+#endif
 
 #if defined(HAVE_GFC_REAL_17)
 # if defined(POWER_IEEE128)
@@ -939,6 +979,8 @@ determine_en_precision (st_parameter_dt
     case 16:
 # ifdef GFC_REAL_16_IS_FLOAT128
       EN_PREC(16,Q)
+# elif defined(GFC_REAL_16_IS__FLOAT128)
+      EN_PREC(16,F128)
 # else
       EN_PREC(16,L)
 # endif
@@ -1147,6 +1189,8 @@ get_float_string (st_parameter_dt *dtp,
     case 16:
 # ifdef GFC_REAL_16_IS_FLOAT128
       FORMAT_FLOAT(16,Q)
+# elif defined(GFC_REAL_16_IS__FLOAT128)
+      FORMAT_FLOAT(16,F128)
 # else
       FORMAT_FLOAT(16,L)
 # endif
--- libgfortran/m4/mtype.m4.jj	2022-01-11 23:35:52.584615001 +0100
+++ libgfortran/m4/mtype.m4	2022-06-22 13:52:56.987824469 +0200
@@ -9,7 +9,7 @@ define(hasmathfunc,dnl
 `ifelse(kind,4,`defined (HAVE_'upcase($1)`F)',dnl
 ifelse(kind,8,`defined (HAVE_'upcase($1)`)',dnl
 ifelse(kind,10,`defined (HAVE_'upcase($1)`L)',dnl
-ifelse(kind,16,`(defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_'upcase($1)`L))',dnl
+ifelse(kind,16,`(defined(GFC_REAL_16_IS_FLOAT128) || defined(GFC_REAL_16_IS__FLOAT128) || defined(HAVE_'upcase($1)`L))',dnl
 ifelse(kind,17,`1 /* FIXME: figure this out later.  */',dnl
 `error out')))))')
 define(mathfunc_macro,`ifelse(kind,17,dnl
@@ -21,6 +21,8 @@ define(mathfunc_macro,`ifelse(kind,17,dn
 `ifelse(kind,16,dnl
 `#if defined(GFC_REAL_16_IS_FLOAT128)
 #define MATHFUNC(funcname) funcname ## q
+#elif defined(GFC_REAL_16_IS__FLOAT128)
+#define MATHFUNC(funcname) funcname ## f128
 #else
 #define MATHFUNC(funcname) funcname ## l
 #endif',dnl
--- libgfortran/config.h.in.jj	2022-01-11 23:45:58.226109396 +0100
+++ libgfortran/config.h.in	2022-06-22 12:20:10.153059959 +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
 
@@ -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,21 +1059,33 @@
 /* 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
 
+/* Define if have a usable _Float128 type. */
+#undef HAVE__FLOAT128
+
 /* Define to 1 if you have the `__acoshieee128' function. */
 #undef HAVE___ACOSHIEEE128
 
--- libgfortran/configure.jj	2022-01-11 23:45:58.230109340 +0100
+++ libgfortran/configure	2022-06-22 12:42:30.272312619 +0200
@@ -647,6 +647,7 @@ IEEE_SUPPORT_TRUE
 FPU_HOST_HEADER
 LIBGFOR_BUILD_QUAD_FALSE
 LIBGFOR_BUILD_QUAD_TRUE
+HAVE__FLOAT128
 LIBQUADINCLUDE
 LIBQUADLIB_DEP
 LIBQUADLIB
@@ -2673,6 +2674,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 +12769,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 12772 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12872,7 +12875,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 12878 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -17184,6 +17187,10 @@ done
 
 
 
+
+
+
+
 fi
 
 # Check strerror_r, cannot be above as versions with two and three arguments exist
@@ -26997,6 +27004,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,13 +30084,23 @@ $as_echo "#define HAVE_MINGW_SNPRINTF 1"
   fi
 
 
+have__Float128_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__Float128_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__Float128_libc_support" = xyes; then
+  ENABLE_LIBQUADMATH_SUPPORT=no
+else
   ENABLE_LIBQUADMATH_SUPPORT=yes
 fi
+fi
 
 enable_libquadmath_support=
 if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
@@ -27115,6 +30110,7 @@ fi
 # Check whether we have a __float128 type, depends on enable_libquadmath_support
 
   LIBQUADSPEC=
+  HAVE__FLOAT128=no
 
   if test "x$enable_libquadmath_support" != xno; then
 
@@ -27317,6 +30313,115 @@ $as_echo "$libgfor_cv_have_as_needed" >&
     fi
   fi
   else
+
+    if test "x$have__Float128_libc_support" = xyes; 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; }
+if ${libgfor_cv_have__Float128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+   if test x$gcc_no_link = xyes; then
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+    _Float128 foo (_Float128 x)
+    {
+
+     _Complex _Float128 z1, z2;
+
+     z1 = x;
+     z2 = x / 7.F128;
+     z2 /= z1;
+
+     return (_Float128) z2;
+    }
+
+    _Float128 bar (_Float128 x)
+    {
+      return x * __builtin_huge_valf128 ();
+    }
+
+int
+main ()
+{
+
+    foo (1.2F128);
+    bar (1.2F128);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+    libgfor_cv_have__Float128=yes
+
+else
+
+    libgfor_cv_have__Float128=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+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.  */
+
+    _Float128 foo (_Float128 x)
+    {
+
+     _Complex _Float128 z1, z2;
+
+     z1 = x;
+     z2 = x / 7.F128;
+     z2 /= z1;
+
+     return (_Float128) z2;
+    }
+
+    _Float128 bar (_Float128 x)
+    {
+      return x * __builtin_huge_valf128 ();
+    }
+
+int
+main ()
+{
+
+    foo (1.2F128);
+    bar (1.2F128);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+    libgfor_cv_have__Float128=yes
+
+else
+
+    libgfor_cv_have__Float128=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have__Float128" >&5
+$as_echo "$libgfor_cv_have__Float128" >&6; }
+
+      if test "x$libgfor_cv_have__Float128" = xyes; then
+
+$as_echo "#define HAVE__FLOAT128 1" >>confdefs.h
+
+	HAVE__FLOAT128=yes
+      fi
+    fi
+
     # for --disable-quadmath
     LIBQUADLIB=
     LIBQUADLIB_DEP=
@@ -27325,6 +30430,7 @@ $as_echo "$libgfor_cv_have_as_needed" >&
 
 
 
+
 
 
 
--- libgfortran/Makefile.in.jj	2022-01-14 21:24:48.371295701 +0100
+++ libgfortran/Makefile.in	2022-06-22 12:49:36.318693557 +0200
@@ -618,6 +618,7 @@ FCFLAGS = @FCFLAGS@
 FGREP = @FGREP@
 FPU_HOST_HEADER = @FPU_HOST_HEADER@
 GREP = @GREP@
+HAVE__FLOAT128 = @HAVE__FLOAT128@
 HWCAP_LDFLAGS = @HWCAP_LDFLAGS@
 IEEE_FLAGS = @IEEE_FLAGS@
 IEEE_SUPPORT = @IEEE_SUPPORT@
@@ -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)' '@HAVE__FLOAT128@' > $@ || rm $@
 
 kinds.inc: kinds.h $(srcdir)/kinds-override.h
 	cat kinds.h $(srcdir)/kinds-override.h | grep '^#' | grep -v include > $@
--- libgfortran/generated/norm2_r16.c.jj	2022-01-11 23:11:23.847269679 +0100
+++ libgfortran/generated/norm2_r16.c	2022-06-22 14:03:09.399792484 +0200
@@ -27,10 +27,12 @@ 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 (HAVE_GFC_REAL_16) && defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(GFC_REAL_16_IS__FLOAT128) || defined(HAVE_SQRTL)) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(GFC_REAL_16_IS__FLOAT128) || defined(HAVE_FABSL))
 
 #if defined(GFC_REAL_16_IS_FLOAT128)
 #define MATHFUNC(funcname) funcname ## q
+#elif defined(GFC_REAL_16_IS__FLOAT128)
+#define MATHFUNC(funcname) funcname ## f128
 #else
 #define MATHFUNC(funcname) funcname ## l
 #endif
--- libgfortran/generated/bessel_r16.c.jj	2022-01-11 23:11:23.820270059 +0100
+++ libgfortran/generated/bessel_r16.c	2022-06-22 14:02:54.046994166 +0200
@@ -30,6 +30,8 @@ see the files COPYING3 and COPYING.RUNTI
 
 #if defined(GFC_REAL_16_IS_FLOAT128)
 #define MATHFUNC(funcname) funcname ## q
+#elif defined(GFC_REAL_16_IS__FLOAT128)
+#define MATHFUNC(funcname) funcname ## f128
 #else
 #define MATHFUNC(funcname) funcname ## l
 #endif
@@ -38,7 +40,7 @@ see the files COPYING3 and COPYING.RUNTI
 
 
 
-#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_JNL))
+#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(GFC_REAL_16_IS__FLOAT128) || defined(HAVE_JNL))
 extern void bessel_jn_r16 (gfc_array_r16 * const restrict ret, int n1,
 				     int n2, GFC_REAL_16 x);
 export_proto(bessel_jn_r16);
@@ -104,7 +106,7 @@ bessel_jn_r16 (gfc_array_r16 * const res
 
 #endif
 
-#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_YNL))
+#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(GFC_REAL_16_IS__FLOAT128) || defined(HAVE_YNL))
 extern void bessel_yn_r16 (gfc_array_r16 * const restrict ret,
 				     int n1, int n2, GFC_REAL_16 x);
 export_proto(bessel_yn_r16);


	Jakub


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

* Re: [PATCH] fortran, libgfortran: Avoid using libquadmath for glibc 2.26+
  2022-06-23 12:04 [PATCH] fortran, libgfortran: Avoid using libquadmath for glibc 2.26+ Jakub Jelinek
@ 2022-06-23 20:49 ` Harald Anlauf
  2022-06-23 21:17   ` Jakub Jelinek
  0 siblings, 1 reply; 13+ messages in thread
From: Harald Anlauf @ 2022-06-23 20:49 UTC (permalink / raw)
  To: Jakub Jelinek, gcc-patches, fortran; +Cc: Joseph S. Myers

Hi Jakub,

Am 23.06.22 um 14:04 schrieb Jakub Jelinek via Gcc-patches:
> Hi!
>
> As mentioned by Joseph in PR105101, glibc 2.26 or later has on x86
> (both -m32/-m64), powerpc64le, ia64 and mips support for
> *f128 math/complex APIs plus strtof128 and strfromf128, and these APIs allow
> us to avoid libquadmath for Fortran purposes on these architectures,
> replace *q math/complex APIs, strtof128 instead of strtoflt128 and,
> while strfromf128 unfortunately isn't a perfect replacement to
> quadmath_snprintf, it can be made to work.
>
> The advantage of this is that when configured against such glibcs
> (2.26 is now almost 5 years old), we can avoid linking against an extra shared
> library and the math support in glibc is maintained better than libquadmath.
>
> We need both a compiler change (so that for glibc 2.26+ it uses *f128 APIs
> instead of *q) and library change.

this is quite an important change in the gfortran ABI, as it will
require recompilation of (library) code using quad precision.
Not that I am particularly affected, but this should be highlighted
for users.

Am I right in assuming that this also effectively fixes PR46539?
(Add -static-libquadmath).

> So far lightly tested on x86_64-linux with glibc 2.35 (removed libgfortran
> dirs, rebuilt stage3 f951 and make all-target-libgfortran + make
> check-gfortran), ok for trunk if it passes full testing?

I did not look into all details, but noticed the following:

> --- gcc/fortran/trans-intrinsic.cc.jj	2022-05-16 11:14:57.587427707 +0200
> +++ gcc/fortran/trans-intrinsic.cc	2022-06-23 11:42:03.355899271 +0200
> @@ -155,7 +155,7 @@ builtin_decl_for_precision (enum built_i
>     else if (precision == TYPE_PRECISION (double_type_node))
>       i = m->double_built_in;
>     else if (precision == TYPE_PRECISION (long_double_type_node)
> -	   && (!gfc_real16_is_float128
> +	   && ((!gfc_real16_is_float128 & !gfc_real16_is__Float128)

Shouldn't this be && instead of & ?

>   	       || long_double_type_node != gfc_float128_type_node))
>       i = m->long_double_built_in;
>     else if (precision == TYPE_PRECISION (gfc_float128_type_node))
> @@ -175,7 +175,7 @@ gfc_builtin_decl_for_float_kind (enum bu
>   {
>     int i = gfc_validate_kind (BT_REAL, kind, false);
>
> -  if (gfc_real_kinds[i].c_float128)
> +  if (gfc_real_kinds[i].c_float128 || gfc_real_kinds[i].c__Float128)
>       {
>         /* For _Float128, the story is a bit different, because we return
>   	 a decl to a library function rather than a built-in.  */
> @@ -688,7 +688,7 @@ gfc_build_intrinsic_lib_fndecls (void)
>     gfc_intrinsic_map_t *m;
>     tree quad_decls[END_BUILTINS + 1];
>
> -  if (gfc_real16_is_float128)
> +  if (gfc_real16_is_float128 || gfc_real16_is__Float128)
>     {
>       /* If we have soft-float types, we create the decls for their
>          C99-like library functions.  For now, we only handle _Float128
> @@ -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_is__Float128			\
> +			     ? 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_is__Float128
> +			     ? "sqrtf128" : "sqrtq", func_1, true);
>     }
>
>     /* Add GCC builtin functions.  */
> @@ -775,7 +779,7 @@ gfc_build_intrinsic_lib_fndecls (void)
>   	m->complex10_decl
>   	  = builtin_decl_explicit (m->complex_long_double_built_in);
>
> -      if (!gfc_real16_is_float128)
> +      if (!gfc_real16_is_float128 && !gfc_real16_is__Float128)
>   	{
>   	  if (m->long_double_built_in != END_BUILTINS)
>   	    m->real16_decl = builtin_decl_explicit (m->long_double_built_in);
> @@ -876,6 +880,9 @@ gfc_get_intrinsic_lib_fndecl (gfc_intrin
>         else if (gfc_real_kinds[n].c_float128)
>   	snprintf (name, sizeof (name), "%s%s%s",
>   		  ts->type == BT_COMPLEX ? "c" : "", m->name, "q");
> +      else if (gfc_real_kinds[n].c__Float128)
> +	snprintf (name, sizeof (name), "%s%s%s",
> +		  ts->type == BT_COMPLEX ? "c" : "", m->name, "f128");
>         else
>   	gcc_unreachable ();
>       }
> --- gcc/fortran/trans-expr.cc.jj	2022-04-23 10:10:51.146097072 +0200
> +++ gcc/fortran/trans-expr.cc	2022-06-23 11:49:31.191964727 +0200
> @@ -3582,7 +3582,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr
>   		case 3:
>   		  /* Use the __builtin_powil() only if real(kind=16) is
>   		     actually the C long double type.  */
> -		  if (!gfc_real16_is_float128)
> +		  if (!gfc_real16_is_float128 & !gfc_real16_is__Float128)

Likewise.

>   		    fndecl = builtin_decl_explicit (BUILT_IN_POWIL);
>   		  break;
>

You may wish to wait for further comments.

Thanks for the patch!

Harald

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

* Re: [PATCH] fortran, libgfortran: Avoid using libquadmath for glibc 2.26+
  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
  0 siblings, 1 reply; 13+ messages in thread
From: Jakub Jelinek @ 2022-06-23 21:17 UTC (permalink / raw)
  To: Harald Anlauf; +Cc: gcc-patches, fortran, Joseph S. Myers

On Thu, Jun 23, 2022 at 10:49:55PM +0200, Harald Anlauf wrote:
> > We need both a compiler change (so that for glibc 2.26+ it uses *f128 APIs
> > instead of *q) and library change.
> 
> this is quite an important change in the gfortran ABI, as it will
> require recompilation of (library) code using quad precision.
> Not that I am particularly affected, but this should be highlighted
> for users.

We currently use
%rename lib liborig
*lib: %{static-libgfortran:--as-needed} -lquadmath %{static-libgfortran:--no-as-needed} -lm %(libgcc) %(liborig)
in libgfortran.spec (on targets where we do configure in libquadmath).
So, I believe the patch as is is an ABI change for *.o files if they use
real(kind=16) math functions (one needs to recompile them), but not
for linked shared libraries or executables, because the above aranges
for them to be linked with -lquadmath or for -static-libgfortran with
--as-needed -lquadmath --no-as-needed.  The former adds libquadmath.so.0
automatically to anything gfortran links, the latter to anything that
actually needs it (i.e. has undefined math/complex *q symbols).

Note, libgfortran.so.5 itself is ABI compatible, just no longer has
DT_NEEDED libquadmath.so.0 and uses the *f128 APIs + str{to,from}f128
instead of *q APIs + strtoflt128 and quadmath_snprintf.

Now, what we could do if we'd want to also preserve *.o file compatibility,
would be for gcc configured on glibc 2.26+ change libgfortran.spec to
*lib: --as-needed -lquadmath --no-as-needed -lm %(libgcc) %(liborig)
so that we even without -static-libgfortran link in libquadmath.so.0
only if it is needed.  So, if there will be any gcc <= 12 compiled
*.o files or *.o files compiled by gcc 13 if it was configured against
glibc 2.25 or older, we'd link -lquadmath in, but if there are just
*.o files referencing *f128 symbols, we wouldn't.

> Am I right in assuming that this also effectively fixes PR46539?
> (Add -static-libquadmath).

That was one of the intents of the patch.
But sure, it doesn't introduce -static-libquadmath, nor arranges for
-static-libgfortran to link libquadmath statically, just in some cases
(gcc configured on glibc 2.26 or later) and when everything that calls
real(kind=16) math functions has been recompiled arranges for libquadmath
not to be used at all.

> > --- gcc/fortran/trans-intrinsic.cc.jj	2022-05-16 11:14:57.587427707 +0200
> > +++ gcc/fortran/trans-intrinsic.cc	2022-06-23 11:42:03.355899271 +0200
> > @@ -155,7 +155,7 @@ builtin_decl_for_precision (enum built_i
> >     else if (precision == TYPE_PRECISION (double_type_node))
> >       i = m->double_built_in;
> >     else if (precision == TYPE_PRECISION (long_double_type_node)
> > -	   && (!gfc_real16_is_float128
> > +	   && ((!gfc_real16_is_float128 & !gfc_real16_is__Float128)
> 
> Shouldn't this be && instead of & ?

You're right, will fix.

	Jakub


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

* [PATCH] fortran, libgfortran, v2: Avoid using libquadmath for glibc 2.26+
  2022-06-23 21:17   ` Jakub Jelinek
@ 2022-06-24 10:29     ` Jakub Jelinek
  2022-06-24 21:06       ` Harald Anlauf
  2022-06-26 18:45       ` Mikael Morin
  0 siblings, 2 replies; 13+ messages in thread
From: Jakub Jelinek @ 2022-06-24 10:29 UTC (permalink / raw)
  To: Harald Anlauf, gcc-patches, Joseph S. Myers, fortran

On Thu, Jun 23, 2022 at 11:17:50PM +0200, Jakub Jelinek via Gcc-patches wrote:
> We currently use
> %rename lib liborig
> *lib: %{static-libgfortran:--as-needed} -lquadmath %{static-libgfortran:--no-as-needed} -lm %(libgcc) %(liborig)
> in libgfortran.spec (on targets where we do configure in libquadmath).
> So, I believe the patch as is is an ABI change for *.o files if they use
> real(kind=16) math functions (one needs to recompile them), but not
> for linked shared libraries or executables, because the above aranges
> for them to be linked with -lquadmath or for -static-libgfortran with
> --as-needed -lquadmath --no-as-needed.  The former adds libquadmath.so.0
> automatically to anything gfortran links, the latter to anything that
> actually needs it (i.e. has undefined math/complex *q symbols).
> 
> Note, libgfortran.so.5 itself is ABI compatible, just no longer has
> DT_NEEDED libquadmath.so.0 and uses the *f128 APIs + str{to,from}f128
> instead of *q APIs + strtoflt128 and quadmath_snprintf.
> 
> Now, what we could do if we'd want to also preserve *.o file compatibility,
> would be for gcc configured on glibc 2.26+ change libgfortran.spec to
> *lib: --as-needed -lquadmath --no-as-needed -lm %(libgcc) %(liborig)
> so that we even without -static-libgfortran link in libquadmath.so.0
> only if it is needed.  So, if there will be any gcc <= 12 compiled
> *.o files or *.o files compiled by gcc 13 if it was configured against
> glibc 2.25 or older, we'd link -lquadmath in, but if there are just
> *.o files referencing *f128 symbols, we wouldn't.
> 
> > Am I right in assuming that this also effectively fixes PR46539?
> > (Add -static-libquadmath).
> 
> That was one of the intents of the patch.
> But sure, it doesn't introduce -static-libquadmath, nor arranges for
> -static-libgfortran to link libquadmath statically, just in some cases
> (gcc configured on glibc 2.26 or later) and when everything that calls
> real(kind=16) math functions has been recompiled arranges for libquadmath
> not to be used at all.

Here is an updated patch that does that.

> > > --- gcc/fortran/trans-intrinsic.cc.jj	2022-05-16 11:14:57.587427707 +0200
> > > +++ gcc/fortran/trans-intrinsic.cc	2022-06-23 11:42:03.355899271 +0200
> > > @@ -155,7 +155,7 @@ builtin_decl_for_precision (enum built_i
> > >     else if (precision == TYPE_PRECISION (double_type_node))
> > >       i = m->double_built_in;
> > >     else if (precision == TYPE_PRECISION (long_double_type_node)
> > > -	   && (!gfc_real16_is_float128
> > > +	   && ((!gfc_real16_is_float128 & !gfc_real16_is__Float128)
> > 
> > Shouldn't this be && instead of & ?
> 
> You're right, will fix.

And this too.

So I believe it should now be fully ABI compatible.

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

gcc/fortran/
	* gfortran.h (gfc_real_inf0: Add c__Float128 bitfield.
	* trans-types.h (gfc_real16_is_float128): Update comment.
	(gfc_real16_is__Float128): Declare.
	* trans-types.cc (gfc_real16_is__Float128): Define.
	(gfc_init_kinds): When building powerpc64le-linux libgfortran
	on glibc 2.26 to 2.31, set gfc_real16_is__Float128 and
	c__Float128 instead of gfc_real16_is_float128 and c_float128.
	(gfc_build_real_type): Don't set c_long_double if c__Float128.
	Set gfc_real16_is__Float128 and c__Float128 instead of
	gfc_real16_is_float128 and c_float128 on glibc 2.26 or later.
	(gfc_init_types): Handle c__Float128 like c_float128.
	* trans-intrinsic.cc (builtin_decl_for_precision): Handle
	gfc_real16_is__Float128 like gfc_real16_is_float128.
	(gfc_builtin_decl_for_float_kind): Handle c__Float128 like c_float128.
	(gfc_build_intrinsic_lib_fndecls): For gfc_real16_is__Float128
	use *f128 APIs rather than *q APIs used for gfc_real16_is_float128.
	(gfc_get_intrinsic_lib_fndecl): Likewise.
	* trans-expr.cc (gfc_conv_power_op): Handle gfc_real16_is__Float128
	like gfc_real16_is_float128.
libgfortran/
	* configure.ac: Check for strtof128 and strfromf128.
	Check for math and complex *f128 functions.  Set
	have__Float128_libc_support to yes if *f128 support is around, for
	--enable-libquadmath-support default to "default" rather than yes if
	have__Float128_libc_support is yes.
	* acinclude.m4 (LIBGFOR_CHECK_FLOAT128): If libquadmath support
	is defaulted and have__Float128_libc_support is yes, test
	_Float128/_Complex _Float128 support and define and subst
	HAVE__FLOAT128.  Remove unused LIBGFOR_BUILD_QUAD conditional.
	* Makefile.am (kinds.h): Pass @HAVE__FLOAT128@ as an extra
	mk-kinds-h.sh argument.
	* mk-kinds-h.sh: Accept 4th have__float128 argument, if it is yes,
	use _Float128/_Complex _Float128 types insted of __float128 and
	_Complex float __attribute__((mode(TC))), use f128 suffix instead
	of q and define GFC_REAL_16_IS__FLOAT128 instead of
	GFC_REAL_16_IS_FLOAT128.
	* kinds-override.h: Add consistency check for GFC_REAL_16_IS__FLOAT128.
	* libgfortran.h (GFC_REAL_16_INFINITY, GFC_REAL_16_QUIET_NAN): Define
	for GFC_REAL_16_IS__FLOAT128.
	* caf/single.c (convert_type): Use _Float128/_Complex _Float128 for
	GFC_REAL_16_IS__FLOAT128.  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 (__issignalingf128): Handle
	GFC_REAL_16_IS__FLOAT128.
	(issignaling): Likewise.
	* ieee/ieee_helper.c: Handle GFC_REAL_16_IS__FLOAT128 like
	GFC_REAL_16_IS_FLOAT128.
	* intrinsics/cshift0.c (cshift0): Likewise.  Fix a comment typo,
	logn double -> long double.
	* intrinsics/erfc_scaled.c (_THRESH, _M_2_SQRTPI, _INF, _ERFC, _EXP):
	Handle GFC_REAL_16_IS_FLOAT128.
	* intrinsics/spread_generic.c (spread, spread_scalar): Handle
	GFC_REAL_16_IS__FLOAT128 like GFC_REAL_16_IS_FLOAT128.  Fix a comment
	typo, logn double -> long double.
	* intrinsics/trigd.c (GFC_REAL_16_IS_LONG_DOUBLE): Handle
	GFC_REAL_16_IS_LONG_DOUBLE.
	* intrinsics/pack_generic.c (pack): Handle GFC_REAL_16_IS__FLOAT128
	like GFC_REAL_16_IS_FLOAT128.  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_IS__FLOAT128.
	* io/transfer128.c: Enable also for GFC_REAL_16_IS__FLOAT128,
	but don't define tmp1 and tmp2 vars in that case.
	* io/write_float.def (gfor_strfromf128): New function.
	(DTOA2F128, FDTOA2F128): Define.
	(determine_en_precision, get_float_string): Handle
	GFC_REAL_16_IS__FLOAT128.
	* m4/mtype.m4: Likewise.
	* config.h.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
	* generated/norm2_r16.c: Regenerated.
	* generated/bessel_r16.c: Regenerated.

--- gcc/fortran/gfortran.h.jj	2022-05-30 14:07:12.277196546 +0200
+++ gcc/fortran/gfortran.h	2022-06-23 11:34:55.550568362 +0200
@@ -2665,6 +2665,7 @@ typedef struct
   unsigned int c_double : 1;
   unsigned int c_long_double : 1;
   unsigned int c_float128 : 1;
+  unsigned int c__Float128 : 1;
 }
 gfc_real_info;
 
--- gcc/fortran/trans-types.h.jj	2022-01-18 11:58:59.579982099 +0100
+++ gcc/fortran/trans-types.h	2022-06-23 11:35:04.446450491 +0200
@@ -55,9 +55,12 @@ extern GTY(()) tree gfc_charlen_type_nod
 
 /* The following flags give us information on the correspondence of
    real (and complex) kinds with C floating-point types long double
-   and _Float128.  */
+   and _Float128 and using libquadmath APIs.  */
 extern bool gfc_real16_is_float128;
 
+/* Similarly, but using glibc *f128 APIs.  */
+extern bool gfc_real16_is__Float128;
+
 enum gfc_packed {
   PACKED_NO = 0,
   PACKED_PARTIAL,
--- gcc/fortran/trans-types.cc.jj	2022-05-16 11:14:57.587427707 +0200
+++ gcc/fortran/trans-types.cc	2022-06-23 11:55:15.194406144 +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_is__Float128 = false;
 
 static GTY(()) tree gfc_desc_dim_type;
 static GTY(()) tree gfc_max_array_element_size;
@@ -522,8 +523,16 @@ gfc_init_kinds (void)
 		&& (TARGET_GLIBC_MAJOR < 2
 		    || (TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR < 32)))
 	      {
-		gfc_real16_is_float128 = true;
-		gfc_real_kinds[i].c_float128 = 1;
+		if (TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR >= 26)
+		  {
+		    gfc_real16_is__Float128 = true;
+		    gfc_real_kinds[i].c__Float128 = 1;
+		  }
+		else
+		  {
+		    gfc_real16_is_float128 = true;
+		    gfc_real_kinds[i].c_float128 = 1;
+		  }
 	      }
 	  }
     }
@@ -871,13 +880,24 @@ gfc_build_real_type (gfc_real_info *info
     info->c_float = 1;
   if (mode_precision == DOUBLE_TYPE_SIZE)
     info->c_double = 1;
-  if (mode_precision == LONG_DOUBLE_TYPE_SIZE && !info->c_float128)
+  if (mode_precision == LONG_DOUBLE_TYPE_SIZE
+      && !info->c_float128
+      && !info->c__Float128)
     info->c_long_double = 1;
   if (mode_precision != LONG_DOUBLE_TYPE_SIZE && mode_precision == 128)
     {
       /* 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->c__Float128 = 1;
+	  gfc_real16_is__Float128 = true;
+	}
+      else
+	{
+	  info->c_float128 = 1;
+	  gfc_real16_is_float128 = true;
+	}
     }
 
   if (TYPE_PRECISION (float_type_node) == mode_precision)
@@ -981,7 +1001,8 @@ gfc_init_types (void)
 		gfc_real_kinds[index].kind);
       PUSH_TYPE (name_buf, type);
 
-      if (gfc_real_kinds[index].c_float128)
+      if (gfc_real_kinds[index].c_float128
+	  || gfc_real_kinds[index].c__Float128)
 	gfc_float128_type_node = type;
 
       type = gfc_build_complex_type (type);
@@ -990,7 +1011,8 @@ gfc_init_types (void)
 		gfc_real_kinds[index].kind);
       PUSH_TYPE (name_buf, type);
 
-      if (gfc_real_kinds[index].c_float128)
+      if (gfc_real_kinds[index].c_float128
+	  || gfc_real_kinds[index].c__Float128)
 	gfc_complex_float128_type_node = type;
     }
 
--- gcc/fortran/trans-intrinsic.cc.jj	2022-05-16 11:14:57.587427707 +0200
+++ gcc/fortran/trans-intrinsic.cc	2022-06-24 09:38:47.995447235 +0200
@@ -155,7 +155,7 @@ builtin_decl_for_precision (enum built_i
   else if (precision == TYPE_PRECISION (double_type_node))
     i = m->double_built_in;
   else if (precision == TYPE_PRECISION (long_double_type_node)
-	   && (!gfc_real16_is_float128
+	   && ((!gfc_real16_is_float128 && !gfc_real16_is__Float128)
 	       || long_double_type_node != gfc_float128_type_node))
     i = m->long_double_built_in;
   else if (precision == TYPE_PRECISION (gfc_float128_type_node))
@@ -175,7 +175,7 @@ gfc_builtin_decl_for_float_kind (enum bu
 {
   int i = gfc_validate_kind (BT_REAL, kind, false);
 
-  if (gfc_real_kinds[i].c_float128)
+  if (gfc_real_kinds[i].c_float128 || gfc_real_kinds[i].c__Float128)
     {
       /* For _Float128, the story is a bit different, because we return
 	 a decl to a library function rather than a built-in.  */
@@ -688,7 +688,7 @@ gfc_build_intrinsic_lib_fndecls (void)
   gfc_intrinsic_map_t *m;
   tree quad_decls[END_BUILTINS + 1];
 
-  if (gfc_real16_is_float128)
+  if (gfc_real16_is_float128 || gfc_real16_is__Float128)
   {
     /* If we have soft-float types, we create the decls for their
        C99-like library functions.  For now, we only handle _Float128
@@ -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_is__Float128			\
+			     ? 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_is__Float128
+			     ? "sqrtf128" : "sqrtq", func_1, true);
   }
 
   /* Add GCC builtin functions.  */
@@ -775,7 +779,7 @@ gfc_build_intrinsic_lib_fndecls (void)
 	m->complex10_decl
 	  = builtin_decl_explicit (m->complex_long_double_built_in);
 
-      if (!gfc_real16_is_float128)
+      if (!gfc_real16_is_float128 && !gfc_real16_is__Float128)
 	{
 	  if (m->long_double_built_in != END_BUILTINS)
 	    m->real16_decl = builtin_decl_explicit (m->long_double_built_in);
@@ -876,6 +880,9 @@ gfc_get_intrinsic_lib_fndecl (gfc_intrin
       else if (gfc_real_kinds[n].c_float128)
 	snprintf (name, sizeof (name), "%s%s%s",
 		  ts->type == BT_COMPLEX ? "c" : "", m->name, "q");
+      else if (gfc_real_kinds[n].c__Float128)
+	snprintf (name, sizeof (name), "%s%s%s",
+		  ts->type == BT_COMPLEX ? "c" : "", m->name, "f128");
       else
 	gcc_unreachable ();
     }
--- gcc/fortran/trans-expr.cc.jj	2022-04-23 10:10:51.146097072 +0200
+++ gcc/fortran/trans-expr.cc	2022-06-24 09:38:48.420441630 +0200
@@ -3582,7 +3582,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr
 		case 3:
 		  /* Use the __builtin_powil() only if real(kind=16) is
 		     actually the C long double type.  */
-		  if (!gfc_real16_is_float128)
+		  if (!gfc_real16_is_float128 && !gfc_real16_is__Float128)
 		    fndecl = builtin_decl_explicit (BUILT_IN_POWIL);
 		  break;
 
--- libgfortran/configure.ac.jj	2022-01-11 23:45:58.230109340 +0100
+++ libgfortran/configure.ac	2022-06-24 09:59:41.594958673 +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__Float128_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__Float128_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__Float128_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
+# and have__Float128_libc_support.
 LIBGFOR_CHECK_FLOAT128
 
 # Check for GNU libc feenableexcept
--- libgfortran/acinclude.m4.jj	2022-01-11 23:40:33.935662686 +0100
+++ libgfortran/acinclude.m4	2022-06-24 11:57:03.555068111 +0200
@@ -264,6 +264,10 @@ __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=
+  HAVE__FLOAT128=no
 
   if test "x$enable_libquadmath_support" != xno; then
 
@@ -297,8 +301,47 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
     libgfor_cv_have_float128=no
 ])])
 
+    if test "x$have__Float128_libc_support$enable_libquadmath_support" = xyesdefault; then
+      AC_CACHE_CHECK([whether we have a usable _Float128 type],
+		     libgfor_cv_have__Float128, [
+   GCC_TRY_COMPILE_OR_LINK([
+    _Float128 foo (_Float128 x)
+    {
+
+     _Complex _Float128 z1, z2;
+
+     z1 = x;
+     z2 = x / 7.F128;
+     z2 /= z1;
+
+     return (_Float128) z2;
+    }
+
+    _Float128 bar (_Float128 x)
+    {
+      return x * __builtin_huge_valf128 ();
+    }
+  ],[
+    foo (1.2F128);
+    bar (1.2F128);
+  ],[
+    libgfor_cv_have__Float128=yes
+  ],[
+    libgfor_cv_have__Float128=no
+])])
+
+      if test "x$libgfor_cv_have__Float128" = xyes; then
+	HAVE__FLOAT128=yes
+      fi
+    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$HAVE__FLOAT128" = xyes; then
+      AC_DEFINE(HAVE__FLOAT128, 1, [Define if have a usable _Float128 type.])
+    else
+      AC_DEFINE(HAVE_FLOAT128, 1, [Define if have a usable __float128 type.])
+    fi
 
     dnl Check whether -Wl,--as-needed resp. -Wl,-zignore is supported
     dnl 
@@ -339,26 +382,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$HAVE__FLOAT128" = 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$HAVE__FLOAT128" != 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=
+    HAVE__FLOAT128=no
+  fi
   fi
 
   dnl For the spec file
@@ -366,9 +413,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(HAVE__FLOAT128)
 ])
 
 
--- libgfortran/Makefile.am.jj	2022-01-14 12:10:56.429770387 +0100
+++ libgfortran/Makefile.am	2022-06-22 12:49:18.835924603 +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)' '@HAVE__FLOAT128@' > $@ || 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-01-17 13:37:39.763683227 +0100
+++ libgfortran/mk-kinds-h.sh	2022-06-22 12:38:47.606246183 +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 have__float128"
   exit 1
 fi
 
@@ -11,6 +11,7 @@ fi
 possible_integer_kinds="$1"
 possible_real_kinds="$2"
 compile="$3"
+have__float128="$4"
 
 largest=""
 smallest=""
@@ -49,7 +50,7 @@ echo ""
 
 
 # Get the kind value for long double, so we may disambiguate it
-# from __float128.
+# from __float128/_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,17 @@ 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"
-	    echo "#define GFC_REAL_16_IS_FLOAT128"
+	    if [ x$have__float128 = xyes ]; then
+	      ctype="_Float128"
+	      cplxtype="_Complex _Float128"
+	      suffix="f128"
+	      echo "#define GFC_REAL_16_IS__FLOAT128"
+	    else
+	      ctype="__float128"
+	      cplxtype="_Complex float __attribute__((mode(TC)))"
+	      suffix="q"
+	      echo "#define GFC_REAL_16_IS_FLOAT128"
+	    fi
 	  else
 	    ctype="long double"
 	    cplxtype="complex long double"
--- libgfortran/kinds-override.h.jj	2022-01-11 23:45:58.233109298 +0100
+++ libgfortran/kinds-override.h	2022-06-22 12:40:05.170224299 +0200
@@ -28,6 +28,9 @@ see the files COPYING3 and COPYING.RUNTI
 #if defined(GFC_REAL_16_IS_FLOAT128) && !defined(HAVE_FLOAT128)
 # error "Where has __float128 gone?"
 #endif
+#if defined(GFC_REAL_16_IS__FLOAT128) && !defined(HAVE__FLOAT128)
+# 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
--- libgfortran/libgfortran.h.jj	2022-01-12 09:41:48.779107854 +0100
+++ libgfortran/libgfortran.h	2022-06-22 12:50:41.107837321 +0200
@@ -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_IS__FLOAT128
+#   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_IS__FLOAT128
+#   define GFC_REAL_16_QUIET_NAN __builtin_nanf128 ("")
 #  else
 #   define GFC_REAL_16_QUIET_NAN nanq ("")
 #  endif
--- libgfortran/caf/single.c.jj	2022-01-11 23:11:23.815270129 +0100
+++ libgfortran/caf/single.c	2022-06-22 12:55:11.529263502 +0200
@@ -477,13 +477,16 @@ convert_type (void *dst, int dst_type, i
 #if defined(GFC_REAL_16_IS_LONG_DOUBLE)
   typedef long double real128t;
   typedef _Complex long double complex128t;
+#elif defined(GFC_REAL_16_IS__FLOAT128)
+  typedef _Float128 real128t;
+  typedef _Complex _Float128 complex128t;
 #elif defined(HAVE_GFC_REAL_16)
   typedef _Complex float __attribute__((mode(TC))) __complex128;
   typedef __float128 real128t;
   typedef __complex128 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-02-04 14:36:56.536583916 +0100
+++ libgfortran/ieee/issignaling_fallback.h	2022-06-22 13:00:14.657257457 +0200
@@ -195,13 +195,17 @@ __issignalingl (long double x)
 #endif
 
 
-#if defined(GFC_REAL_16_IS_FLOAT128)
+#if defined(GFC_REAL_16_IS_FLOAT128) || defined(GFC_REAL_16_IS__FLOAT128)
 
-/* We have a __float128 type.  */
+/* We have a __float128 or _Float128 type.  */
 
 typedef union
 {
+#ifdef GFC_REAL_16_IS_FLOAT128
   __float128 value;
+#else
+  _Float128 value;
+#endif
   struct
   {
 #if __FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__
@@ -215,7 +219,11 @@ typedef union
 } ieee854_float128_shape_type;
 
 static inline int
+#ifdef GFC_REAL_16_IS_FLOAT128
 __issignalingf128 (__float128 x)
+#else
+__issignalingf128 (_Float128 x)
+#endif
 {
   uint64_t hxi, lxi;
   ieee854_float128_shape_type u;
@@ -241,6 +249,13 @@ __issignalingf128 (__float128 x)
 	    float: __issignalingf, \
 	    double: __issignaling, \
 	    long double: __issignalingl)(X)
+#elif defined(GFC_REAL_16_IS__FLOAT128)
+# define issignaling(X) \
+  _Generic ((X), \
+	    _Float128: __issignalingf128, \
+	    float: __issignalingf, \
+	    double: __issignaling, \
+	    long double: __issignalingl)(X)
 #else
 # define issignaling(X) \
   _Generic ((X), \
--- libgfortran/ieee/ieee_helper.c.jj	2022-02-04 14:36:56.536583916 +0100
+++ libgfortran/ieee/ieee_helper.c	2022-06-22 12:57:38.676318840 +0200
@@ -181,7 +181,7 @@ VALUEMACRO(10, l)
 #endif
 
 #ifdef HAVE_GFC_REAL_16
-# ifdef GFC_REAL_16_IS_FLOAT128
+# if defined (GFC_REAL_16_IS_FLOAT128) || defined (GFC_REAL_16_IS__FLOAT128)
 VALUEMACRO(16, f128)
 # else
 VALUEMACRO(16, l)
--- libgfortran/intrinsics/cshift0.c.jj	2022-01-11 23:11:23.856269553 +0100
+++ libgfortran/intrinsics/cshift0.c	2022-06-22 13:02:03.549818352 +0200
@@ -132,10 +132,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_REAL_10
     case GFC_DTYPE_REAL_10:
       cshift0_r10 ((gfc_array_r10 *)ret, (gfc_array_r10 *) array, shift,
@@ -162,10 +162,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_COMPLEX_10
     case GFC_DTYPE_COMPLEX_10:
       cshift0_c10 ((gfc_array_c10 *)ret, (gfc_array_c10 *) array, shift,
--- libgfortran/intrinsics/erfc_scaled.c.jj	2022-01-11 23:49:50.119853428 +0100
+++ libgfortran/intrinsics/erfc_scaled.c	2022-06-22 13:03:36.998583350 +0200
@@ -58,6 +58,14 @@ see the files COPYING3 and COPYING.RUNTI
 # define _ERFC(x) erfcq(x)
 # define _EXP(x) expq(x)
 
+#elif defined(GFC_REAL_16_IS__FLOAT128)
+
+# 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.566990228185312813205074546585730L
--- libgfortran/intrinsics/spread_generic.c.jj	2022-01-11 23:11:23.860269497 +0100
+++ libgfortran/intrinsics/spread_generic.c	2022-06-22 13:10:36.933063544 +0200
@@ -320,10 +320,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef GFC_HAVE_REAL_10
     case GFC_DTYPE_REAL_10:
       spread_r10 ((gfc_array_r10 *) ret, (gfc_array_r10 *) source,
@@ -352,10 +352,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef GFC_HAVE_COMPLEX_10
     case GFC_DTYPE_COMPLEX_10:
       spread_c10 ((gfc_array_c10 *) ret, (gfc_array_c10 *) source,
@@ -524,10 +524,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_REAL_10
     case GFC_DTYPE_REAL_10:
       spread_scalar_r10 ((gfc_array_r10 *) ret, (GFC_REAL_10 *) source,
@@ -556,10 +556,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_COMPLEX_10
     case GFC_DTYPE_COMPLEX_10:
       spread_scalar_c10 ((gfc_array_c10 *) ret, (GFC_COMPLEX_10 *) source,
--- libgfortran/intrinsics/trigd.c.jj	2022-01-11 23:49:51.737830710 +0100
+++ libgfortran/intrinsics/trigd.c	2022-06-22 13:12:47.019354915 +0200
@@ -261,6 +261,24 @@ see the files COPYING3 and COPYING.RUNTI
 
 #endif /* HAVE_FABSL && HAVE_FMODL && HAVE_COPYSIGNL */
 
+#elif defined(GFC_REAL_16_IS_LONG_DOUBLE)
+
+#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-01-11 23:11:23.859269511 +0100
+++ libgfortran/intrinsics/pack_generic.c	2022-06-22 13:05:56.324749208 +0200
@@ -307,10 +307,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_REAL_10
     case GFC_DTYPE_REAL_10:
       pack_r10 ((gfc_array_r10 *) ret, (gfc_array_r10 *) array,
@@ -339,10 +339,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_COMPLEX_10
     case GFC_DTYPE_COMPLEX_10:
       pack_c10 ((gfc_array_c10 *) ret, (gfc_array_c10 *) array,
--- libgfortran/intrinsics/unpack_generic.c.jj	2022-01-11 23:11:23.860269497 +0100
+++ libgfortran/intrinsics/unpack_generic.c	2022-06-22 13:14:18.896148161 +0200
@@ -265,10 +265,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_REAL_10
     case GFC_DTYPE_REAL_10:
       unpack1_r10 ((gfc_array_r10 *) ret, (gfc_array_r10 *) vector,
@@ -297,10 +297,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_COMPLEX_10
     case GFC_DTYPE_COMPLEX_10:
       unpack1_c10 ((gfc_array_c10 *) ret, (gfc_array_c10 *) vector,
@@ -486,10 +486,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_REAL_10
     case GFC_DTYPE_REAL_10:
       unpack0_r10 ((gfc_array_r10 *) ret, (gfc_array_r10 *) vector,
@@ -518,10 +518,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # ifdef HAVE_GFC_COMPLEX_10
     case GFC_DTYPE_COMPLEX_10:
       unpack0_c10 ((gfc_array_c10 *) ret, (gfc_array_c10 *) vector,
--- libgfortran/runtime/in_pack_generic.c.jj	2022-01-11 23:11:23.883269174 +0100
+++ libgfortran/runtime/in_pack_generic.c	2022-06-22 14:14:43.239670210 +0200
@@ -82,10 +82,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # if defined (HAVE_GFC_REAL_10)
     case GFC_DTYPE_REAL_10:
       return internal_pack_r10 ((gfc_array_r10 *) source);
@@ -106,10 +106,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # if defined (HAVE_GFC_COMPLEX_10)
     case GFC_DTYPE_COMPLEX_10:
       return internal_pack_c10 ((gfc_array_c10 *) source);
--- libgfortran/runtime/in_unpack_generic.c.jj	2022-01-11 23:11:23.883269174 +0100
+++ libgfortran/runtime/in_unpack_generic.c	2022-06-22 14:15:12.485283638 +0200
@@ -89,10 +89,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # if defined(HAVE_GFC_REAL_10)
     case GFC_DTYPE_REAL_10:
       internal_unpack_r10 ((gfc_array_r10 *) d, (const GFC_REAL_10 *) s);
@@ -117,10 +117,10 @@ 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)
+#if !defined(GFC_REAL_16_IS_FLOAT128) && !defined(GFC_REAL_16_IS__FLOAT128)
 # if defined(HAVE_GFC_COMPLEX_10)
     case GFC_DTYPE_COMPLEX_10:
       internal_unpack_c10 ((gfc_array_c10 *) d, (const GFC_COMPLEX_10 *) s);
--- libgfortran/io/read.c.jj	2022-01-11 23:49:49.597860757 +0100
+++ libgfortran/io/read.c	2022-06-22 14:13:35.351567588 +0200
@@ -188,6 +188,10 @@ convert_real (st_parameter_dt *dtp, void
     case 16:
       *((GFC_REAL_16*) dest) = __qmath_(strtoflt128) (buffer, &endptr);
       break;
+# elif defined(GFC_REAL_16_IS__FLOAT128)
+    case 16:
+      *((GFC_REAL_16*) dest) = strtof128 (buffer, &endptr);
+      break;
 # elif defined(HAVE_STRTOLD)
     case 16:
       *((GFC_REAL_16*) dest) = gfc_strtold (buffer, &endptr);
@@ -274,6 +278,13 @@ convert_infnan (st_parameter_dt *dtp, vo
     case 16:
       *((GFC_REAL_16*) dest) = __qmath_(strtoflt128) (buffer, NULL);
       break;
+# elif defined(GFC_REAL_16_IS__FLOAT128)
+    case 16:
+      if (is_inf)
+	*((GFC_REAL_16*) dest) = plus ? __builtin_inff128 () : -__builtin_inff128 ();
+      else
+	*((GFC_REAL_16*) dest) = plus ? __builtin_nanf128 ("") : -__builtin_nanf128 ("");
+      break;
 # else
     case 16:
       if (is_inf)
--- libgfortran/io/transfer128.c.jj	2022-01-11 23:49:48.624874419 +0100
+++ libgfortran/io/transfer128.c	2022-06-22 13:20:31.657252114 +0200
@@ -28,7 +28,8 @@ see the files COPYING3 and COPYING.RUNTI
 #include "io.h"
 
 
-#if defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_GFC_REAL_17)
+#if defined(GFC_REAL_16_IS_FLOAT128) || defined(GFC_REAL_16_IS__FLOAT128) \
+    || defined(HAVE_GFC_REAL_17)
 
 /* The prototypes for the called procedures in transfer.c.  */
 
@@ -65,9 +66,11 @@ 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)
+# ifndef GFC_REAL_16_IS__FLOAT128
+#  if !defined(HAVE_GFC_REAL_17) || !defined(POWER_IEEE128)
 static void __attribute__((used)) *tmp1 = strtoflt128;
 static void __attribute__((used)) *tmp2 = quadmath_snprintf;
+#  endif
 # endif
 
 void
--- libgfortran/io/write_float.def.jj	2022-01-11 23:49:49.130867314 +0100
+++ libgfortran/io/write_float.def	2022-06-22 19:30:15.403155935 +0200
@@ -837,6 +837,42 @@ snprintf (buffer, size, "%+-#.*e", (prec
 #define DTOA2L(prec,val) \
 snprintf (buffer, size, "%+-#.*Le", (prec), (val))
 
+#ifdef GFC_REAL_16_IS__FLOAT128
+/* 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;
+}
+# define DTOA2F128(prec,val) \
+gfor_strfromf128 (buffer, size, 'e', (prec), (val))
+#endif
 
 #if defined(HAVE_GFC_REAL_17)
 # if defined(POWER_IEEE128)
@@ -860,6 +896,10 @@ snprintf (buffer, size, "%+-#.*f", (prec
 #define FDTOA2L(prec,val) \
 snprintf (buffer, size, "%+-#.*Lf", (prec), (val))
 
+#ifdef GFC_REAL_16_IS__FLOAT128
+# define FDTOA2F128(prec,val) \
+gfor_strfromf128 (buffer, size, 'f', (prec), (val))
+#endif
 
 #if defined(HAVE_GFC_REAL_17)
 # if defined(POWER_IEEE128)
@@ -939,6 +979,8 @@ determine_en_precision (st_parameter_dt
     case 16:
 # ifdef GFC_REAL_16_IS_FLOAT128
       EN_PREC(16,Q)
+# elif defined(GFC_REAL_16_IS__FLOAT128)
+      EN_PREC(16,F128)
 # else
       EN_PREC(16,L)
 # endif
@@ -1147,6 +1189,8 @@ get_float_string (st_parameter_dt *dtp,
     case 16:
 # ifdef GFC_REAL_16_IS_FLOAT128
       FORMAT_FLOAT(16,Q)
+# elif defined(GFC_REAL_16_IS__FLOAT128)
+      FORMAT_FLOAT(16,F128)
 # else
       FORMAT_FLOAT(16,L)
 # endif
--- libgfortran/m4/mtype.m4.jj	2022-01-11 23:35:52.584615001 +0100
+++ libgfortran/m4/mtype.m4	2022-06-22 13:52:56.987824469 +0200
@@ -9,7 +9,7 @@ define(hasmathfunc,dnl
 `ifelse(kind,4,`defined (HAVE_'upcase($1)`F)',dnl
 ifelse(kind,8,`defined (HAVE_'upcase($1)`)',dnl
 ifelse(kind,10,`defined (HAVE_'upcase($1)`L)',dnl
-ifelse(kind,16,`(defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_'upcase($1)`L))',dnl
+ifelse(kind,16,`(defined(GFC_REAL_16_IS_FLOAT128) || defined(GFC_REAL_16_IS__FLOAT128) || defined(HAVE_'upcase($1)`L))',dnl
 ifelse(kind,17,`1 /* FIXME: figure this out later.  */',dnl
 `error out')))))')
 define(mathfunc_macro,`ifelse(kind,17,dnl
@@ -21,6 +21,8 @@ define(mathfunc_macro,`ifelse(kind,17,dn
 `ifelse(kind,16,dnl
 `#if defined(GFC_REAL_16_IS_FLOAT128)
 #define MATHFUNC(funcname) funcname ## q
+#elif defined(GFC_REAL_16_IS__FLOAT128)
+#define MATHFUNC(funcname) funcname ## f128
 #else
 #define MATHFUNC(funcname) funcname ## l
 #endif',dnl
--- libgfortran/config.h.in.jj	2022-01-11 23:45:58.226109396 +0100
+++ libgfortran/config.h.in	2022-06-22 12:20:10.153059959 +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
 
@@ -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,21 +1059,33 @@
 /* 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
 
+/* Define if have a usable _Float128 type. */
+#undef HAVE__FLOAT128
+
 /* Define to 1 if you have the `__acoshieee128' function. */
 #undef HAVE___ACOSHIEEE128
 
--- libgfortran/configure.jj	2022-01-11 23:45:58.230109340 +0100
+++ libgfortran/configure	2022-06-24 12:11:41.031853394 +0200
@@ -645,8 +645,7 @@ IEEE_SUPPORT
 IEEE_SUPPORT_FALSE
 IEEE_SUPPORT_TRUE
 FPU_HOST_HEADER
-LIBGFOR_BUILD_QUAD_FALSE
-LIBGFOR_BUILD_QUAD_TRUE
+HAVE__FLOAT128
 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,22 +30082,39 @@ $as_echo "#define HAVE_MINGW_SNPRINTF 1"
   fi
 
 
+have__Float128_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__Float128_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__Float128_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
+# and have__Float128_libc_support.
 
   LIBQUADSPEC=
+  LIBQUADLIB=
+  LIBQUADLIB_DEP=
+  LIBQUADINCLUDE=
+  HAVE__FLOAT128=no
 
   if test "x$enable_libquadmath_support" != xno; then
 
@@ -27221,10 +30221,122 @@ 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__Float128_libc_support$enable_libquadmath_support" = xyesdefault; 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; }
+if ${libgfor_cv_have__Float128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+   if test x$gcc_no_link = xyes; then
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+    _Float128 foo (_Float128 x)
+    {
+
+     _Complex _Float128 z1, z2;
+
+     z1 = x;
+     z2 = x / 7.F128;
+     z2 /= z1;
+
+     return (_Float128) z2;
+    }
+
+    _Float128 bar (_Float128 x)
+    {
+      return x * __builtin_huge_valf128 ();
+    }
+
+int
+main ()
+{
+
+    foo (1.2F128);
+    bar (1.2F128);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+    libgfor_cv_have__Float128=yes
+
+else
+
+    libgfor_cv_have__Float128=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+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.  */
+
+    _Float128 foo (_Float128 x)
+    {
+
+     _Complex _Float128 z1, z2;
+
+     z1 = x;
+     z2 = x / 7.F128;
+     z2 /= z1;
+
+     return (_Float128) z2;
+    }
+
+    _Float128 bar (_Float128 x)
+    {
+      return x * __builtin_huge_valf128 ();
+    }
+
+int
+main ()
+{
+
+    foo (1.2F128);
+    bar (1.2F128);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+    libgfor_cv_have__Float128=yes
+
+else
+
+    libgfor_cv_have__Float128=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have__Float128" >&5
+$as_echo "$libgfor_cv_have__Float128" >&6; }
+
+      if test "x$libgfor_cv_have__Float128" = xyes; then
+	HAVE__FLOAT128=yes
+      fi
+    fi
+
+
   if test "x$libgfor_cv_have_float128" = xyes; then
+    if test "x$HAVE__FLOAT128" = xyes; then
+
+$as_echo "#define HAVE__FLOAT128 1" >>confdefs.h
+
+    else
 
 $as_echo "#define HAVE_FLOAT128 1" >>confdefs.h
 
+    fi
 
                                 ac_xsave_c_werror_flag=$ac_c_werror_flag
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --as-needed/-z ignore works" >&5
@@ -27301,26 +30413,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$HAVE__FLOAT128" = 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$HAVE__FLOAT128" != 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=
+    HAVE__FLOAT128=no
+  fi
   fi
 
 
@@ -27328,14 +30441,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 +31624,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-01-14 21:24:48.371295701 +0100
+++ libgfortran/Makefile.in	2022-06-24 12:11:50.453731136 +0200
@@ -618,6 +618,7 @@ FCFLAGS = @FCFLAGS@
 FGREP = @FGREP@
 FPU_HOST_HEADER = @FPU_HOST_HEADER@
 GREP = @GREP@
+HAVE__FLOAT128 = @HAVE__FLOAT128@
 HWCAP_LDFLAGS = @HWCAP_LDFLAGS@
 IEEE_FLAGS = @IEEE_FLAGS@
 IEEE_SUPPORT = @IEEE_SUPPORT@
@@ -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)' '@HAVE__FLOAT128@' > $@ || rm $@
 
 kinds.inc: kinds.h $(srcdir)/kinds-override.h
 	cat kinds.h $(srcdir)/kinds-override.h | grep '^#' | grep -v include > $@
--- libgfortran/generated/norm2_r16.c.jj	2022-01-11 23:11:23.847269679 +0100
+++ libgfortran/generated/norm2_r16.c	2022-06-22 14:03:09.399792484 +0200
@@ -27,10 +27,12 @@ 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 (HAVE_GFC_REAL_16) && defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(GFC_REAL_16_IS__FLOAT128) || defined(HAVE_SQRTL)) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(GFC_REAL_16_IS__FLOAT128) || defined(HAVE_FABSL))
 
 #if defined(GFC_REAL_16_IS_FLOAT128)
 #define MATHFUNC(funcname) funcname ## q
+#elif defined(GFC_REAL_16_IS__FLOAT128)
+#define MATHFUNC(funcname) funcname ## f128
 #else
 #define MATHFUNC(funcname) funcname ## l
 #endif
--- libgfortran/generated/bessel_r16.c.jj	2022-01-11 23:11:23.820270059 +0100
+++ libgfortran/generated/bessel_r16.c	2022-06-22 14:02:54.046994166 +0200
@@ -30,6 +30,8 @@ see the files COPYING3 and COPYING.RUNTI
 
 #if defined(GFC_REAL_16_IS_FLOAT128)
 #define MATHFUNC(funcname) funcname ## q
+#elif defined(GFC_REAL_16_IS__FLOAT128)
+#define MATHFUNC(funcname) funcname ## f128
 #else
 #define MATHFUNC(funcname) funcname ## l
 #endif
@@ -38,7 +40,7 @@ see the files COPYING3 and COPYING.RUNTI
 
 
 
-#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_JNL))
+#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(GFC_REAL_16_IS__FLOAT128) || defined(HAVE_JNL))
 extern void bessel_jn_r16 (gfc_array_r16 * const restrict ret, int n1,
 				     int n2, GFC_REAL_16 x);
 export_proto(bessel_jn_r16);
@@ -104,7 +106,7 @@ bessel_jn_r16 (gfc_array_r16 * const res
 
 #endif
 
-#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_YNL))
+#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(GFC_REAL_16_IS__FLOAT128) || defined(HAVE_YNL))
 extern void bessel_yn_r16 (gfc_array_r16 * const restrict ret,
 				     int n1, int n2, GFC_REAL_16 x);
 export_proto(bessel_yn_r16);


	Jakub


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

* Re: [PATCH] fortran, libgfortran, v2: Avoid using libquadmath for glibc 2.26+
  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
  1 sibling, 0 replies; 13+ messages in thread
From: Harald Anlauf @ 2022-06-24 21:06 UTC (permalink / raw)
  To: Jakub Jelinek, gcc-patches, Joseph S. Myers, fortran

Hi Jakub,

Am 24.06.22 um 12:29 schrieb Jakub Jelinek via Gcc-patches:
> On Thu, Jun 23, 2022 at 11:17:50PM +0200, Jakub Jelinek via Gcc-patches wrote:
>> We currently use
>> %rename lib liborig
>> *lib: %{static-libgfortran:--as-needed} -lquadmath %{static-libgfortran:--no-as-needed} -lm %(libgcc) %(liborig)
>> in libgfortran.spec (on targets where we do configure in libquadmath).
>> So, I believe the patch as is is an ABI change for *.o files if they use
>> real(kind=16) math functions (one needs to recompile them), but not
>> for linked shared libraries or executables, because the above aranges
>> for them to be linked with -lquadmath or for -static-libgfortran with
>> --as-needed -lquadmath --no-as-needed.  The former adds libquadmath.so.0
>> automatically to anything gfortran links, the latter to anything that
>> actually needs it (i.e. has undefined math/complex *q symbols).
>>
>> Note, libgfortran.so.5 itself is ABI compatible, just no longer has
>> DT_NEEDED libquadmath.so.0 and uses the *f128 APIs + str{to,from}f128
>> instead of *q APIs + strtoflt128 and quadmath_snprintf.
>>
>> Now, what we could do if we'd want to also preserve *.o file compatibility,
>> would be for gcc configured on glibc 2.26+ change libgfortran.spec to
>> *lib: --as-needed -lquadmath --no-as-needed -lm %(libgcc) %(liborig)
>> so that we even without -static-libgfortran link in libquadmath.so.0
>> only if it is needed.  So, if there will be any gcc <= 12 compiled
>> *.o files or *.o files compiled by gcc 13 if it was configured against
>> glibc 2.25 or older, we'd link -lquadmath in, but if there are just
>> *.o files referencing *f128 symbols, we wouldn't.
>>
>>> Am I right in assuming that this also effectively fixes PR46539?
>>> (Add -static-libquadmath).
>>
>> That was one of the intents of the patch.
>> But sure, it doesn't introduce -static-libquadmath, nor arranges for
>> -static-libgfortran to link libquadmath statically, just in some cases
>> (gcc configured on glibc 2.26 or later) and when everything that calls
>> real(kind=16) math functions has been recompiled arranges for libquadmath
>> not to be used at all.
>
> Here is an updated patch that does that.

very good!

>>>> --- gcc/fortran/trans-intrinsic.cc.jj	2022-05-16 11:14:57.587427707 +0200
>>>> +++ gcc/fortran/trans-intrinsic.cc	2022-06-23 11:42:03.355899271 +0200
>>>> @@ -155,7 +155,7 @@ builtin_decl_for_precision (enum built_i
>>>>      else if (precision == TYPE_PRECISION (double_type_node))
>>>>        i = m->double_built_in;
>>>>      else if (precision == TYPE_PRECISION (long_double_type_node)
>>>> -	   && (!gfc_real16_is_float128
>>>> +	   && ((!gfc_real16_is_float128 & !gfc_real16_is__Float128)
>>>
>>> Shouldn't this be && instead of & ?
>>
>> You're right, will fix.
>
> And this too.
>
> So I believe it should now be fully ABI compatible.

Great, thanks!

Harald

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

* Re: [PATCH] fortran, libgfortran, v2: Avoid using libquadmath for glibc 2.26+
  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
  1 sibling, 1 reply; 13+ messages in thread
From: Mikael Morin @ 2022-06-26 18:45 UTC (permalink / raw)
  To: Jakub Jelinek, Harald Anlauf, gcc-patches, Joseph S. Myers, fortran

Hello,

I don’t like the _Float128 vs __float128 business, it’s confusing.
And accordinog to https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html 
they seem to be basically the same thing, so it’s also redundant.
Is there a reason why the standard one, _Float128, can’t be used everywhere?
Mikael

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

* Re: [PATCH] fortran, libgfortran, v2: Avoid using libquadmath for glibc 2.26+
  2022-06-26 18:45       ` Mikael Morin
@ 2022-06-27  7:54         ` Jakub Jelinek
  2022-06-27 11:56           ` Mikael Morin
  2022-06-27 20:54           ` [PATCH] fortran, libgfortran, v2: " Joseph Myers
  0 siblings, 2 replies; 13+ messages in thread
From: Jakub Jelinek @ 2022-06-27  7:54 UTC (permalink / raw)
  To: Mikael Morin; +Cc: Harald Anlauf, gcc-patches, Joseph S. Myers, fortran

On Sun, Jun 26, 2022 at 08:45:28PM +0200, Mikael Morin wrote:
> I don’t like the _Float128 vs __float128 business, it’s confusing.
> And accordinog to https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html
> they seem to be basically the same thing, so it’s also redundant.

I thought __float128 and _Float128 are distinct and incompatible in the FEs
and equivalent in middle-end and back-end, but apparently they are
considered equivalent even for _Generic.
Still, using __float128 when the APIs are declared for __float128 and
_Float128 when the APIs are declared for _Float128 can be better for
consistency.

But if you feel strongly that we should use _Float128 and F128/f128
suffixes on floating point constants everywhere, we'd need more work
(e.g. because we use those same suffixes also for the functions where
we need to differentiate, or on macros like M_PI etc. where it is
significant too), and we'd need to come up with new macros to differentiate
which API set to use.
In the patch I've posted,
HAVE_FLOAT128 and GFC_REAL_16_IS_FLOAT128 defines stand for
__float128 + libquadmath APIs,
HAVE__FLOAT128 and GFC_REAL_16_IS__FLOAT128 stand for
_Float128 and C *f128 APIs.
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.
And the hardest part would be that we that GFC_REAL_{16,17}_LITERAL{,_SUFFIX}
is currently used everywhere while for library APIs and M_* constants
we need to differentiate.  Perhaps we could just use *q suffixes even when
using _Float128 when USE_LIBQUADMATH.

	Jakub


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

* Re: [PATCH] fortran, libgfortran, v2: Avoid using libquadmath for glibc 2.26+
  2022-06-27  7:54         ` Jakub Jelinek
@ 2022-06-27 11:56           ` Mikael Morin
  2022-06-27 13:30             ` [PATCH] fortran, libgfortran, v3: " Jakub Jelinek
  2022-06-27 20:54           ` [PATCH] fortran, libgfortran, v2: " Joseph Myers
  1 sibling, 1 reply; 13+ messages in thread
From: Mikael Morin @ 2022-06-27 11:56 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Harald Anlauf, gcc-patches, Joseph S. Myers, fortran

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




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

* [PATCH] fortran, libgfortran, v3: Avoid using libquadmath for glibc 2.26+
  2022-06-27 11:56           ` Mikael Morin
@ 2022-06-27 13:30             ` Jakub Jelinek
  2022-06-28  7:01               ` Jakub Jelinek
  2022-06-28  8:35               ` Tobias Burnus
  0 siblings, 2 replies; 13+ messages in thread
From: Jakub Jelinek @ 2022-06-27 13:30 UTC (permalink / raw)
  To: Mikael Morin; +Cc: Harald Anlauf, gcc-patches, Joseph S. Myers, fortran

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


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

* Re: [PATCH] fortran, libgfortran, v2: Avoid using libquadmath for glibc 2.26+
  2022-06-27  7:54         ` Jakub Jelinek
  2022-06-27 11:56           ` Mikael Morin
@ 2022-06-27 20:54           ` Joseph Myers
  1 sibling, 0 replies; 13+ messages in thread
From: Joseph Myers @ 2022-06-27 20:54 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Mikael Morin, fortran, gcc-patches, Harald Anlauf

On Mon, 27 Jun 2022, Jakub Jelinek via Gcc-patches wrote:

> On Sun, Jun 26, 2022 at 08:45:28PM +0200, Mikael Morin wrote:
> > I don’t like the _Float128 vs __float128 business, it’s confusing.
> > And accordinog to https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html
> > they seem to be basically the same thing, so it’s also redundant.
> 
> I thought __float128 and _Float128 are distinct and incompatible in the FEs
> and equivalent in middle-end and back-end, but apparently they are
> considered equivalent even for _Generic.

Yes, when both are supported, they are the same type.  The main 
differences (not relevant for this patch, I think) are:

* _Float128 is supported on systems where long double has the IEEE 
binary128 format (as a distinct type from long double even when they have 
the same format); __float128 generally isn't supported on such systems.

* __float128 is supported in C++, _Float128 isn't (though we've discussed 
adding support for _FloatN type names and corresponding fN constant 
suffixes in C++; see the thread on the gcc list in March 2021).

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH] fortran, libgfortran, v3: Avoid using libquadmath for glibc 2.26+
  2022-06-27 13:30             ` [PATCH] fortran, libgfortran, v3: " Jakub Jelinek
@ 2022-06-28  7:01               ` Jakub Jelinek
  2022-06-28  8:35               ` Tobias Burnus
  1 sibling, 0 replies; 13+ messages in thread
From: Jakub Jelinek @ 2022-06-28  7:01 UTC (permalink / raw)
  To: Mikael Morin, fortran, gcc-patches, Harald Anlauf, Joseph S. Myers

On Mon, Jun 27, 2022 at 03:30:49PM +0200, Jakub Jelinek via Gcc-patches wrote:
> 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?

Bootstrapped/regtested successfully on x86_64-linux and i686-linux with
glibc 2.35 (libquadmath not used), powerpc64le-linux with glibc 2.17
(libquadmath used for -mabi=ieeelongdouble support), powerpc64le-linux
with 2.28 (libquadmath not used), powerpc64-linux with glibc 2.17
(libquadmath not used, real(kind=16) only long double IBM double double).

	Jakub


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

* Re: [PATCH] fortran, libgfortran, v3: Avoid using libquadmath for glibc 2.26+
  2022-06-27 13:30             ` [PATCH] fortran, libgfortran, v3: " Jakub Jelinek
  2022-06-28  7:01               ` Jakub Jelinek
@ 2022-06-28  8:35               ` Tobias Burnus
  2022-06-28 10:57                 ` Jakub Jelinek
  1 sibling, 1 reply; 13+ messages in thread
From: Tobias Burnus @ 2022-06-28  8:35 UTC (permalink / raw)
  To: Jakub Jelinek, Mikael Morin
  Cc: fortran, gcc-patches, Harald Anlauf, Joseph S. Myers

On 27.06.22 15:30, Jakub Jelinek via Gcc-patches wrote:

> 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?

LGTM – I am not completely happy of having a TARGET_GLIBC_M{AJ,IN}OR check
in the FE (vs. a symbol-is-available check in libgfortran), but that
should be fine as it is unlikely to cause any issue in practice.

Thanks for the patch.

Tobias

> 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.
> [...]
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

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

* Re: [PATCH] fortran, libgfortran, v3: Avoid using libquadmath for glibc 2.26+
  2022-06-28  8:35               ` Tobias Burnus
@ 2022-06-28 10:57                 ` Jakub Jelinek
  0 siblings, 0 replies; 13+ messages in thread
From: Jakub Jelinek @ 2022-06-28 10:57 UTC (permalink / raw)
  To: Tobias Burnus
  Cc: Mikael Morin, fortran, gcc-patches, Harald Anlauf, Joseph S. Myers

On Tue, Jun 28, 2022 at 10:35:03AM +0200, Tobias Burnus wrote:
> On 27.06.22 15:30, Jakub Jelinek via Gcc-patches wrote:
> 
> > 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?
> 
> LGTM – I am not completely happy of having a TARGET_GLIBC_M{AJ,IN}OR check
> in the FE

I've used it because it is already (though my fault too) used for the
powerpc64le stuff in the FE too.
The alternative would be grepping of target glibc headers in
gcc/configure.ac, because I think we can't during gcc configure time
preprocess the target glibc header (at least not reliably) because
at that point we just have host compiler which might be a different
architecture.  So, we could e.g. grep for
grep '^[[:blank:]]*#[[:blank:]]*define[[:blank:]]*__HAVE_FLOAT128[[:blank:]]*1' $target_header_dir/bits/floatn.h
or so.
Currently all arches that do have the IEC 60559 _Float128 *f128 APIs
in glibc were added in glibc 2.26, if some extra are added later
or some other libraries add those, we can always improve the checks.

	Jakub


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

end of thread, other threads:[~2022-06-28 10:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23 12:04 [PATCH] fortran, libgfortran: Avoid using libquadmath for glibc 2.26+ 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             ` [PATCH] fortran, libgfortran, v3: " Jakub Jelinek
2022-06-28  7:01               ` 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

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