git-floatn-gcc-13-support
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Sat, 30 Sep 2023 08:31:05 +0000 (09:31 +0100)
committerAurelien Jarno <aurel32@debian.org>
Sat, 30 Sep 2023 08:31:05 +0000 (09:31 +0100)
commit 3e5760fcb48528d48deeb60cb885a97bb731160c
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Sep 28 20:09:34 2022 +0000

    Update _FloatN header support for C++ in GCC 13

    GCC 13 adds support for _FloatN and _FloatNx types in C++, so breaking
    the installed glibc headers that assume such support is not present.
    GCC mostly works around this with fixincludes, but that doesn't help
    for building glibc and its tests (glibc doesn't itself contain C++
    code, but there's C++ code built for tests).  Update glibc's
    bits/floatn-common.h and bits/floatn.h headers to handle the GCC 13
    support directly.

    In general the changes match those made by fixincludes, though I think
    the ones in sysdeps/powerpc/bits/floatn.h, where the header tests
    __LDBL_MANT_DIG__ == 113 or uses #elif, wouldn't match the existing
    fixincludes patterns.

    Some places involving special C++ handling in relation to _FloatN
    support are not changed.  There's no need to change the
    __HAVE_FLOATN_NOT_TYPEDEF definition (also in a form that wouldn't be
    matched by the fixincludes fixes) because it's only used in relation
    to macro definitions using features not supported for C++
    (__builtin_types_compatible_p and _Generic).  And there's no need to
    change the inline function overloads for issignaling, iszero and
    iscanonical in C++ because cases where types have the same format but
    are no longer compatible types are handled automatically by the C++
    overload resolution rules.

    This patch also does not change the overload handling for iseqsig, and
    there I think changes *are* needed, beyond those in this patch or made
    by fixincludes.  The way that overload is defined, via a template
    parameter to a structure type, requires overloads whenever the types
    are incompatible, even if they have the same format.  So I think we
    need to add overloads with GCC 13 for every supported _FloatN and
    _FloatNx type, rather than just having one for _Float128 when it has a
    different ABI to long double as at present (but for older GCC, such
    overloads must not be defined for types that end up defined as
    typedefs for another type).

    Tested with build-many-glibcs.py: compilers build for
    aarch64-linux-gnu ia64-linux-gnu mips64-linux-gnu powerpc-linux-gnu
    powerpc64le-linux-gnu x86_64-linux-gnu; glibcs build for
    aarch64-linux-gnu ia64-linux-gnu i686-linux-gnu mips-linux-gnu
    mips64-linux-gnu-n32 powerpc-linux-gnu powerpc64le-linux-gnu
    x86_64-linux-gnu.

Gbp-Pq: Topic any
Gbp-Pq: Name git-floatn-gcc-13-support.diff

bits/floatn-common.h
math/math.h
math/test-math-iseqsig.cc
sysdeps/ia64/bits/floatn.h
sysdeps/ieee754/ldbl-128/bits/floatn.h
sysdeps/mips/ieee754/bits/floatn.h
sysdeps/powerpc/bits/floatn.h
sysdeps/x86/bits/floatn.h

index 92982d64601bc562733ffd64f9e88854407c16c7..67519dbb74144b27a82c8d30648498da75837d3a 100644 (file)
@@ -78,7 +78,7 @@
    or _FloatNx types, if __HAVE_<type> is 1.  The corresponding
    literal suffixes exist since GCC 7, for C only.  */
 # if __HAVE_FLOAT16
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* No corresponding suffix available for this type.  */
 #   define __f16(x) ((_Float16) x##f)
 #  else
@@ -87,7 +87,7 @@
 # endif
 
 # if __HAVE_FLOAT32
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   define __f32(x) x##f
 #  else
 #   define __f32(x) x##f32
@@ -95,7 +95,7 @@
 # endif
 
 # if __HAVE_FLOAT64
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   ifdef __NO_LONG_DOUBLE_MATH
 #    define __f64(x) x##l
 #   else
 # endif
 
 # if __HAVE_FLOAT32X
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   define __f32x(x) x
 #  else
 #   define __f32x(x) x##f32x
 # endif
 
 # if __HAVE_FLOAT64X
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   if __HAVE_FLOAT64X_LONG_DOUBLE
 #    define __f64x(x) x##l
 #   else
 # endif
 
 # if __HAVE_FLOAT128X
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   error "_Float128X supported but no constant suffix"
 #  else
 #   define __f128x(x) x##f128x
 
 /* Defined to a complex type if __HAVE_<type> is 1.  */
 # if __HAVE_FLOAT16
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
 #   define __CFLOAT16 __cfloat16
 #  else
@@ -145,7 +145,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
 # endif
 
 # if __HAVE_FLOAT32
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   define __CFLOAT32 _Complex float
 #  else
 #   define __CFLOAT32 _Complex _Float32
@@ -153,7 +153,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
 # endif
 
 # if __HAVE_FLOAT64
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   ifdef __NO_LONG_DOUBLE_MATH
 #    define __CFLOAT64 _Complex long double
 #   else
@@ -165,7 +165,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
 # endif
 
 # if __HAVE_FLOAT32X
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   define __CFLOAT32X _Complex double
 #  else
 #   define __CFLOAT32X _Complex _Float32x
@@ -173,7 +173,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
 # endif
 
 # if __HAVE_FLOAT64X
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   if __HAVE_FLOAT64X_LONG_DOUBLE
 #    define __CFLOAT64X _Complex long double
 #   else
@@ -185,7 +185,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
 # endif
 
 # if __HAVE_FLOAT128X
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   error "_Float128X supported but no complex type"
 #  else
 #   define __CFLOAT128X _Complex _Float128x
@@ -195,7 +195,7 @@ typedef _Complex float __cfloat16 __attribute__ ((__mode__ (__HC__)));
 /* The remaining of this file provides support for older compilers.  */
 # if __HAVE_FLOAT16
 
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef float _Float16 __attribute__ ((__mode__ (__HF__)));
 #  endif
 
@@ -210,7 +210,7 @@ typedef float _Float16 __attribute__ ((__mode__ (__HF__)));
 
 # if __HAVE_FLOAT32
 
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef float _Float32;
 #  endif
 
@@ -234,7 +234,7 @@ typedef float _Float32;
 
 #  ifdef __NO_LONG_DOUBLE_MATH
 
-#   if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#   if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef long double _Float64;
 #   endif
 
@@ -247,7 +247,7 @@ typedef long double _Float64;
 
 #  else
 
-#   if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#   if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef double _Float64;
 #   endif
 
@@ -264,7 +264,7 @@ typedef double _Float64;
 
 # if __HAVE_FLOAT32X
 
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef double _Float32x;
 #  endif
 
@@ -281,7 +281,7 @@ typedef double _Float32x;
 
 #  if __HAVE_FLOAT64X_LONG_DOUBLE
 
-#   if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#   if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef long double _Float64x;
 #   endif
 
@@ -294,7 +294,7 @@ typedef long double _Float64x;
 
 #  else
 
-#   if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#   if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef _Float128 _Float64x;
 #   endif
 
@@ -311,7 +311,7 @@ typedef _Float128 _Float64x;
 
 # if __HAVE_FLOAT128X
 
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   error "_Float128x supported but no type"
 #  endif
 
index 27963ef6dcd4dcd718eccaca9844829dff03eab6..cf980c37c39d85f915d6ec571017788ad5d61743 100644 (file)
@@ -1391,14 +1391,62 @@ template<> struct __iseqsig_type<long double>
   }
 };
 
-#  if __HAVE_FLOAT128_UNLIKE_LDBL
+#  if __HAVE_FLOAT32 && __GNUC_PREREQ (13, 0)
+template<> struct __iseqsig_type<_Float32>
+{
+  static int __call (_Float32 __x, _Float32 __y) throw ()
+  {
+    return __iseqsigf (__x, __y);
+  }
+};
+#  endif
+
+#  if __HAVE_FLOAT64 && __GNUC_PREREQ (13, 0)
+template<> struct __iseqsig_type<_Float64>
+{
+  static int __call (_Float64 __x, _Float64 __y) throw ()
+  {
+    return __iseqsig (__x, __y);
+  }
+};
+#  endif
+
+#  if __HAVE_FLOAT128_UNLIKE_LDBL || (__HAVE_FLOAT128 && __GNUC_PREREQ (13, 0))
   /* When using an IEEE 128-bit long double, _Float128 is defined as long double
      in C++.  */
 template<> struct __iseqsig_type<_Float128>
 {
   static int __call (_Float128 __x, _Float128 __y) throw ()
   {
+#   if __HAVE_FLOAT128_UNLIKE_LDBL
     return __iseqsigf128 (__x, __y);
+#   else
+    return __iseqsigl (__x, __y);
+#   endif
+  }
+};
+#  endif
+
+#  if __HAVE_FLOAT32X && __GNUC_PREREQ (13, 0)
+template<> struct __iseqsig_type<_Float32x>
+{
+  static int __call (_Float32x __x, _Float32x __y) throw ()
+  {
+    return __iseqsig (__x, __y);
+  }
+};
+#  endif
+
+#  if __HAVE_FLOAT64X && __GNUC_PREREQ (13, 0)
+template<> struct __iseqsig_type<_Float64x>
+{
+  static int __call (_Float64x __x, _Float64x __y) throw ()
+  {
+#   if __HAVE_FLOAT64X_LONG_DOUBLE
+    return __iseqsigl (__x, __y);
+#   else
+    return __iseqsigf128 (__x, __y);
+#   endif
   }
 };
 #  endif
index 59a84d57bd8c8f45180c1903894566cefbbd751f..44be4aeba88ca81e5fd41dfbd97d2a79eeb3eb5a 100644 (file)
@@ -17,6 +17,7 @@
    <https://www.gnu.org/licenses/>.  */
 
 #define _GNU_SOURCE 1
+#include <float.h>
 #include <math.h>
 #include <stdio.h>
 
@@ -67,6 +68,20 @@ check_type ()
     }
 }
 
+/* Run minimal tests of iseqsig for a pair of types, without relying
+   on C++ library support or knowledge of the representation.  */
+template <class T1, class T2>
+static void
+check_type_minimal ()
+{
+  T1 t1 = 0;
+  T2 t2 = 0;
+  CHECK (iseqsig (t1, t2), 1);
+
+  t2 = 1;
+  CHECK (iseqsig (t1, t2), 0);
+}
+
 #if __HAVE_DISTINCT_FLOAT128
 static void
 check_float128 ()
@@ -105,6 +120,281 @@ do_test (void)
 #if __HAVE_DISTINCT_FLOAT128
   check_float128 ();
 #endif
+
+#if __HAVE_FLOAT16
+  check_type_minimal<float, _Float16> ();
+#endif
+#if __HAVE_FLOAT32
+  check_type_minimal<float, _Float32> ();
+#endif
+#if __HAVE_FLOAT64
+  check_type_minimal<float, _Float64> ();
+#endif
+#if __HAVE_FLOAT128
+  check_type_minimal<float, _Float128> ();
+#endif
+#if __HAVE_FLOAT32X
+  check_type_minimal<float, _Float32x> ();
+#endif
+#if __HAVE_FLOAT64X
+  check_type_minimal<float, _Float64x> ();
+#endif
+#if __HAVE_FLOAT128X
+  check_type_minimal<float, _Float128x> ();
+#endif
+#if __HAVE_FLOAT16
+  check_type_minimal<double, _Float16> ();
+#endif
+#if __HAVE_FLOAT32
+  check_type_minimal<double, _Float32> ();
+#endif
+#if __HAVE_FLOAT64
+  check_type_minimal<double, _Float64> ();
+#endif
+#if __HAVE_FLOAT128
+  check_type_minimal<double, _Float128> ();
+#endif
+#if __HAVE_FLOAT32X
+  check_type_minimal<double, _Float32x> ();
+#endif
+#if __HAVE_FLOAT64X
+  check_type_minimal<double, _Float64x> ();
+#endif
+#if __HAVE_FLOAT128X
+  check_type_minimal<double, _Float128x> ();
+#endif
+#if __HAVE_FLOAT16
+  check_type_minimal<long double, _Float16> ();
+#endif
+#if __HAVE_FLOAT32
+  check_type_minimal<long double, _Float32> ();
+#endif
+#if __HAVE_FLOAT64
+  check_type_minimal<long double, _Float64> ();
+#endif
+#if __HAVE_FLOAT128 && LDBL_MANT_DIG != 106
+  check_type_minimal<long double, _Float128> ();
+#endif
+#if __HAVE_FLOAT32X
+  check_type_minimal<long double, _Float32x> ();
+#endif
+#if __HAVE_FLOAT64X && LDBL_MANT_DIG != 106
+  check_type_minimal<long double, _Float64x> ();
+#endif
+#if __HAVE_FLOAT128X && LDBL_MANT_DIG != 106
+  check_type_minimal<long double, _Float128x> ();
+#endif
+#if __HAVE_FLOAT16
+  check_type_minimal<_Float16, float> ();
+#endif
+#if __HAVE_FLOAT16
+  check_type_minimal<_Float16, double> ();
+#endif
+#if __HAVE_FLOAT16
+  check_type_minimal<_Float16, long double> ();
+#endif
+#if __HAVE_FLOAT16
+  check_type_minimal<_Float16, _Float16> ();
+#endif
+#if __HAVE_FLOAT16 && __HAVE_FLOAT32
+  check_type_minimal<_Float16, _Float32> ();
+#endif
+#if __HAVE_FLOAT16 && __HAVE_FLOAT64
+  check_type_minimal<_Float16, _Float64> ();
+#endif
+#if __HAVE_FLOAT16 && __HAVE_FLOAT128
+  check_type_minimal<_Float16, _Float128> ();
+#endif
+#if __HAVE_FLOAT16 && __HAVE_FLOAT32X
+  check_type_minimal<_Float16, _Float32x> ();
+#endif
+#if __HAVE_FLOAT16 && __HAVE_FLOAT64X
+  check_type_minimal<_Float16, _Float64x> ();
+#endif
+#if __HAVE_FLOAT16 && __HAVE_FLOAT128X
+  check_type_minimal<_Float16, _Float128x> ();
+#endif
+#if __HAVE_FLOAT32
+  check_type_minimal<_Float32, float> ();
+#endif
+#if __HAVE_FLOAT32
+  check_type_minimal<_Float32, double> ();
+#endif
+#if __HAVE_FLOAT32
+  check_type_minimal<_Float32, long double> ();
+#endif
+#if __HAVE_FLOAT32 && __HAVE_FLOAT16
+  check_type_minimal<_Float32, _Float16> ();
+#endif
+#if __HAVE_FLOAT32
+  check_type_minimal<_Float32, _Float32> ();
+#endif
+#if __HAVE_FLOAT32 && __HAVE_FLOAT64
+  check_type_minimal<_Float32, _Float64> ();
+#endif
+#if __HAVE_FLOAT32 && __HAVE_FLOAT128
+  check_type_minimal<_Float32, _Float128> ();
+#endif
+#if __HAVE_FLOAT32 && __HAVE_FLOAT32X
+  check_type_minimal<_Float32, _Float32x> ();
+#endif
+#if __HAVE_FLOAT32 && __HAVE_FLOAT64X
+  check_type_minimal<_Float32, _Float64x> ();
+#endif
+#if __HAVE_FLOAT32 && __HAVE_FLOAT128X
+  check_type_minimal<_Float32, _Float128x> ();
+#endif
+#if __HAVE_FLOAT64
+  check_type_minimal<_Float64, float> ();
+#endif
+#if __HAVE_FLOAT64
+  check_type_minimal<_Float64, double> ();
+#endif
+#if __HAVE_FLOAT64
+  check_type_minimal<_Float64, long double> ();
+#endif
+#if __HAVE_FLOAT64 && __HAVE_FLOAT16
+  check_type_minimal<_Float64, _Float16> ();
+#endif
+#if __HAVE_FLOAT64 && __HAVE_FLOAT32
+  check_type_minimal<_Float64, _Float32> ();
+#endif
+#if __HAVE_FLOAT64
+  check_type_minimal<_Float64, _Float64> ();
+#endif
+#if __HAVE_FLOAT64 && __HAVE_FLOAT128
+  check_type_minimal<_Float64, _Float128> ();
+#endif
+#if __HAVE_FLOAT64 && __HAVE_FLOAT32X
+  check_type_minimal<_Float64, _Float32x> ();
+#endif
+#if __HAVE_FLOAT64 && __HAVE_FLOAT64X
+  check_type_minimal<_Float64, _Float64x> ();
+#endif
+#if __HAVE_FLOAT64 && __HAVE_FLOAT128X
+  check_type_minimal<_Float64, _Float128x> ();
+#endif
+#if __HAVE_FLOAT128
+  check_type_minimal<_Float128, float> ();
+#endif
+#if __HAVE_FLOAT128
+  check_type_minimal<_Float128, double> ();
+#endif
+#if __HAVE_FLOAT128 && LDBL_MANT_DIG != 106
+  check_type_minimal<_Float128, long double> ();
+#endif
+#if __HAVE_FLOAT128 && __HAVE_FLOAT16
+  check_type_minimal<_Float128, _Float16> ();
+#endif
+#if __HAVE_FLOAT128 && __HAVE_FLOAT32
+  check_type_minimal<_Float128, _Float32> ();
+#endif
+#if __HAVE_FLOAT128 && __HAVE_FLOAT64
+  check_type_minimal<_Float128, _Float64> ();
+#endif
+#if __HAVE_FLOAT128
+  check_type_minimal<_Float128, _Float128> ();
+#endif
+#if __HAVE_FLOAT128 && __HAVE_FLOAT32X
+  check_type_minimal<_Float128, _Float32x> ();
+#endif
+#if __HAVE_FLOAT128 && __HAVE_FLOAT64X
+  check_type_minimal<_Float128, _Float64x> ();
+#endif
+#if __HAVE_FLOAT128 && __HAVE_FLOAT128X
+  check_type_minimal<_Float128, _Float128x> ();
+#endif
+#if __HAVE_FLOAT32X
+  check_type_minimal<_Float32x, float> ();
+#endif
+#if __HAVE_FLOAT32X
+  check_type_minimal<_Float32x, double> ();
+#endif
+#if __HAVE_FLOAT32X
+  check_type_minimal<_Float32x, long double> ();
+#endif
+#if __HAVE_FLOAT32X && __HAVE_FLOAT16
+  check_type_minimal<_Float32x, _Float16> ();
+#endif
+#if __HAVE_FLOAT32X && __HAVE_FLOAT32
+  check_type_minimal<_Float32x, _Float32> ();
+#endif
+#if __HAVE_FLOAT32X && __HAVE_FLOAT64
+  check_type_minimal<_Float32x, _Float64> ();
+#endif
+#if __HAVE_FLOAT32X && __HAVE_FLOAT128
+  check_type_minimal<_Float32x, _Float128> ();
+#endif
+#if __HAVE_FLOAT32X
+  check_type_minimal<_Float32x, _Float32x> ();
+#endif
+#if __HAVE_FLOAT32X && __HAVE_FLOAT64X
+  check_type_minimal<_Float32x, _Float64x> ();
+#endif
+#if __HAVE_FLOAT32X && __HAVE_FLOAT128X
+  check_type_minimal<_Float32x, _Float128x> ();
+#endif
+#if __HAVE_FLOAT64X
+  check_type_minimal<_Float64x, float> ();
+#endif
+#if __HAVE_FLOAT64X
+  check_type_minimal<_Float64x, double> ();
+#endif
+#if __HAVE_FLOAT64X && LDBL_MANT_DIG != 106
+  check_type_minimal<_Float64x, long double> ();
+#endif
+#if __HAVE_FLOAT64X && __HAVE_FLOAT16
+  check_type_minimal<_Float64x, _Float16> ();
+#endif
+#if __HAVE_FLOAT64X && __HAVE_FLOAT32
+  check_type_minimal<_Float64x, _Float32> ();
+#endif
+#if __HAVE_FLOAT64X && __HAVE_FLOAT64
+  check_type_minimal<_Float64x, _Float64> ();
+#endif
+#if __HAVE_FLOAT64X && __HAVE_FLOAT128
+  check_type_minimal<_Float64x, _Float128> ();
+#endif
+#if __HAVE_FLOAT64X && __HAVE_FLOAT32X
+  check_type_minimal<_Float64x, _Float32x> ();
+#endif
+#if __HAVE_FLOAT64X
+  check_type_minimal<_Float64x, _Float64x> ();
+#endif
+#if __HAVE_FLOAT64X && __HAVE_FLOAT128X
+  check_type_minimal<_Float64x, _Float128x> ();
+#endif
+#if __HAVE_FLOAT128X
+  check_type_minimal<_Float128x, float> ();
+#endif
+#if __HAVE_FLOAT128X
+  check_type_minimal<_Float128x, double> ();
+#endif
+#if __HAVE_FLOAT128X && LDBL_MANT_DIG != 106
+  check_type_minimal<_Float128x, long double> ();
+#endif
+#if __HAVE_FLOAT128X && __HAVE_FLOAT16
+  check_type_minimal<_Float128x, _Float16> ();
+#endif
+#if __HAVE_FLOAT128X && __HAVE_FLOAT32
+  check_type_minimal<_Float128x, _Float32> ();
+#endif
+#if __HAVE_FLOAT128X && __HAVE_FLOAT64
+  check_type_minimal<_Float128x, _Float64> ();
+#endif
+#if __HAVE_FLOAT128X && __HAVE_FLOAT128
+  check_type_minimal<_Float128x, _Float128> ();
+#endif
+#if __HAVE_FLOAT128X && __HAVE_FLOAT32X
+  check_type_minimal<_Float128x, _Float32x> ();
+#endif
+#if __HAVE_FLOAT128X && __HAVE_FLOAT64X
+  check_type_minimal<_Float128x, _Float64x> ();
+#endif
+#if __HAVE_FLOAT128X
+  check_type_minimal<_Float128x, _Float128x> ();
+#endif
+
   return 0;
 }
 
index 5507038bc78706451508dc0572df108a3be4da23..75f7547045ae044f566cd0ff05ffdf03e913d7a4 100644 (file)
@@ -56,7 +56,7 @@
 /* Defined to concatenate the literal suffix to be used with _Float128
    types, if __HAVE_FLOAT128 is 1. */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* The literal suffix f128 exists only since GCC 7.0.  */
 #   define __f128(x) x##q
 #  else
@@ -66,7 +66,7 @@
 
 /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.  */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* Add a typedef for older GCC compilers which don't natively support
    _Complex _Float128.  */
 typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
@@ -80,7 +80,7 @@ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
 # if __HAVE_FLOAT128
 
 /* The type _Float128 exists only since GCC 7.0.  */
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef __float128 _Float128;
 #  endif
 
index 9ae7b3037379b3c9d8e50d63db1ef52a4f793188..6ef60a3c9b69f1cfefbd526355bb3e6b1cfeec57 100644 (file)
@@ -55,7 +55,7 @@
 /* Defined to concatenate the literal suffix to be used with _Float128
    types, if __HAVE_FLOAT128 is 1. */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* The literal suffix f128 exists only since GCC 7.0.  */
 #   define __f128(x) x##l
 #  else
@@ -65,7 +65,7 @@
 
 /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.  */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   define __CFLOAT128 _Complex long double
 #  else
 #   define __CFLOAT128 _Complex _Float128
@@ -76,7 +76,7 @@
 # if __HAVE_FLOAT128
 
 /* The type _Float128 exists only since GCC 7.0.  */
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef long double _Float128;
 #  endif
 
index 1d51db04c768e3be9e0ea18e27c5193bd801c453..f0321eb010d2e08a65fa8539bbe8dc6a4dc9ceba 100644 (file)
@@ -55,7 +55,7 @@
 /* Defined to concatenate the literal suffix to be used with _Float128
    types, if __HAVE_FLOAT128 is 1. */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* The literal suffix f128 exists only since GCC 7.0.  */
 #   define __f128(x) x##l
 #  else
@@ -65,7 +65,7 @@
 
 /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.  */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 #   define __CFLOAT128 _Complex long double
 #  else
 #   define __CFLOAT128 _Complex _Float128
@@ -76,7 +76,7 @@
 # if __HAVE_FLOAT128
 
 /* The type _Float128 exists only since GCC 7.0.  */
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef long double _Float128;
 #  endif
 
index f0196b7659f3585724b003bf14ea5c0818c67abf..a25a0ab1f1a1b52b986c43035060805c62a2577e 100644 (file)
@@ -57,7 +57,7 @@
 /* Defined to concatenate the literal suffix to be used with _Float128
    types, if __HAVE_FLOAT128 is 1. */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* The literal suffix (f128) exist for powerpc only since GCC 7.0.  */
 #   if __LDBL_MANT_DIG__ == 113
 #    define __f128(x) x##l
 
 /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.  */
 # if __HAVE_FLOAT128
-#  if __LDBL_MANT_DIG__ == 113 && defined __cplusplus
+#  if __LDBL_MANT_DIG__ == 113 && defined __cplusplus && !__GNUC_PREREQ (13, 0)
 typedef long double _Float128;
 #   define __CFLOAT128 _Complex long double
-#  elif !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  elif !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* The type _Float128 exist for powerpc only since GCC 7.0.  */
 typedef __float128 _Float128;
 /* Add a typedef for older GCC and C++ compilers which don't natively support
index 247af314e87fbf46bf0adb5f4233f13166703642..84b7964a0fc225a6ef9abf20124d091ce2e86e48 100644 (file)
@@ -59,7 +59,7 @@
 /* Defined to concatenate the literal suffix to be used with _Float128
    types, if __HAVE_FLOAT128 is 1. */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* The literal suffix f128 exists only since GCC 7.0.  */
 #   define __f128(x) x##q
 #  else
@@ -69,7 +69,7 @@
 
 /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.  */
 # if __HAVE_FLOAT128
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 /* Add a typedef for older GCC compilers which don't natively support
    _Complex _Float128.  */
 typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
@@ -83,7 +83,7 @@ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
 # if __HAVE_FLOAT128
 
 /* The type _Float128 exists only since GCC 7.0.  */
-#  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
+#  if !__GNUC_PREREQ (7, 0) || (defined __cplusplus && !__GNUC_PREREQ (13, 0))
 typedef __float128 _Float128;
 #  endif