]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Make sure the Fortran specifics have real(kind=16).
authorThomas Koenig <tkoenig@gcc.gnu.org>
Mon, 3 Jan 2022 15:07:02 +0000 (16:07 +0100)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Mon, 3 Jan 2022 15:07:02 +0000 (16:07 +0100)
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.
* mk-kinds-h.sh: Adjust to trunk.

40 files changed:
libgfortran/Makefile.am
libgfortran/Makefile.in
libgfortran/config.h.in
libgfortran/configure
libgfortran/configure.ac
libgfortran/generated/_abs_c17.F90
libgfortran/generated/_abs_r17.F90
libgfortran/generated/_acos_r17.F90
libgfortran/generated/_acosh_r17.F90
libgfortran/generated/_aimag_c17.F90
libgfortran/generated/_aint_r17.F90
libgfortran/generated/_anint_r17.F90
libgfortran/generated/_asin_r17.F90
libgfortran/generated/_asinh_r17.F90
libgfortran/generated/_atan2_r17.F90
libgfortran/generated/_atan_r17.F90
libgfortran/generated/_atanh_r17.F90
libgfortran/generated/_conjg_c17.F90
libgfortran/generated/_cos_c17.F90
libgfortran/generated/_cos_r17.F90
libgfortran/generated/_cosh_r17.F90
libgfortran/generated/_dim_r17.F90
libgfortran/generated/_exp_c17.F90
libgfortran/generated/_exp_r17.F90
libgfortran/generated/_log10_r17.F90
libgfortran/generated/_log_c17.F90
libgfortran/generated/_log_r17.F90
libgfortran/generated/_mod_r17.F90
libgfortran/generated/_sign_r17.F90
libgfortran/generated/_sin_c17.F90
libgfortran/generated/_sin_r17.F90
libgfortran/generated/_sinh_r17.F90
libgfortran/generated/_sqrt_c17.F90
libgfortran/generated/_sqrt_r17.F90
libgfortran/generated/_tan_r17.F90
libgfortran/generated/_tanh_r17.F90
libgfortran/kinds-override.h
libgfortran/m4/specific.m4
libgfortran/m4/specific2.m4
libgfortran/mk-kinds-h.sh

index f3e358368cc1c26156a7529251c8c2d4dabb8ca1..efc79d0d0b7aa3c55a230c1bdb26f2b87fa22104 100644 (file)
@@ -1075,15 +1075,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
@@ -1154,8 +1155,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 > $@
index a306fcbebd344c6303249ecde252f60e452ddab7..a5aeb1900d19a5a756484bccc84e118e55e826d7 100644 (file)
@@ -719,7 +719,6 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
-runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -7630,14 +7629,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
@@ -7664,8 +7664,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 > $@
index 02dcf49c49aeb2d0f0f019e2100e18584aa1f54b..24e31ebd62547cb6410d6d73604d9918d00b09da 100644 (file)
 /* 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
 
index 845d4fec5a1d964c6aa2da4c492314eafa4ae714..ae64dca31140e2502752aa9dcb2f1ef913beba88 100755 (executable)
@@ -786,7 +786,6 @@ infodir
 docdir
 oldincludedir
 includedir
-runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -878,7 +877,6 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1131,15 +1129,6 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
-  -runstatedir | --runstatedir | --runstatedi | --runstated \
-  | --runstate | --runstat | --runsta | --runst | --runs \
-  | --run | --ru | --r)
-    ac_prev=runstatedir ;;
-  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
-  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
-  | --run=* | --ru=* | --r=*)
-    runstatedir=$ac_optarg ;;
-
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1277,7 +1266,7 @@ fi
 for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
                datadir sysconfdir sharedstatedir localstatedir includedir \
                oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-               libdir localedir mandir runstatedir
+               libdir localedir mandir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1430,7 +1419,6 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
-  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -6025,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
@@ -12778,7 +12766,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12781 "configure"
+#line 12769 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12884,7 +12872,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12887 "configure"
+#line 12875 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -16269,7 +16257,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -16315,7 +16303,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -16339,7 +16327,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -16384,7 +16372,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -16408,7 +16396,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -25850,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
index 39f38bac4ba32131592b29b21d02e45ace1c3f5e..97cc490cb5e93af786c74da1fd607c8268292e52 100644 (file)
@@ -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])
index f4afb78dd0b6143b7e3cd139c355ceb8a3282a0b..b85ecae1fcb2db9428c58cdae410dabb6ae3c1df 100644 (file)
 #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
index 9354f013c043ceb05faed4d50d2d82ab26d32e8a..91ce3649efa1924b1e1db3378396a62e0b221e85 100644 (file)
 #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
index cfd35906200228bf10a56b50159afbab42262436..92edb5e7e2e504085c75faac7f28e756a2e51c07 100644 (file)
 #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
index 56fc1defbcfba9e0ede8eef00b58ab3aa3511e90..0ded7e83a031fb75602262ebc796c3a7ee325138 100644 (file)
 #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
index db53f79409fa7ba88a6f12e0a6d2dc8d38441943..1d6fa978726f6dc00f2128e8d0abf3ef462f786f 100644 (file)
@@ -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
index f981090533fe5fd6b76d64bb72d208da1c6a53fe..a7be4813d18423972effec144b73ee419e2ef1c4 100644 (file)
 #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
index 73e24c6fa1b9388e5e1e7551639e4cc2d1f66ccc..eef826dd125ff1a7f68bff7f18ee52779bd4139f 100644 (file)
 #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
index cb036647b06a076e726d184709b2f812142dceb2..a8573b3223bfe5617f27b7cfbc97cea6f6055e04 100644 (file)
 #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
index c0c54d42dbf743b8d7bad410642fe261f6cc10b6..47858ea9b62dbde65fb6ffac5ec88ef5f9c762c0 100644 (file)
 #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
index aa087888b692a8242234ac7207b3716889ff0942..780cfeaf09c29fa3aae23707aa0161ef702d9bc5 100644 (file)
 
 #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
index 0b28316218b2e65edcffbe4724766dff38199489..d1bd37b021a66ab0d33d8a91eb2419decd1f559c 100644 (file)
 #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
index 812e8ff500652d3f4a10e1169e446adbe63d523c..15209685ddaa1e0f57b56dc82ab11c2f4ba852b5 100644 (file)
 #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
index 06dcffb331ffc8a90018a27cded5b771b842f7f2..65f54c8d1a41b57b095ce57a7c4b14cc4405ab9d 100644 (file)
@@ -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
index 17a81557528be5a4d5c1e88c17fcbac3ef1963e6..c056731e22da6c40c984e2984901af613cec4dfe 100644 (file)
 #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
index 5be6b5d55ae2c1c8509c42ab2457dc4b81c864b6..c1fda03dd255da589a9b60dd3ba2b0f31bdc802e 100644 (file)
 #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
index 0572accc9100ce6d274ad574e8e64e7058515ba9..b7724b00b54b3620e2a636500154d220255db382 100644 (file)
 #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
index b6f8d0612a525d3b287a2e8c22a0935499397257..fac19410c97f1175f2792311c6e7deaca4627c81 100644 (file)
@@ -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
index c5e04e5d1bdeba6d06edc18be342aa1a1ab262a4..45376812b102fbd47d405770dc7d1bade115135f 100644 (file)
 #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
index 38b3c6c8e0d2a9a0af2cbfa2bc74bfcddbcf30f3..7f1862051220e9ee0f33c2420d41736b88d9eb8c 100644 (file)
 #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
index e5a65cf7e6e5c2d838a864f9473797307f4ba4af..6abd9f188be4285e62fa1196306c27df6f8c0b67 100644 (file)
 #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
index 8bb50a23420634d5977ff8c2de8f11b2a525dd3c..4b3ebd903af74a475c4efe6203b3da663231b68f 100644 (file)
 #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
index 4ad62de9421dda621c5db6c1db52c7f28ce44376..579f7f305827c3b8427bea5b597cf85def03124e 100644 (file)
 #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
index fb487dcedcc3b8d387b984dcc82547eb55bfb7e5..62f7f91b91987a4258a316382a152ff9ed6acc52 100644 (file)
@@ -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
index beb0d17816dc318a8105f425414a96e0449d7119..b36233433c4214bf1d7bcc10f64409b8f619ceb9 100644 (file)
@@ -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
index 95245305eb5de2ddb0592035fb6ddb26aff1f440..8de584fd801a39968b792cc86be79aa0bfd23540 100644 (file)
 #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
index 76810a410ad38dc577cb6bf959ea61f33c7c9954..ebb8d02dfeae76f334e172b257b525fbd6bc0d64 100644 (file)
 #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
index e864d28ed36bc5511d61aafccfb8360894ff0043..f617c078cfd199287100d9623d2216fd8ea5ecf0 100644 (file)
 #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
index b2c2a329ab078c863e97bf74a13afe1985e06ab6..e0ca11798301b73a8bba001ec6efde71f2e0e93e 100644 (file)
 #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
index 9052d80d46731d2b4274554b906157ae6409f06d..01da3e5c2b6cd3e7c68c7a2ed3f42948944cda7b 100644 (file)
 #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
index eac29453c2061e65cd42590a7eb84890e46f5577..b9124881fd6816d1e17e64e299ddfcd88e6821f1 100644 (file)
 #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
index 0d4c020c69c8ccdfc268ccaff1a48eb45df936d0..553ad9175c6e5a354f0c0656f3db6b14b4ccbe27 100644 (file)
 #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
index 344c596b005bc0da9b55b87060b391cc52883bb3..673e9d5dccd0d1f022ca912929c4a82644b3e495 100644 (file)
@@ -23,31 +23,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
 
-/* What are the C types corresponding to the real(kind=10) and
-   real(kind=16) types? We currently rely on the following assumptions:
-     -- if real(kind=10) exists, i.e. if HAVE_GFC_REAL_10 is defined,
-        then it is necessarily the "long double" type
-     -- if real(kind=16) exists, then:
-         * if HAVE_GFC_REAL_10, real(kind=16) is "__float128"
-        * otherwise, real(kind=16) is "long double"
-   To allow to change this in the future, we create the
-   GFC_REAL_16_IS_FLOAT128 macro that is used throughout libgfortran.  */
-
-#if defined(HAVE_GFC_REAL_16)
-# if defined(HAVE_GFC_REAL_10)
-#  define GFC_REAL_16_IS_FLOAT128
-#  if !defined(HAVE_FLOAT128)
-#   error "Where has __float128 gone?"
-#  endif
-# else
-#  define GFC_REAL_16_IS_LONG_DOUBLE
-# endif
+/* Ensure that TFmode is available under.  */
+
+#if defined(GFC_REAL_16_IS_FLOAT128) && !defined(HAVE_FLOAT128)
+# 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
index ebc89839ad48a3ac2c274f8f7f33471ba337d51d..75d916e5855f6bf3eac3e6b69b9965b0d61922c9 100644 (file)
@@ -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
index d05e8db1435a621858ab393d41735a525a91b98c..27b9c913af63569f56b376c8f3ea99fd1add4ace 100644 (file)
@@ -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"
index 249619061c6a585675ebeffd7b6334b1eb7c9202..572878ce8912b0a0bb1308bc5fe097a2ff0d77f6 100755 (executable)
@@ -64,15 +64,19 @@ for k in $possible_real_kinds; do
     case $k in
       4) ctype="float" ; cplxtype="complex float" ; suffix="f" ;;
       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" ;;
-      16) if [ $long_double_kind -eq 10 ]; then
+      # 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"
          else
            ctype="long double"
            cplxtype="complex long double"
            suffix="l"
+           echo "#define GFC_REAL_16_IS_LONG_DOUBLE"
          fi ;;
       *) echo "$0: Unknown type" >&2 ; exit 1 ;;
     esac