Re: [PATCH] libgfortran: Switch some more __float128 uses to _Float128

2022-06-29 Thread Tobias Burnus

On 29.06.22 14:15, Jakub Jelinek via Fortran wrote:

My patch apparently left some __float128 uses in libgfortran
that could use _Float128 instead, the following patch changes that.

Ok for trunk?


LGTM. Thanks!

Tobias


2022-06-29  Jakub Jelinek  

  * mk-kinds-h.sh: Change __float128 to _Float128 in a comment.
  * acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Adjust comment.
  (LIBGFOR_CHECK_MATH_IEEE128): Use _Float128 instead of __float128.
  * libgfortran.h (isnan): Change __float128 to _Float128 in a comment.
  (__acoshieee128, __acosieee128, __asinhieee128, __asinieee128,
  __atan2ieee128, __atanhieee128, __atanieee128, __copysignieee128,
  __coshieee128, __cosieee128, __erfcieee128, __erfieee128,
  __expieee128, __fabsieee128, __fmaieee128, __fmodieee128, __jnieee128,
  __log10ieee128, __logieee128, __powieee128, __sinhieee128,
  __sinieee128, __sqrtieee128, __tanhieee128, __tanieee128,
  __ynieee128, __strtoieee128): Use _Float128 instead of __float128.
  * configure: Regenerated.

--- libgfortran/mk-kinds-h.sh.jj  2022-06-28 13:14:45.334799175 +0200
+++ libgfortran/mk-kinds-h.sh 2022-06-29 14:01:32.935361103 +0200
@@ -67,7 +67,7 @@ for k in $possible_real_kinds; do
8) ctype="double" ; cplxtype="complex double" ; suffix="" ;;
# If we have a REAL(KIND=10), it is always long double
10) ctype="long double" ; cplxtype="complex long double" ; suffix="l" ;;
-  # If we have a REAL(KIND=16), it is either long double or __float128
+  # 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 _Float128"
--- libgfortran/acinclude.m4.jj   2022-06-29 11:45:19.286551469 +0200
+++ libgfortran/acinclude.m4  2022-06-29 14:00:22.964279364 +0200
@@ -261,7 +261,7 @@ __mingw_snprintf (NULL, 0, "%d\n", 1);
fi
  ])

-dnl Check whether we have a __float128 type
+dnl Check whether we have a __float128 and _Float128 type
  AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
LIBQUADSPEC=
LIBQUADLIB=
@@ -537,8 +537,8 @@ AC_DEFUN([LIBGFOR_CHECK_MATH_IEEE128],
AC_REQUIRE([GCC_CHECK_MATH_HEADERS])
AC_CACHE_CHECK([for $1], [gcc_cv_math_func_$1],
   [AC_LINK_IFELSE([AC_LANG_SOURCE([
-__float128 $1 (__float128);
-__float128 (*ptr)(__float128) = $1;
+_Float128 $1 (_Float128);
+_Float128 (*ptr)(_Float128) = $1;

  int
  main ()
--- libgfortran/libgfortran.h.jj  2022-06-28 13:14:45.333799188 +0200
+++ libgfortran/libgfortran.h 2022-06-29 14:01:14.364604813 +0200
@@ -247,7 +247,7 @@ extern int __mingw_snprintf (char *, siz

 Another advantage for GCC's builtins for these type-generic macros
 is that it handles floating-point types that the system headers
-   may not support (like __float128).  */
+   may not support (like _Float128).  */

  #undef isnan
  #define isnan(x) __builtin_isnan(x)
@@ -1960,59 +1960,59 @@ internal_proto(cshift1_16_c17);

  /* Prototypes for the POWER __ieee128 functions.  */
  #ifdef POWER_IEEE128
-extern __float128 __acoshieee128 (__float128)
+extern _Float128 __acoshieee128 (_Float128)
__attribute__ ((__nothrow__, __leaf__));
-extern __float128 __acosieee128 (__float128)
+extern _Float128 __acosieee128 (_Float128)
__attribute__ ((__nothrow__, __leaf__));
-extern __float128 __asinhieee128 (__float128)
+extern _Float128 __asinhieee128 (_Float128)
__attribute__ ((__nothrow__, __leaf__));
-extern __float128 __asinieee128 (__float128)
+extern _Float128 __asinieee128 (_Float128)
__attribute__ ((__nothrow__, __leaf__));
-extern __float128 __atan2ieee128 (__float128)
+extern _Float128 __atan2ieee128 (_Float128)
__attribute__ ((__nothrow__, __leaf__));
-extern __float128 __atanhieee128 (__float128)
+extern _Float128 __atanhieee128 (_Float128)
__attribute__ ((__nothrow__, __leaf__));
-extern __float128 __atanieee128 (__float128)
+extern _Float128 __atanieee128 (_Float128)
__attribute__ ((__nothrow__, __leaf__));
-extern __float128 __copysignieee128 (__float128, __float128)
+extern _Float128 __copysignieee128 (_Float128, _Float128)
__attribute__ ((__nothrow__, __leaf__));
-extern __float128 __coshieee128 (__float128)
+extern _Float128 __coshieee128 (_Float128)
__attribute__ ((__nothrow__, __leaf__));
-extern __float128 __cosieee128 (__float128)
+extern _Float128 __cosieee128 (_Float128)
__attribute__ ((__nothrow__, __leaf__));
-extern __float128 __erfcieee128 (__float128)
+extern _Float128 __erfcieee128 (_Float128)
__attribute__ ((__nothrow__, __leaf__));
-extern __float128 __erfieee128 (__float128)
+extern _Float128 __erfieee128 (_Float128)
__attribute__ ((__nothrow__, __leaf__));
-extern __float128 __expieee128 (__float128)
+extern _Float128 __expieee128 (_Float128)
__attribute__ ((__nothrow__, __leaf__));
-extern __float128 __fabsieee128 (__float128)
+extern _Float128 __fabsieee128 (_Float128)
__attribute__ ((__nothrow__, __leaf__));

[PATCH] libgfortran: Switch some more __float128 uses to _Float128

2022-06-29 Thread Jakub Jelinek via Gcc-patches
Hi!

My patch apparently left some __float128 uses in libgfortran
that could use _Float128 instead, the following patch changes that.

Ok for trunk?

2022-06-29  Jakub Jelinek  

* mk-kinds-h.sh: Change __float128 to _Float128 in a comment.
* acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Adjust comment.
(LIBGFOR_CHECK_MATH_IEEE128): Use _Float128 instead of __float128.
* libgfortran.h (isnan): Change __float128 to _Float128 in a comment.
(__acoshieee128, __acosieee128, __asinhieee128, __asinieee128,
__atan2ieee128, __atanhieee128, __atanieee128, __copysignieee128,
__coshieee128, __cosieee128, __erfcieee128, __erfieee128,
__expieee128, __fabsieee128, __fmaieee128, __fmodieee128, __jnieee128,
__log10ieee128, __logieee128, __powieee128, __sinhieee128,
__sinieee128, __sqrtieee128, __tanhieee128, __tanieee128,
__ynieee128, __strtoieee128): Use _Float128 instead of __float128.
* configure: Regenerated.

--- libgfortran/mk-kinds-h.sh.jj2022-06-28 13:14:45.334799175 +0200
+++ libgfortran/mk-kinds-h.sh   2022-06-29 14:01:32.935361103 +0200
@@ -67,7 +67,7 @@ for k in $possible_real_kinds; do
   8) ctype="double" ; cplxtype="complex double" ; suffix="" ;;
   # If we have a REAL(KIND=10), it is always long double
   10) ctype="long double" ; cplxtype="complex long double" ; suffix="l" ;;
-  # If we have a REAL(KIND=16), it is either long double or __float128
+  # 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 _Float128"
--- libgfortran/acinclude.m4.jj 2022-06-29 11:45:19.286551469 +0200
+++ libgfortran/acinclude.m42022-06-29 14:00:22.964279364 +0200
@@ -261,7 +261,7 @@ __mingw_snprintf (NULL, 0, "%d\n", 1);
   fi
 ])
 
-dnl Check whether we have a __float128 type
+dnl Check whether we have a __float128 and _Float128 type
 AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
   LIBQUADSPEC=
   LIBQUADLIB=
@@ -537,8 +537,8 @@ AC_DEFUN([LIBGFOR_CHECK_MATH_IEEE128],
   AC_REQUIRE([GCC_CHECK_MATH_HEADERS])
   AC_CACHE_CHECK([for $1], [gcc_cv_math_func_$1],
 [AC_LINK_IFELSE([AC_LANG_SOURCE([
-__float128 $1 (__float128);
-__float128 (*ptr)(__float128) = $1;
+_Float128 $1 (_Float128);
+_Float128 (*ptr)(_Float128) = $1;
 
 int
 main ()
--- libgfortran/libgfortran.h.jj2022-06-28 13:14:45.333799188 +0200
+++ libgfortran/libgfortran.h   2022-06-29 14:01:14.364604813 +0200
@@ -247,7 +247,7 @@ extern int __mingw_snprintf (char *, siz
 
Another advantage for GCC's builtins for these type-generic macros
is that it handles floating-point types that the system headers
-   may not support (like __float128).  */
+   may not support (like _Float128).  */
 
 #undef isnan
 #define isnan(x) __builtin_isnan(x)
@@ -1960,59 +1960,59 @@ internal_proto(cshift1_16_c17);
 
 /* Prototypes for the POWER __ieee128 functions.  */
 #ifdef POWER_IEEE128
-extern __float128 __acoshieee128 (__float128)
+extern _Float128 __acoshieee128 (_Float128)
   __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __acosieee128 (__float128)
+extern _Float128 __acosieee128 (_Float128)
   __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __asinhieee128 (__float128)
+extern _Float128 __asinhieee128 (_Float128)
   __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __asinieee128 (__float128)
+extern _Float128 __asinieee128 (_Float128)
   __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __atan2ieee128 (__float128)
+extern _Float128 __atan2ieee128 (_Float128)
   __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __atanhieee128 (__float128)
+extern _Float128 __atanhieee128 (_Float128)
   __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __atanieee128 (__float128)
+extern _Float128 __atanieee128 (_Float128)
   __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __copysignieee128 (__float128, __float128)
+extern _Float128 __copysignieee128 (_Float128, _Float128)
   __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __coshieee128 (__float128)
+extern _Float128 __coshieee128 (_Float128)
   __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __cosieee128 (__float128)
+extern _Float128 __cosieee128 (_Float128)
   __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __erfcieee128 (__float128)
+extern _Float128 __erfcieee128 (_Float128)
   __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __erfieee128 (__float128)
+extern _Float128 __erfieee128 (_Float128)
   __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __expieee128 (__float128)
+extern _Float128 __expieee128 (_Float128)
   __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __fabsieee128 (__float128)
+extern _Float128 __fabsieee128 (_Float128)
   __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __fmaieee128 (__float128, __float128, __float128)