aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2022-01-03 16:07:02 +0100
committerJakub Jelinek <jakub@redhat.com>2022-01-11 23:49:31 +0100
commita8fea8cd861d9484eb825a11264812bfe193f8ee (patch)
treeee73d165fefd7bae1dab62e71447de5bbef0bea0 /libgfortran
parent90d6f0c71d0f65118cc7c195a4c3b29e98c77cfd (diff)
downloadgcc-a8fea8cd861d9484eb825a11264812bfe193f8ee.zip
gcc-a8fea8cd861d9484eb825a11264812bfe193f8ee.tar.gz
gcc-a8fea8cd861d9484eb825a11264812bfe193f8ee.tar.bz2
Make sure the Fortran specifics have real(kind=16).
This brings the library to compile with all specific functions. It also corrects the patsubst patterns so the right files get the flags. It was necessary to manually add -D__powerpc64__ because apparently this is not set for Fortran. libgfortran/ChangeLog: * Makefile.am: Correct files for compilation flags. Add -D__powerpc64__ for Fortran sources. Get kinds.inc from grep of kinds.h and kinds-override.h. * Makefile.in: Regenerate. * config.h.in: Regenerate. * configure: Regenerate. * configure.ac: Add -mno-gnu-attribute to compile flags. * generated/_abs_c17.F90: Regenerate. * generated/_abs_r17.F90: Regenerate. * generated/_acos_r17.F90: Regenerate. * generated/_acosh_r17.F90: Regenerate. * generated/_aimag_c17.F90: Regenerate. * generated/_aint_r17.F90: Regenerate. * generated/_anint_r17.F90: Regenerate. * generated/_asin_r17.F90: Regenerate. * generated/_asinh_r17.F90: Regenerate. * generated/_atan2_r17.F90: Regenerate. * generated/_atan_r17.F90: Regenerate. * generated/_atanh_r17.F90: Regenerate. * generated/_conjg_c17.F90: Regenerate. * generated/_cos_c17.F90: Regenerate. * generated/_cos_r17.F90: Regenerate. * generated/_cosh_r17.F90: Regenerate. * generated/_dim_r17.F90: Regenerate. * generated/_exp_c17.F90: Regenerate. * generated/_exp_r17.F90: Regenerate. * generated/_log10_r17.F90: Regenerate. * generated/_log_c17.F90: Regenerate. * generated/_log_r17.F90: Regenerate. * generated/_mod_r17.F90: Regenerate. * generated/_sign_r17.F90: Regenerate. * generated/_sin_c17.F90: Regenerate. * generated/_sin_r17.F90: Regenerate. * generated/_sinh_r17.F90: Regenerate. * generated/_sqrt_c17.F90: Regenerate. * generated/_sqrt_r17.F90: Regenerate. * generated/_tan_r17.F90: Regenerate. * generated/_tanh_r17.F90: Regenerate. * kinds-override.h: Adjust to trunk. Change condition to single line so it can be grepped. * m4/specific.m4: Make sure that real=kind16 is used for _r17.F90 and _c17.F90 files. * m4/specific2.m4: Likewise.
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/Makefile.am21
-rw-r--r--libgfortran/Makefile.in21
-rw-r--r--libgfortran/config.h.in3
-rwxr-xr-xlibgfortran/configure12
-rw-r--r--libgfortran/configure.ac9
-rw-r--r--libgfortran/generated/_abs_c17.F906
-rw-r--r--libgfortran/generated/_abs_r17.F906
-rw-r--r--libgfortran/generated/_acos_r17.F906
-rw-r--r--libgfortran/generated/_acosh_r17.F906
-rw-r--r--libgfortran/generated/_aimag_c17.F904
-rw-r--r--libgfortran/generated/_aint_r17.F906
-rw-r--r--libgfortran/generated/_anint_r17.F906
-rw-r--r--libgfortran/generated/_asin_r17.F906
-rw-r--r--libgfortran/generated/_asinh_r17.F906
-rw-r--r--libgfortran/generated/_atan2_r17.F906
-rw-r--r--libgfortran/generated/_atan_r17.F906
-rw-r--r--libgfortran/generated/_atanh_r17.F906
-rw-r--r--libgfortran/generated/_conjg_c17.F904
-rw-r--r--libgfortran/generated/_cos_c17.F906
-rw-r--r--libgfortran/generated/_cos_r17.F906
-rw-r--r--libgfortran/generated/_cosh_r17.F906
-rw-r--r--libgfortran/generated/_dim_r17.F904
-rw-r--r--libgfortran/generated/_exp_c17.F906
-rw-r--r--libgfortran/generated/_exp_r17.F906
-rw-r--r--libgfortran/generated/_log10_r17.F906
-rw-r--r--libgfortran/generated/_log_c17.F906
-rw-r--r--libgfortran/generated/_log_r17.F906
-rw-r--r--libgfortran/generated/_mod_r17.F904
-rw-r--r--libgfortran/generated/_sign_r17.F904
-rw-r--r--libgfortran/generated/_sin_c17.F906
-rw-r--r--libgfortran/generated/_sin_r17.F906
-rw-r--r--libgfortran/generated/_sinh_r17.F906
-rw-r--r--libgfortran/generated/_sqrt_c17.F906
-rw-r--r--libgfortran/generated/_sqrt_r17.F906
-rw-r--r--libgfortran/generated/_tan_r17.F906
-rw-r--r--libgfortran/generated/_tanh_r17.F906
-rw-r--r--libgfortran/kinds-override.h6
-rw-r--r--libgfortran/m4/specific.m436
-rw-r--r--libgfortran/m4/specific2.m411
39 files changed, 169 insertions, 126 deletions
diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am
index 465daea..26b9eb1 100644
--- a/libgfortran/Makefile.am
+++ b/libgfortran/Makefile.am
@@ -1077,15 +1077,16 @@ $(patsubst %.F90,%.lo,$(patsubst %.f90,%.lo,$(notdir $(gfor_specific_src)))): AM
selected_real_kind.lo selected_int_kind.lo: AM_FCFLAGS += -fallow-leading-underscore
# Build *_r17.F90 and *_c17.F90 with additional -mabi=ieeelongdouble on powerpc64le-linux.
+
if HAVE_REAL_17
-$(patsubst %_r17.F90,%.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ieeelongdouble
-$(patsubst %_r17.c,%.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ieeelongdouble
-$(patsubst %_c17.F90,%.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ieeelongdouble
-$(patsubst %_c17.c,%.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ieeelongdouble
-$(patsubst %_r16.F90,%.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ibmlongdouble
-$(patsubst %_r16.c,%.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ibmlongdouble
-$(patsubst %_c16.F90,%.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ibmlongdouble
-$(patsubst %_c16.c,%.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ibmlongdouble
+$(patsubst %_r16.F90,%_r16.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ibmlongdouble
+$(patsubst %_c16.F90,%_c16.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ibmlongdouble
+$(patsubst %_r17.F90,%_r17.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ieeelongdouble -D__powerpc64__
+$(patsubst %_c17.F90,%_c17.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ieeelongdouble -D__powerpc64__
+$(patsubst %_r16.c,%_r16.lo,$(notdir $(gfor_built_src))): AM_CFLAGS += -mabi=ibmlongdouble
+$(patsubst %_c16.c,%_c16.lo,$(notdir $(gfor_built_src))): AM_CFLAGS += -mabi=ibmlongdouble
+$(patsubst %_r17.c,%_r17.lo,$(notdir $(gfor_built_src))): AM_CFLAGS += -mabi=ieeelongdouble
+$(patsubst %_c17.c,%_c17.lo,$(notdir $(gfor_built_src))): AM_CFLAGS += -mabi=ieeelongdouble
endif
if IEEE_SUPPORT
@@ -1160,8 +1161,8 @@ 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 $@
-kinds.inc: kinds.h
- grep '^#' < kinds.h > $@
+kinds.inc: kinds.h $(srcdir)/kinds-override.h
+ cat kinds.h $(srcdir)/kinds-override.h | grep '^#' | grep -v include > $@
c99_protos.inc: $(srcdir)/c99_protos.h
grep '^#' < $(srcdir)/c99_protos.h > $@
diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
index c16030f..1bfb07d 100644
--- a/libgfortran/Makefile.in
+++ b/libgfortran/Makefile.in
@@ -7630,14 +7630,15 @@ $(patsubst %.F90,%.lo,$(patsubst %.f90,%.lo,$(notdir $(gfor_specific_src)))): AM
selected_real_kind.lo selected_int_kind.lo: AM_FCFLAGS += -fallow-leading-underscore
# Build *_r17.F90 and *_c17.F90 with additional -mabi=ieeelongdouble on powerpc64le-linux.
-@HAVE_REAL_17_TRUE@$(patsubst %_r17.F90,%.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ieeelongdouble
-@HAVE_REAL_17_TRUE@$(patsubst %_r17.c,%.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ieeelongdouble
-@HAVE_REAL_17_TRUE@$(patsubst %_c17.F90,%.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ieeelongdouble
-@HAVE_REAL_17_TRUE@$(patsubst %_c17.c,%.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ieeelongdouble
-@HAVE_REAL_17_TRUE@$(patsubst %_r16.F90,%.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ibmlongdouble
-@HAVE_REAL_17_TRUE@$(patsubst %_r16.c,%.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ibmlongdouble
-@HAVE_REAL_17_TRUE@$(patsubst %_c16.F90,%.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ibmlongdouble
-@HAVE_REAL_17_TRUE@$(patsubst %_c16.c,%.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ibmlongdouble
+
+@HAVE_REAL_17_TRUE@$(patsubst %_r16.F90,%_r16.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ibmlongdouble
+@HAVE_REAL_17_TRUE@$(patsubst %_c16.F90,%_c16.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ibmlongdouble
+@HAVE_REAL_17_TRUE@$(patsubst %_r17.F90,%_r17.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ieeelongdouble -D__powerpc64__
+@HAVE_REAL_17_TRUE@$(patsubst %_c17.F90,%_c17.lo,$(notdir $(gfor_specific_src))): AM_FCFLAGS += -mabi=ieeelongdouble -D__powerpc64__
+@HAVE_REAL_17_TRUE@$(patsubst %_r16.c,%_r16.lo,$(notdir $(gfor_built_src))): AM_CFLAGS += -mabi=ibmlongdouble
+@HAVE_REAL_17_TRUE@$(patsubst %_c16.c,%_c16.lo,$(notdir $(gfor_built_src))): AM_CFLAGS += -mabi=ibmlongdouble
+@HAVE_REAL_17_TRUE@$(patsubst %_r17.c,%_r17.lo,$(notdir $(gfor_built_src))): AM_CFLAGS += -mabi=ieeelongdouble
+@HAVE_REAL_17_TRUE@$(patsubst %_c17.c,%_c17.lo,$(notdir $(gfor_built_src))): AM_CFLAGS += -mabi=ieeelongdouble
# Add flags for IEEE modules
@IEEE_SUPPORT_TRUE@$(patsubst %.F90,%.lo,$(notdir $(gfor_ieee_src))): AM_FCFLAGS += -Wno-unused-dummy-argument -Wno-c-binding-type -ffree-line-length-0 -fallow-leading-underscore -fsignaling-nans
@@ -7667,8 +7668,8 @@ ieee_arithmetic.mod: ieee_arithmetic.lo
kinds.h: $(srcdir)/mk-kinds-h.sh
$(SHELL) $(srcdir)/mk-kinds-h.sh '@LIBGOMP_CHECKED_INT_KINDS@' '@LIBGOMP_CHECKED_REAL_KINDS@' '$(FCCOMPILE)' > $@ || rm $@
-kinds.inc: kinds.h
- grep '^#' < kinds.h > $@
+kinds.inc: kinds.h $(srcdir)/kinds-override.h
+ cat kinds.h $(srcdir)/kinds-override.h | grep '^#' | grep -v include > $@
c99_protos.inc: $(srcdir)/c99_protos.h
grep '^#' < $(srcdir)/c99_protos.h > $@
diff --git a/libgfortran/config.h.in b/libgfortran/config.h.in
index 02dcf49..24e31eb 100644
--- a/libgfortran/config.h.in
+++ b/libgfortran/config.h.in
@@ -663,6 +663,9 @@
/* Define to 1 if you have the <pwd.h> header file. */
#undef HAVE_PWD_H
+/* Define to 1 if you have REAL(KIND=17) */
+#undef HAVE_REAL_17
+
/* Define to 1 if you have the `round' function. */
#undef HAVE_ROUND
diff --git a/libgfortran/configure b/libgfortran/configure
index 5331285..ae64dca 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -6013,9 +6013,9 @@ main ()
}
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
- AM_FCFLAGS="$AM_FCFLAGS -mabi=ibmlongdouble";
- AM_CFLAGS="$AM_CFLAGS -mabi=ibmlongdouble";
- CFLAGS="$CFLAGS -mabi=ibmlongdouble";
+ AM_FCFLAGS="$AM_FCFLAGS -mabi=ibmlongdouble -mno-gnu-attribute";
+ AM_CFLAGS="$AM_CFLAGS -mabi=ibmlongdouble -mno-gnu-attribute";
+ CFLAGS="$CFLAGS -mabi=ibmlongdouble -mno-gnu-attribute";
have_real_17=yes
fi
rm -f conftest.err conftest.i conftest.$ac_ext
@@ -25838,6 +25838,12 @@ _ACEOF
if test "x$have_real_17" = "xyes"; then
+cat >>confdefs.h <<_ACEOF
+#define HAVE_REAL_17 1
+_ACEOF
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __acoshieee128" >&5
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index 39f38ba..97cc490 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -163,9 +163,9 @@ if test "x$GCC" = "xyes"; then
#error long double is double
#endif]],
[[(void) 0;]])],
- [AM_FCFLAGS="$AM_FCFLAGS -mabi=ibmlongdouble";
- AM_CFLAGS="$AM_CFLAGS -mabi=ibmlongdouble";
- CFLAGS="$CFLAGS -mabi=ibmlongdouble";
+ [AM_FCFLAGS="$AM_FCFLAGS -mabi=ibmlongdouble -mno-gnu-attribute";
+ AM_CFLAGS="$AM_CFLAGS -mabi=ibmlongdouble -mno-gnu-attribute";
+ CFLAGS="$CFLAGS -mabi=ibmlongdouble -mno-gnu-attribute";
have_real_17=yes])
;;
*)
@@ -547,6 +547,9 @@ GCC_CHECK_MATH_FUNC([catanl])
# For POWER, check the ieee128 math functions
if test "x$have_real_17" = "xyes"; then
+AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_REAL_17),[1],
+ [Define to 1 if you have REAL(KIND=17)])
+
LIBGFOR_CHECK_MATH_IEEE128([__acoshieee128])
LIBGFOR_CHECK_MATH_IEEE128([__acosieee128])
LIBGFOR_CHECK_MATH_IEEE128([__asinhieee128])
diff --git a/libgfortran/generated/_abs_c17.F90 b/libgfortran/generated/_abs_c17.F90
index 3c186a2..d450e3c 100644
--- a/libgfortran/generated/_abs_c17.F90
+++ b/libgfortran/generated/_abs_c17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_COMPLEX_17)
-#ifdef HAVE_CABS_17
+#ifdef HAVE_CABSL
elemental function _gfortran_specific__abs_c17 (parm)
- complex (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__abs_c17
+ complex (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__abs_c17
_gfortran_specific__abs_c17 = abs (parm)
end function
diff --git a/libgfortran/generated/_abs_r17.F90 b/libgfortran/generated/_abs_r17.F90
index bc8f3eb..075f7ac 100644
--- a/libgfortran/generated/_abs_r17.F90
+++ b/libgfortran/generated/_abs_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_FABS_17
+#ifdef HAVE_FABSL
elemental function _gfortran_specific__abs_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__abs_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__abs_r17
_gfortran_specific__abs_r17 = abs (parm)
end function
diff --git a/libgfortran/generated/_acos_r17.F90 b/libgfortran/generated/_acos_r17.F90
index f9e928c..8a1cbde 100644
--- a/libgfortran/generated/_acos_r17.F90
+++ b/libgfortran/generated/_acos_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_ACOS_17
+#ifdef HAVE_ACOSL
elemental function _gfortran_specific__acos_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__acos_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__acos_r17
_gfortran_specific__acos_r17 = acos (parm)
end function
diff --git a/libgfortran/generated/_acosh_r17.F90 b/libgfortran/generated/_acosh_r17.F90
index 4508691..fc6f931 100644
--- a/libgfortran/generated/_acosh_r17.F90
+++ b/libgfortran/generated/_acosh_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_ACOSH_17
+#ifdef HAVE_ACOSHL
elemental function _gfortran_specific__acosh_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__acosh_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__acosh_r17
_gfortran_specific__acosh_r17 = acosh (parm)
end function
diff --git a/libgfortran/generated/_aimag_c17.F90 b/libgfortran/generated/_aimag_c17.F90
index b5a84fa..fb24cc6 100644
--- a/libgfortran/generated/_aimag_c17.F90
+++ b/libgfortran/generated/_aimag_c17.F90
@@ -36,8 +36,8 @@
elemental function _gfortran_specific__aimag_c17 (parm)
- complex (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__aimag_c17
+ complex (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__aimag_c17
_gfortran_specific__aimag_c17 = aimag (parm)
end function
diff --git a/libgfortran/generated/_aint_r17.F90 b/libgfortran/generated/_aint_r17.F90
index 4e73b24..e96e755 100644
--- a/libgfortran/generated/_aint_r17.F90
+++ b/libgfortran/generated/_aint_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_TRUNC_17
+#ifdef HAVE_TRUNCL
elemental function _gfortran_specific__aint_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__aint_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__aint_r17
_gfortran_specific__aint_r17 = aint (parm)
end function
diff --git a/libgfortran/generated/_anint_r17.F90 b/libgfortran/generated/_anint_r17.F90
index 6b60e11..c38a0b6 100644
--- a/libgfortran/generated/_anint_r17.F90
+++ b/libgfortran/generated/_anint_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_ROUND_17
+#ifdef HAVE_ROUNDL
elemental function _gfortran_specific__anint_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__anint_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__anint_r17
_gfortran_specific__anint_r17 = anint (parm)
end function
diff --git a/libgfortran/generated/_asin_r17.F90 b/libgfortran/generated/_asin_r17.F90
index 120be04..aee1f7e 100644
--- a/libgfortran/generated/_asin_r17.F90
+++ b/libgfortran/generated/_asin_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_ASIN_17
+#ifdef HAVE_ASINL
elemental function _gfortran_specific__asin_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__asin_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__asin_r17
_gfortran_specific__asin_r17 = asin (parm)
end function
diff --git a/libgfortran/generated/_asinh_r17.F90 b/libgfortran/generated/_asinh_r17.F90
index 64f18d2..0ccb9b0 100644
--- a/libgfortran/generated/_asinh_r17.F90
+++ b/libgfortran/generated/_asinh_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_ASINH_17
+#ifdef HAVE_ASINHL
elemental function _gfortran_specific__asinh_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__asinh_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__asinh_r17
_gfortran_specific__asinh_r17 = asinh (parm)
end function
diff --git a/libgfortran/generated/_atan2_r17.F90 b/libgfortran/generated/_atan2_r17.F90
index f0fc9b8..87a9dba 100644
--- a/libgfortran/generated/_atan2_r17.F90
+++ b/libgfortran/generated/_atan2_r17.F90
@@ -32,11 +32,11 @@
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_ATAN2_17
+#ifdef HAVE_ATAN2L
elemental function _gfortran_specific__atan2_r17 (p1, p2)
- real (kind=17), intent (in) :: p1, p2
- real (kind=17) :: _gfortran_specific__atan2_r17
+ real (kind=16), intent (in) :: p1, p2
+ real (kind=16) :: _gfortran_specific__atan2_r17
_gfortran_specific__atan2_r17 = atan2 (p1, p2)
end function
diff --git a/libgfortran/generated/_atan_r17.F90 b/libgfortran/generated/_atan_r17.F90
index a8b0bbd..72eb76f 100644
--- a/libgfortran/generated/_atan_r17.F90
+++ b/libgfortran/generated/_atan_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_ATAN_17
+#ifdef HAVE_ATANL
elemental function _gfortran_specific__atan_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__atan_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__atan_r17
_gfortran_specific__atan_r17 = atan (parm)
end function
diff --git a/libgfortran/generated/_atanh_r17.F90 b/libgfortran/generated/_atanh_r17.F90
index dc4d8a3..9ea2735 100644
--- a/libgfortran/generated/_atanh_r17.F90
+++ b/libgfortran/generated/_atanh_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_ATANH_17
+#ifdef HAVE_ATANHL
elemental function _gfortran_specific__atanh_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__atanh_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__atanh_r17
_gfortran_specific__atanh_r17 = atanh (parm)
end function
diff --git a/libgfortran/generated/_conjg_c17.F90 b/libgfortran/generated/_conjg_c17.F90
index 86a237c..5e6c2c4 100644
--- a/libgfortran/generated/_conjg_c17.F90
+++ b/libgfortran/generated/_conjg_c17.F90
@@ -36,8 +36,8 @@
elemental function _gfortran_specific__conjg_17 (parm)
- complex (kind=17), intent (in) :: parm
- complex (kind=17) :: _gfortran_specific__conjg_17
+ complex (kind=16), intent (in) :: parm
+ complex (kind=16) :: _gfortran_specific__conjg_17
_gfortran_specific__conjg_17 = conjg (parm)
end function
diff --git a/libgfortran/generated/_cos_c17.F90 b/libgfortran/generated/_cos_c17.F90
index 8d50ac8..2241ece 100644
--- a/libgfortran/generated/_cos_c17.F90
+++ b/libgfortran/generated/_cos_c17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_COMPLEX_17)
-#ifdef HAVE_CCOS_17
+#ifdef HAVE_CCOSL
elemental function _gfortran_specific__cos_c17 (parm)
- complex (kind=17), intent (in) :: parm
- complex (kind=17) :: _gfortran_specific__cos_c17
+ complex (kind=16), intent (in) :: parm
+ complex (kind=16) :: _gfortran_specific__cos_c17
_gfortran_specific__cos_c17 = cos (parm)
end function
diff --git a/libgfortran/generated/_cos_r17.F90 b/libgfortran/generated/_cos_r17.F90
index fde038e..60dfac5 100644
--- a/libgfortran/generated/_cos_r17.F90
+++ b/libgfortran/generated/_cos_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_COS_17
+#ifdef HAVE_COSL
elemental function _gfortran_specific__cos_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__cos_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__cos_r17
_gfortran_specific__cos_r17 = cos (parm)
end function
diff --git a/libgfortran/generated/_cosh_r17.F90 b/libgfortran/generated/_cosh_r17.F90
index c8fe7c8..81e3498 100644
--- a/libgfortran/generated/_cosh_r17.F90
+++ b/libgfortran/generated/_cosh_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_COSH_17
+#ifdef HAVE_COSHL
elemental function _gfortran_specific__cosh_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__cosh_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__cosh_r17
_gfortran_specific__cosh_r17 = cosh (parm)
end function
diff --git a/libgfortran/generated/_dim_r17.F90 b/libgfortran/generated/_dim_r17.F90
index d4b78c1..cbb5f6f 100644
--- a/libgfortran/generated/_dim_r17.F90
+++ b/libgfortran/generated/_dim_r17.F90
@@ -35,8 +35,8 @@
elemental function _gfortran_specific__dim_r17 (p1, p2)
- real (kind=17), intent (in) :: p1, p2
- real (kind=17) :: _gfortran_specific__dim_r17
+ real (kind=16), intent (in) :: p1, p2
+ real (kind=16) :: _gfortran_specific__dim_r17
_gfortran_specific__dim_r17 = dim (p1, p2)
end function
diff --git a/libgfortran/generated/_exp_c17.F90 b/libgfortran/generated/_exp_c17.F90
index a2672a4..fb13939 100644
--- a/libgfortran/generated/_exp_c17.F90
+++ b/libgfortran/generated/_exp_c17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_COMPLEX_17)
-#ifdef HAVE_CEXP_17
+#ifdef HAVE_CEXPL
elemental function _gfortran_specific__exp_c17 (parm)
- complex (kind=17), intent (in) :: parm
- complex (kind=17) :: _gfortran_specific__exp_c17
+ complex (kind=16), intent (in) :: parm
+ complex (kind=16) :: _gfortran_specific__exp_c17
_gfortran_specific__exp_c17 = exp (parm)
end function
diff --git a/libgfortran/generated/_exp_r17.F90 b/libgfortran/generated/_exp_r17.F90
index 14cac70..c03986b 100644
--- a/libgfortran/generated/_exp_r17.F90
+++ b/libgfortran/generated/_exp_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_EXP_17
+#ifdef HAVE_EXPL
elemental function _gfortran_specific__exp_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__exp_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__exp_r17
_gfortran_specific__exp_r17 = exp (parm)
end function
diff --git a/libgfortran/generated/_log10_r17.F90 b/libgfortran/generated/_log10_r17.F90
index ef3481a..8612360 100644
--- a/libgfortran/generated/_log10_r17.F90
+++ b/libgfortran/generated/_log10_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_LOG10_17
+#ifdef HAVE_LOG10L
elemental function _gfortran_specific__log10_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__log10_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__log10_r17
_gfortran_specific__log10_r17 = log10 (parm)
end function
diff --git a/libgfortran/generated/_log_c17.F90 b/libgfortran/generated/_log_c17.F90
index 65c758d..c2f2858 100644
--- a/libgfortran/generated/_log_c17.F90
+++ b/libgfortran/generated/_log_c17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_COMPLEX_17)
-#ifdef HAVE_CLOG_17
+#ifdef HAVE_CLOGL
elemental function _gfortran_specific__log_c17 (parm)
- complex (kind=17), intent (in) :: parm
- complex (kind=17) :: _gfortran_specific__log_c17
+ complex (kind=16), intent (in) :: parm
+ complex (kind=16) :: _gfortran_specific__log_c17
_gfortran_specific__log_c17 = log (parm)
end function
diff --git a/libgfortran/generated/_log_r17.F90 b/libgfortran/generated/_log_r17.F90
index 95cc9ef..7355bc8 100644
--- a/libgfortran/generated/_log_r17.F90
+++ b/libgfortran/generated/_log_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_LOG_17
+#ifdef HAVE_LOGL
elemental function _gfortran_specific__log_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__log_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__log_r17
_gfortran_specific__log_r17 = log (parm)
end function
diff --git a/libgfortran/generated/_mod_r17.F90 b/libgfortran/generated/_mod_r17.F90
index 2397395..f174bcc 100644
--- a/libgfortran/generated/_mod_r17.F90
+++ b/libgfortran/generated/_mod_r17.F90
@@ -35,8 +35,8 @@
elemental function _gfortran_specific__mod_r17 (p1, p2)
- real (kind=17), intent (in) :: p1, p2
- real (kind=17) :: _gfortran_specific__mod_r17
+ real (kind=16), intent (in) :: p1, p2
+ real (kind=16) :: _gfortran_specific__mod_r17
_gfortran_specific__mod_r17 = mod (p1, p2)
end function
diff --git a/libgfortran/generated/_sign_r17.F90 b/libgfortran/generated/_sign_r17.F90
index d8afb5e..2253140 100644
--- a/libgfortran/generated/_sign_r17.F90
+++ b/libgfortran/generated/_sign_r17.F90
@@ -35,8 +35,8 @@
elemental function _gfortran_specific__sign_r17 (p1, p2)
- real (kind=17), intent (in) :: p1, p2
- real (kind=17) :: _gfortran_specific__sign_r17
+ real (kind=16), intent (in) :: p1, p2
+ real (kind=16) :: _gfortran_specific__sign_r17
_gfortran_specific__sign_r17 = sign (p1, p2)
end function
diff --git a/libgfortran/generated/_sin_c17.F90 b/libgfortran/generated/_sin_c17.F90
index 6453ec7..2f7d187 100644
--- a/libgfortran/generated/_sin_c17.F90
+++ b/libgfortran/generated/_sin_c17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_COMPLEX_17)
-#ifdef HAVE_CSIN_17
+#ifdef HAVE_CSINL
elemental function _gfortran_specific__sin_c17 (parm)
- complex (kind=17), intent (in) :: parm
- complex (kind=17) :: _gfortran_specific__sin_c17
+ complex (kind=16), intent (in) :: parm
+ complex (kind=16) :: _gfortran_specific__sin_c17
_gfortran_specific__sin_c17 = sin (parm)
end function
diff --git a/libgfortran/generated/_sin_r17.F90 b/libgfortran/generated/_sin_r17.F90
index 8632c4d..7b02e79 100644
--- a/libgfortran/generated/_sin_r17.F90
+++ b/libgfortran/generated/_sin_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_SIN_17
+#ifdef HAVE_SINL
elemental function _gfortran_specific__sin_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__sin_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__sin_r17
_gfortran_specific__sin_r17 = sin (parm)
end function
diff --git a/libgfortran/generated/_sinh_r17.F90 b/libgfortran/generated/_sinh_r17.F90
index bfe0f2a..43ac460 100644
--- a/libgfortran/generated/_sinh_r17.F90
+++ b/libgfortran/generated/_sinh_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_SINH_17
+#ifdef HAVE_SINHL
elemental function _gfortran_specific__sinh_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__sinh_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__sinh_r17
_gfortran_specific__sinh_r17 = sinh (parm)
end function
diff --git a/libgfortran/generated/_sqrt_c17.F90 b/libgfortran/generated/_sqrt_c17.F90
index 5878b87..13d6d83 100644
--- a/libgfortran/generated/_sqrt_c17.F90
+++ b/libgfortran/generated/_sqrt_c17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_COMPLEX_17)
-#ifdef HAVE_CSQRT_17
+#ifdef HAVE_CSQRTL
elemental function _gfortran_specific__sqrt_c17 (parm)
- complex (kind=17), intent (in) :: parm
- complex (kind=17) :: _gfortran_specific__sqrt_c17
+ complex (kind=16), intent (in) :: parm
+ complex (kind=16) :: _gfortran_specific__sqrt_c17
_gfortran_specific__sqrt_c17 = sqrt (parm)
end function
diff --git a/libgfortran/generated/_sqrt_r17.F90 b/libgfortran/generated/_sqrt_r17.F90
index 01c3a04..eb98dda 100644
--- a/libgfortran/generated/_sqrt_r17.F90
+++ b/libgfortran/generated/_sqrt_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_SQRT_17
+#ifdef HAVE_SQRTL
elemental function _gfortran_specific__sqrt_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__sqrt_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__sqrt_r17
_gfortran_specific__sqrt_r17 = sqrt (parm)
end function
diff --git a/libgfortran/generated/_tan_r17.F90 b/libgfortran/generated/_tan_r17.F90
index 01f1bfa..50b55d2 100644
--- a/libgfortran/generated/_tan_r17.F90
+++ b/libgfortran/generated/_tan_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_TAN_17
+#ifdef HAVE_TANL
elemental function _gfortran_specific__tan_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__tan_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__tan_r17
_gfortran_specific__tan_r17 = tan (parm)
end function
diff --git a/libgfortran/generated/_tanh_r17.F90 b/libgfortran/generated/_tanh_r17.F90
index e04aae3..5a3eee8 100644
--- a/libgfortran/generated/_tanh_r17.F90
+++ b/libgfortran/generated/_tanh_r17.F90
@@ -33,11 +33,11 @@
#include "c99_protos.inc"
#if defined (HAVE_GFC_REAL_17)
-#ifdef HAVE_TANH_17
+#ifdef HAVE_TANHL
elemental function _gfortran_specific__tanh_r17 (parm)
- real (kind=17), intent (in) :: parm
- real (kind=17) :: _gfortran_specific__tanh_r17
+ real (kind=16), intent (in) :: parm
+ real (kind=16) :: _gfortran_specific__tanh_r17
_gfortran_specific__tanh_r17 = tanh (parm)
end function
diff --git a/libgfortran/kinds-override.h b/libgfortran/kinds-override.h
index efae0d0..d1456c2 100644
--- a/libgfortran/kinds-override.h
+++ b/libgfortran/kinds-override.h
@@ -29,10 +29,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# error "Where has __float128 gone?"
#endif
-#if defined(__powerpc64__) \
- && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ \
- && __SIZEOF_LONG_DOUBLE__ == 16 \
- && defined(GFC_REAL_16_IS_LONG_DOUBLE)
+/* 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;
#define HAVE_GFC_REAL_17
diff --git a/libgfortran/m4/specific.m4 b/libgfortran/m4/specific.m4
index ebc8983..75d916e 100644
--- a/libgfortran/m4/specific.m4
+++ b/libgfortran/m4/specific.m4
@@ -4,13 +4,28 @@ define(atype_letter,substr(atype_code, 0, 1))dnl
define(atype_kind,substr(atype_code, 1))dnl
define(get_typename2, `$1 (kind=$2)')dnl
define(get_typename, `get_typename2(ifelse($1,i,integer,ifelse($1,r,real,ifelse($1,l,logical,ifelse($1,c,complex,unknown)))),`$2')')dnl
-define(atype_name, get_typename(atype_letter,atype_kind))dnl
+dnl
+dnl KIND=17 is special: This is just a naming convention
+dnl in the library, for Fortran source code KIND=16 is needed
+dnl
+define(name_kind, ifelse(atype_kind,17,16,atype_kind))dnl
+define(atype_name, get_typename(atype_letter,name_kind))dnl
define(name, regexp(regexp(file, `[^/]*$', `\&'), `^_\([^_]*\)_', `\1'))dnl
-define(rtype_name,get_typename(ifelse(name,abs,ifelse(atype_letter,c,r,atype_letter),ifelse(name,aimag,ifelse(atype_letter,c,r,atype_letter),atype_letter)),atype_kind))dnl
-define(function_name,ifelse(name,conjg,`_gfortran_specific__conjg_'atype_kind,`_gfortran_specific__'name`_'atype_code))dnl
+define(rtype_name,get_typename(ifelse(name,abs,ifelse(atype_letter,c,r,atype_letter),ifelse(name,aimag,ifelse(atype_letter,c,r,atype_letter),atype_letter)),name_kind))dnl
+define(function_name,dnl
+ifelse(name,conjg,`_gfortran_specific__conjg_'atype_kind,`_gfortran_specific__'name`_'atype_code))dnl
-define(type,ifelse(atype_letter,l,LOGICAL,ifelse(atype_letter,i,INTEGER,ifelse(atype_letter,r,REAL,ifelse(atype_letter,c,COMPLEX,UNKNOW)))))dnl
-define(Q,ifelse(atype_kind,4,F,ifelse(atype_kind,8,`',ifelse(atype_kind,10,L,ifelse(atype_kind,16,L,`_'atype_kind)))))dnl
+define(type,dnl
+ifelse(atype_letter,l,LOGICAL,dnl
+ifelse(atype_letter,i,INTEGER,dnl
+ifelse(atype_letter,r,REAL,dnl
+ifelse(atype_letter,c,COMPLEX,UNKNOW)))))dnl
+define(Q,ifelse(atype_kind,4,F,
+ifelse(atype_kind,8,`',
+ifelse(atype_kind,10,L,
+ifelse(atype_kind,16,L,
+ifelse(atype_kind,17,L,
+`_'atype_kind))))))dnl
dnl A few specifics require a function other than their name, or
dnl nothing. The list is currently:
@@ -18,7 +33,16 @@ dnl - integer and logical specifics require no libm function
dnl - AINT requires the trunc() family functions
dnl - ANINT requires round()
dnl - AIMAG, CONJG, DIM, SIGN require no libm function
-define(needed,ifelse(atype_letter,i,`none',ifelse(atype_letter,l,`none',ifelse(name,aint,trunc,ifelse(name,anint,round,ifelse(name,aimag,none,ifelse(name,conjg,none,ifelse(name,dim,none,ifelse(name,sign,none,ifelse(name,abs,fabs,name))))))))))dnl
+define(needed,dnl
+ifelse(atype_letter,i,`none',dnl
+ifelse(atype_letter,l,`none',dnl
+ifelse(name,aint,trunc,dnl
+ifelse(name,anint,round,dnl
+ifelse(name,aimag,none,dnl
+ifelse(name,conjg,none,dnl
+ifelse(name,dim,none,dnl
+ifelse(name,sign,none,dnl
+ifelse(name,abs,fabs,name))))))))))dnl
define(prefix,ifelse(atype_letter,c,C,`'))dnl
dnl Special case for fabs, for which the corresponding complex function
diff --git a/libgfortran/m4/specific2.m4 b/libgfortran/m4/specific2.m4
index d05e8db..27b9c91 100644
--- a/libgfortran/m4/specific2.m4
+++ b/libgfortran/m4/specific2.m4
@@ -4,11 +4,18 @@ define(atype_letter,substr(atype_code, 0, 1))dnl
define(atype_kind,substr(atype_code, 1))dnl
define(get_typename2, `$1 (kind=$2)')dnl
define(get_typename, `get_typename2(ifelse($1,i,integer,ifelse($1,r,real,ifelse($1,l,logical,ifelse($1,c,complex,unknown)))),`$2')')dnl
-define(atype_name, get_typename(atype_letter,atype_kind))dnl
+define(name_kind, ifelse(atype_kind,17,16,atype_kind))dnl
+define(atype_name, get_typename(atype_letter,name_kind))dnl
define(name, regexp(regexp(file, `[^/]*$', `\&'), `^_\([^_]*\)_', `\1'))dnl
define(function_name,`_gfortran_specific__'name`_'atype_code)dnl
-define(Q,ifelse(atype_kind,4,F,ifelse(atype_kind,8,`',ifelse(atype_kind,10,L,ifelse(atype_kind,16,L,`_'atype_kind)))))dnl
+define(Q,dnl
+ifelse(atype_kind,4,F,dnl
+ifelse(atype_kind,8,`',dnl
+ifelse(atype_kind,10,L,dnl
+ifelse(atype_kind,16,L,dnl
+ifelse(atype_kind,17,L,dnl
+`_'atype_kind))))))dnl
#include "config.h"
#include "kinds.inc"