else
tmp = build_int_cst (gfc_charlen_type_node, 0);
+ int abi_kind = gfc_type_abi_kind (ts);
if (dtio_proc == null_pointer_node)
- tmp = build_call_expr_loc (input_location,
- iocall[IOCALL_SET_NML_VAL], 6,
- dt_parm_addr, addr_expr, string,
- build_int_cst (gfc_int4_type_node, ts->kind),
- tmp, dtype);
+ tmp = build_call_expr_loc (input_location, iocall[IOCALL_SET_NML_VAL], 6,
+ dt_parm_addr, addr_expr, string,
+ build_int_cst (gfc_int4_type_node, abi_kind),
+ tmp, dtype);
else
- tmp = build_call_expr_loc (input_location,
- iocall[IOCALL_SET_NML_DTIO_VAL], 8,
- dt_parm_addr, addr_expr, string,
- build_int_cst (gfc_int4_type_node, ts->kind),
- tmp, dtype, dtio_proc, vtable);
+ tmp = build_call_expr_loc (input_location, iocall[IOCALL_SET_NML_DTIO_VAL],
+ 8, dt_parm_addr, addr_expr, string,
+ build_int_cst (gfc_int4_type_node, abi_kind),
+ tmp, dtype, dtio_proc, vtable);
gfc_add_expr_to_block (block, tmp);
/* If the object is an array, transfer rank times:
ts->kind = gfc_index_integer_kind;
}
- kind = ts->kind;
+ kind = gfc_type_abi_kind (ts);
function = NULL;
arg2 = NULL;
arg3 = NULL;
arg2 = build_int_cst (integer_type_node, kind);
if (last_dt == READ)
{
- if (gfc_real16_is_float128 && ts->kind == 16)
+ if ((gfc_real16_is_float128 && kind == 16) || kind == 17)
function = iocall[IOCALL_X_REAL128];
else
function = iocall[IOCALL_X_REAL];
}
else
{
- if (gfc_real16_is_float128 && ts->kind == 16)
+ if ((gfc_real16_is_float128 && kind == 16) || kind == 17)
function = iocall[IOCALL_X_REAL128_WRITE];
else
function = iocall[IOCALL_X_REAL_WRITE];
arg2 = build_int_cst (integer_type_node, kind);
if (last_dt == READ)
{
- if (gfc_real16_is_float128 && ts->kind == 16)
+ if ((gfc_real16_is_float128 && kind == 16) || kind == 17)
function = iocall[IOCALL_X_COMPLEX128];
else
function = iocall[IOCALL_X_COMPLEX];
}
else
{
- if (gfc_real16_is_float128 && ts->kind == 16)
+ if ((gfc_real16_is_float128 && kind == 16) || kind == 17)
function = iocall[IOCALL_X_COMPLEX128_WRITE];
else
function = iocall[IOCALL_X_COMPLEX_WRITE];
## Symbol versioning (copied from libssp).
if LIBGFOR_USE_SYMVER
+# -Wc is only a libtool option.
+comma = ,
+PREPROCESS = $(subst -Wc$(comma), , $(COMPILE)) -E
+
+gfortran.ver: $(srcdir)/gfortran.map kinds.inc
+ $(EGREP) -v '#(#| |$$)' $< | \
+ $(PREPROCESS) -P -include config.h -include kinds.inc - > $@ || (rm -f $@ ; exit 1)
+
if LIBGFOR_USE_SYMVER_GNU
-version_arg = -Wl,--version-script=$(srcdir)/gfortran.map
-version_dep = $(srcdir)/gfortran.map
+version_arg = -Wl,--version-script=gfortran.ver
+version_dep = gfortran.ver
endif
if LIBGFOR_USE_SYMVER_SUN
-version_arg = -Wl,-M,gfortran.map-sun
-version_dep = gfortran.map-sun
-gfortran.map-sun : $(srcdir)/gfortran.map \
+version_arg = -Wl,-M,gfortran.ver-sun
+version_dep = gfortran.ver-sun gfortran.ver
+gfortran.map-sun : gfortran.ver \
$(top_srcdir)/../contrib/make_sunver.pl \
$(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD)
perl $(top_srcdir)/../contrib/make_sunver.pl \
- $(srcdir)/gfortran.map \
+ gfortran.ver \
$(libgfortran_la_OBJECTS:%.lo=.libs/%.o) \
`echo $(libgfortran_la_LIBADD) | \
sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
:
BUILT_SOURCES=$(gfor_built_src) $(gfor_built_specific_src) \
- $(gfor_built_specific2_src) $(gfor_misc_specifics)
+ $(gfor_built_specific2_src) $(gfor_misc_specifics) $(version_dep)
prereq_SRC = $(gfor_src) $(gfor_built_src) $(gfor_io_src) \
$(gfor_helper_src) $(gfor_ieee_src) $(gfor_io_headers) $(gfor_specific_src)
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I .. -I ../config
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
+
+# -Wc is only a libtool option.
+@LIBGFOR_USE_SYMVER_TRUE@comma = ,
+@LIBGFOR_USE_SYMVER_TRUE@PREPROCESS = $(subst -Wc$(comma), , $(COMPILE)) -E
@LIBGFOR_USE_SYMVER_FALSE@version_arg =
-@LIBGFOR_USE_SYMVER_GNU_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_arg = -Wl,--version-script=$(srcdir)/gfortran.map
-@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_arg = -Wl,-M,gfortran.map-sun
+@LIBGFOR_USE_SYMVER_GNU_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_arg = -Wl,--version-script=gfortran.ver
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_arg = -Wl,-M,gfortran.ver-sun
@LIBGFOR_USE_SYMVER_FALSE@version_dep =
-@LIBGFOR_USE_SYMVER_GNU_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_dep = $(srcdir)/gfortran.map
-@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_dep = gfortran.map-sun
+@LIBGFOR_USE_SYMVER_GNU_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_dep = gfortran.ver
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_dep = gfortran.ver-sun gfortran.ver
gfor_c_HEADERS = ISO_Fortran_binding.h
gfor_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \
BUILT_SOURCES = $(gfor_built_src) $(gfor_built_specific_src) \
$(gfor_built_specific2_src) $(gfor_misc_specifics) \
- $(am__append_7)
+ $(version_dep) $(am__append_7)
prereq_SRC = $(gfor_src) $(gfor_built_src) $(gfor_io_src) \
$(gfor_helper_src) $(gfor_ieee_src) $(gfor_io_headers) $(gfor_specific_src)
.PRECIOUS: Makefile
-@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@gfortran.map-sun : $(srcdir)/gfortran.map \
+
+@LIBGFOR_USE_SYMVER_TRUE@gfortran.ver: $(srcdir)/gfortran.map kinds.inc
+@LIBGFOR_USE_SYMVER_TRUE@ $(EGREP) -v '#(#| |$$)' $< | \
+@LIBGFOR_USE_SYMVER_TRUE@ $(PREPROCESS) -P -include config.h -include kinds.inc - > $@ || (rm -f $@ ; exit 1)
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@gfortran.map-sun : gfortran.ver \
@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ $(top_srcdir)/../contrib/make_sunver.pl \
@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ $(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD)
@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ perl $(top_srcdir)/../contrib/make_sunver.pl \
-@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ $(srcdir)/gfortran.map \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ gfortran.ver \
@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ $(libgfortran_la_OBJECTS:%.lo=.libs/%.o) \
@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ `echo $(libgfortran_la_LIBADD) | \
@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
_gfortran_transfer_character_wide;
_gfortran_transfer_character_wide_write;
_gfortran_transfer_character_write;
+#ifndef HAVE_GFC_REAL_17
_gfortran_transfer_complex128;
_gfortran_transfer_complex128_write;
+#endif
_gfortran_transfer_complex;
_gfortran_transfer_complex_write;
_gfortran_transfer_derived;
_gfortran_transfer_integer_write;
_gfortran_transfer_logical;
_gfortran_transfer_logical_write;
+#ifndef HAVE_GFC_REAL_17
_gfortran_transfer_real128;
_gfortran_transfer_real128_write;
+#endif
_gfortran_transfer_real;
_gfortran_transfer_real_write;
_gfortran_ttynam;
_gfortran_sproduct_c17;
_gfortran_ssum_c17;
_gfortran_sum_c17;
+#ifdef HAVE_GFC_REAL_17
+ _gfortran_transfer_complex128;
+ _gfortran_transfer_complex128_write;
+ _gfortran_transfer_real128;
+ _gfortran_transfer_real128_write;
+#endif
} GFORTRAN_10.2;
{
case 4: return 15;
case 8: return 25;
- case 16: return 42;
+ case 16:
+ case 17: return 42;
default: return 0;
}
}
{
case 4: return 7;
case 8: return 16;
- case 16: return 33;
+ case 16:
+ case 17: return 33;
default: return 0;
}
}
switch (length)
{
#ifdef HAVE_GFC_INTEGER_16
+#ifdef HAVE_GFC_REAL_17
+ case 17:
+ {
+ GFC_INTEGER_16 tmp = value;
+ memcpy (dest, (void *) &tmp, 16);
+ }
+ break;
+#endif
/* length=10 comes about for kind=10 real/complex BOZ, cf. PR41711. */
case 10:
case 16:
#endif
switch (length)
- {
+ {
+#if defined HAVE_GFC_REAL_17
+ case 17:
+ value = 1;
+ for (int n = 1; n < 4 * 16; n++)
+ value = (value << 2) + 3;
+ return value;
+#endif
#if defined HAVE_GFC_REAL_16 || defined HAVE_GFC_REAL_10
case 16:
case 10:
# endif
#endif
+#if defined(HAVE_GFC_REAL_17)
+ case 17:
+# if defined(POWER_IEEE128)
+ *((GFC_REAL_17*) dest) = __strtoieee128 (buffer, &endptr);
+# else
+ *((GFC_REAL_17*) dest) = __qmath_(strtoflt128) (buffer, &endptr);
+# endif
+#endif
+
default:
internal_error (&dtp->common, "Unsupported real kind during IO");
}
# endif
#endif
+#if defined(HAVE_GFC_REAL_17)
+ case 17:
+ if (is_inf)
+ *((GFC_REAL_17*) dest) = plus ? __builtin_infl () : -__builtin_infl ();
+ else
+ *((GFC_REAL_17*) dest) = plus ? __builtin_nanl ("") : -__builtin_nanl ("");
+ break;
+#endif
+
default:
internal_error (&dtp->common, "Unsupported real kind during IO");
}
break;
#endif
+#ifdef HAVE_GFC_REAL_17
+ case 17:
+ *((GFC_REAL_17 *) dest) = 0.0;
+ break;
+#endif
+
default:
internal_error (&dtp->common, "Unsupported real kind during IO");
}
case 16:
return sizeof (GFC_REAL_16);
#endif
+#ifdef HAVE_GFC_REAL_17
+ case 17:
+ return sizeof (GFC_REAL_17);
+#endif
default:
return kind;
}
case 16:
return sizeof (GFC_COMPLEX_16);
#endif
+#ifdef HAVE_GFC_COMPLEX_17
+ case 17:
+ return sizeof (GFC_COMPLEX_17);
+#endif
default:
return 2 * kind;
}
#include "io.h"
-#if defined(GFC_REAL_16_IS_FLOAT128)
+#if defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_GFC_REAL_17)
/* The prototypes for the called procedures in transfer.c. */
write_float; the pointer assignment with USED attribute make sure
that there is a non-weakref dependence if the quadmath functions
are used. That avoids segfault when libquadmath is statically linked. */
+# if !defined(HAVE_GFC_REAL_17) || !defined(POWER_IEEE128)
static void __attribute__((used)) *tmp1 = strtoflt128;
static void __attribute__((used)) *tmp2 = quadmath_snprintf;
+# endif
void
transfer_real128 (st_parameter_dt *dtp, void *p, int kind)
i = (GFC_UINTEGER_16) tmp;
}
break;
+# ifdef HAVE_GFC_REAL_17
+ case 17:
+ {
+ GFC_INTEGER_16 tmp = 0;
+ memcpy ((void *) &tmp, p, 16);
+ i = (GFC_UINTEGER_16) tmp;
+ }
+ break;
+# endif
#endif
default:
internal_error (NULL, "bad integer kind");
size = 4932 + 3;
break;
case 16:
+#ifdef HAVE_GFC_REAL_17
+ case 17:
+#endif
size = 4932 + 3;
break;
default:
f->u.real.e = 4;
#endif
break;
+#ifdef HAVE_GFC_REAL_17
+ case 17:
+ f->u.real.w = 45;
+ f->u.real.d = 36;
+ f->u.real.e = 4;
+ break;
+#endif
default:
internal_error (&dtp->common, "bad real kind");
break;
snprintf (buffer, size, "%+-#.*Le", (prec), (val))
-#if defined(GFC_REAL_16_IS_FLOAT128)
-#define DTOA2Q(prec,val) \
+#if defined(HAVE_GFC_REAL_17)
+# if defined(POWER_IEEE128)
+# define DTOA2Q(prec,val) \
+__snprintfieee128 (buffer, size, "%+-#.*Le", (prec), (val))
+# else
+# define DTOA2Q(prec,val) \
+quadmath_snprintf (buffer, size, "%+-#.*Qe", (prec), (val))
+# endif
+#elif defined(GFC_REAL_16_IS_FLOAT128)
+# define DTOA2Q(prec,val) \
quadmath_snprintf (buffer, size, "%+-#.*Qe", (prec), (val))
#endif
snprintf (buffer, size, "%+-#.*Lf", (prec), (val))
-#if defined(GFC_REAL_16_IS_FLOAT128)
-#define FDTOA2Q(prec,val) \
-quadmath_snprintf (buffer, size, "%+-#.*Qf", \
- (prec), (val))
+#if defined(HAVE_GFC_REAL_17)
+# if defined(POWER_IEEE128)
+# define FDTOA2Q(prec,val) \
+__snprintfieee128 (buffer, size, "%+-#.*Lf", (prec), (val))
+# else
+# define FDTOA2Q(prec,val) \
+quadmath_snprintf (buffer, size, "%+-#.*Qf", (prec), (val))
+# endif
+#elif defined(GFC_REAL_16_IS_FLOAT128)
+# define FDTOA2Q(prec,val) \
+quadmath_snprintf (buffer, size, "%+-#.*Qf", (prec), (val))
#endif
# endif
break;
#endif
+#ifdef HAVE_GFC_REAL_17
+ case 17:
+ EN_PREC(16,Q)
+#endif
+ break;
default:
internal_error (NULL, "bad real kind");
}
# endif
break;
#endif
+#ifdef HAVE_GFC_REAL_17
+ case 17:
+ FORMAT_FLOAT(16,Q)
+ break;
+#endif
default:
internal_error (NULL, "bad real kind");
}
/* Prototypes for the POWER __ieee128 functions. */
#ifdef POWER_IEEE128
-extern __float128 __acoshieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __acosieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __asinhieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __asinieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __atan2ieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __atanhieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __atanieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __coshieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __cosieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __erfieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __expieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __fabsieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __jnieee128 (int, __float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __log10ieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __logieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __powieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __sinhieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __sinieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __sqrtieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __tanhieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __tanieee128 (__float128) __attribute__ ((__nothrow__, __leaf__));
-extern __float128 __ynieee128 (int , __float128) __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __acoshieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __acosieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __asinhieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __asinieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __atan2ieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __atanhieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __atanieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __coshieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __cosieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __erfieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __expieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __fabsieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __jnieee128 (int, __float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __log10ieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __logieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __powieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __sinhieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __sinieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __sqrtieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __tanhieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __tanieee128 (__float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __ynieee128 (int , __float128)
+ __attribute__ ((__nothrow__, __leaf__));
+extern __float128 __strtoieee128 (const char *, char **)
+ __attribute__ ((__nothrow__, __leaf__));
+extern int __snprintfieee128 (char *, size_t, const char *, ...)
+ __attribute__ ((__nothrow__));
#endif