acinclude.m4 (LIBGFOR_CHECK_FPSETMASK): New check.

	* acinclude.m4 (LIBGFOR_CHECK_FPSETMASK): New check.
	* configure.ac: Check for floatingpoint.h, fptrap.h and float.h
	headers. Use LIBGFOR_CHECK_FPSETMASK. Check for fp_trap and
	fp_enable functions.
	* configure.host: Add case for systems with fpsetmask and systems
	with fp_trap/fp_enable.
	* config/fpu-sysv.h: New file, FPU code using fpsetmask.
	* config/fpu-aix.h: New file, FPU code for AIX using fp_trap and
	fp_enable.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* config.h.in: Regenerate.

From-SVN: r105956
parent 9b46f94f
2005-10-20 Francois-Xavier Coudert <coudert@clipper.ens.fr>
* acinclude.m4 (LIBGFOR_CHECK_FPSETMASK): New check.
* configure.ac: Check for floatingpoint.h, fptrap.h and float.h
headers. Use LIBGFOR_CHECK_FPSETMASK. Check for fp_trap and
fp_enable functions.
* configure.host: Add case for systems with fpsetmask and systems
with fp_trap/fp_enable.
* config/fpu-sysv.h: New file, FPU code using fpsetmask.
* config/fpu-aix.h: New file, FPU code for AIX using fp_trap and
fp_enable.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* config.h.in: Regenerate.
2005-10-24 Jerry DeLisle <jvdelisle@verizon.net> 2005-10-24 Jerry DeLisle <jvdelisle@verizon.net>
PR libgfortran/24224 PR libgfortran/24224
* libgfortran.h: Remove array stride error code. * libgfortran.h: Remove array stride error code.
* runtime/error.c: Remove array stride error. * runtime/error.c: Remove array stride error.
* io/io.h: Change name of 'nml_loop_spec' to 'array_loop_spec' to be * io/io.h: Change name of 'nml_loop_spec' to 'array_loop_spec' to be
generic. Add pointer to array_loop_spec and rank to gfc_unit generic. Add pointer to array_loop_spec and rank to gfc_unit
structure. structure.
* io/list_read.c: Revise nml_loop_spec references to array_loop_spec. * io/list_read.c: Revise nml_loop_spec references to array_loop_spec.
* io/transfer.c (init_loop_spec): New function to initialize * io/transfer.c (init_loop_spec): New function to initialize
an array_loop_spec. an array_loop_spec.
(next_array_record): New function to return the index to the next array (next_array_record): New function to return the index to the next array
record by incrementing through the array_loop_spec. record by incrementing through the array_loop_spec.
(next_record_r): Use new function. (next_record_r): Use new function.
(next_record_w): Use new function. (next_record_w): Use new function.
(finalize_transfer): Free memory allocated for array_loop_spec. (finalize_transfer): Free memory allocated for array_loop_spec.
* io/unit.c (get_array_unit_len): Delete this function. Use new * io/unit.c (get_array_unit_len): Delete this function. Use new
function init_loop_spec to initialize the array_loop_spec. function init_loop_spec to initialize the array_loop_spec.
2005-10-24 Paul Thomas <pault@gcc.gnu.org> 2005-10-24 Paul Thomas <pault@gcc.gnu.org>
......
...@@ -384,3 +384,20 @@ esac])]) ...@@ -384,3 +384,20 @@ esac])])
if test x"$have_working_stat" = xyes; then if test x"$have_working_stat" = xyes; then
AC_DEFINE(HAVE_WORKING_STAT, 1, [Define if target has a reliable stat.]) AC_DEFINE(HAVE_WORKING_STAT, 1, [Define if target has a reliable stat.])
fi]) fi])
dnl Checks for fpsetmask function.
AC_DEFUN([LIBGFOR_CHECK_FPSETMASK], [
AC_CACHE_CHECK([whether fpsetmask is present], have_fpsetmask, [
AC_TRY_LINK([
#if HAVE_FLOATINGPOINT_H
# include <floatingpoint.h>
#endif /* HAVE_FLOATINGPOINT_H */
#if HAVE_IEEEFP_H
# include <ieeefp.h>
#endif /* HAVE_IEEEFP_H */],[fpsetmask(0);],
eval "have_fpsetmask=yes", eval "have_fpsetmask=no")
])
if test x"$have_fpsetmask" = xyes; then
AC_DEFINE(HAVE_FPSETMASK, 1, [Define if you have fpsetmask.])
fi
])
...@@ -294,6 +294,12 @@ ...@@ -294,6 +294,12 @@
/* libm includes finite */ /* libm includes finite */
#undef HAVE_FINITE #undef HAVE_FINITE
/* Define to 1 if you have the <floatingpoint.h> header file. */
#undef HAVE_FLOATINGPOINT_H
/* Define to 1 if you have the <float.h> header file. */
#undef HAVE_FLOAT_H
/* libm includes floor */ /* libm includes floor */
#undef HAVE_FLOOR #undef HAVE_FLOOR
...@@ -303,6 +309,18 @@ ...@@ -303,6 +309,18 @@
/* libm includes floorl */ /* libm includes floorl */
#undef HAVE_FLOORL #undef HAVE_FLOORL
/* Define if you have fpsetmask. */
#undef HAVE_FPSETMASK
/* Define to 1 if you have the <fptrap.h> header file. */
#undef HAVE_FPTRAP_H
/* fp_enable is present */
#undef HAVE_FP_ENABLE
/* fp_trap is present */
#undef HAVE_FP_TRAP
/* libm includes frexp */ /* libm includes frexp */
#undef HAVE_FREXP #undef HAVE_FREXP
......
/* AIX FPU-related code.
Copyright 2005 Free Software Foundation, Inc.
Contributed by Francois-Xavier Coudert <coudert@clipper.ens.fr>
This file is part of the GNU Fortran 95 runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file into combinations with other programs,
and to distribute those combinations without any restriction coming
from the use of this file. (The General Public License restrictions
do apply in other respects; for example, they cover modification of
the file, and distribution when not linked into a combine
executable.)
Libgfortran is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public
License along with libgfortran; see the file COPYING. If not,
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* FPU-related code for AIX. */
#ifdef HAVE_FPTRAP_H
#include <fptrap.h>
#endif
#ifdef HAVE_FLOAT_H
#include <float.h>
#endif
void
set_fpu (void)
{
fptrap_t mode = 0;
if (options.fpe & GFC_FPE_INVALID)
#ifdef TRP_INVALID
mode |= TRP_INVALID;
#else
st_printf ("Fortran runtime warning: IEEE 'invalid operation' "
"exception not supported.\n");
#endif
if (options.fpe & GFC_FPE_DENORMAL)
st_printf ("Fortran runtime warning: IEEE 'denormal number' "
"exception not supported.\n");
if (options.fpe & GFC_FPE_ZERO)
#ifdef TRP_DIV_BY_ZERO
mode |= TRP_DIV_BY_ZERO;
#else
st_printf ("Fortran runtime warning: IEEE 'division by zero' "
"exception not supported.\n");
#endif
if (options.fpe & GFC_FPE_OVERFLOW)
#ifdef TRP_OVERFLOW
mode |= TRP_OVERFLOW;
#else
st_printf ("Fortran runtime warning: IEEE 'overflow' "
"exception not supported.\n");
#endif
if (options.fpe & GFC_FPE_UNDERFLOW)
#ifdef TRP_UNDERFLOW
mode |= TRP_UNDERFLOW;
#else
st_printf ("Fortran runtime warning: IEEE 'underflow' "
"exception not supported.\n");
#endif
if (options.fpe & GFC_FPE_PRECISION)
#ifdef TRP_UNDERFLOW
mode |= TRP_UNDERFLOW;
#else
st_printf ("Fortran runtime warning: IEEE 'loss of precision' "
"exception not supported.\n");
#endif
fp_trap(FP_TRAP_SYNC);
fp_enable(mode);
}
/* SysV FPU-related code (for systems not otherwise supported).
Copyright 2005 Free Software Foundation, Inc.
Contributed by Francois-Xavier Coudert <coudert@clipper.ens.fr>
This file is part of the GNU Fortran 95 runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file into combinations with other programs,
and to distribute those combinations without any restriction coming
from the use of this file. (The General Public License restrictions
do apply in other respects; for example, they cover modification of
the file, and distribution when not linked into a combine
executable.)
Libgfortran is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public
License along with libgfortran; see the file COPYING. If not,
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* FPU-related code for SysV platforms with fpsetmask(). */
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
void
set_fpu (void)
{
int cw = 0;
if (options.fpe & GFC_FPE_INVALID)
#ifdef FP_X_INV
cw |= FP_X_INV;
#else
st_printf ("Fortran runtime warning: IEEE 'invalid operation' "
"exception not supported.\n");
#endif
if (options.fpe & GFC_FPE_DENORMAL)
#ifdef FP_X_DNML
cw |= FP_X_DNML;
#else
st_printf ("Fortran runtime warning: IEEE 'denormal number' "
"exception not supported.\n");
#endif
if (options.fpe & GFC_FPE_ZERO)
#ifdef FP_X_DZ
cw |= FP_X_DZ;
#else
st_printf ("Fortran runtime warning: IEEE 'division by zero' "
"exception not supported.\n");
#endif
if (options.fpe & GFC_FPE_OVERFLOW)
#ifdef FP_X_OFL
cw |= FP_X_OFL;
#else
st_printf ("Fortran runtime warning: IEEE 'overflow' "
"exception not supported.\n");
#endif
if (options.fpe & GFC_FPE_UNDERFLOW)
#ifdef FP_X_UFL
cw |= FP_X_UFL;
#else
st_printf ("Fortran runtime warning: IEEE 'underflow' "
"exception not supported.\n");
#endif
if (options.fpe & GFC_FPE_PRECISION)
#ifdef FP_X_IMP
cw |= FP_X_IMP;
#else
st_printf ("Fortran runtime warning: IEEE 'loss of precision' "
"exception not supported.\n");
#endif
fpsetmask(cw);
}
...@@ -158,7 +158,8 @@ AC_TYPE_OFF_T ...@@ -158,7 +158,8 @@ AC_TYPE_OFF_T
AC_STDC_HEADERS AC_STDC_HEADERS
AC_HAVE_HEADERS(stdlib.h stdio.h string.h stddef.h math.h unistd.h signal.h) AC_HAVE_HEADERS(stdlib.h stdio.h string.h stddef.h math.h unistd.h signal.h)
AC_CHECK_HEADERS(time.h sys/params.h sys/time.h sys/times.h sys/resource.h) AC_CHECK_HEADERS(time.h sys/params.h sys/time.h sys/times.h sys/resource.h)
AC_CHECK_HEADERS(sys/mman.h sys/types.h sys/stat.h ieeefp.h fenv.h) AC_CHECK_HEADERS(sys/mman.h sys/types.h sys/stat.h floatingpoint.h ieeefp.h)
AC_CHECK_HEADERS(fenv.h fptrap.h float.h)
AC_CHECK_HEADER([complex.h],[AC_DEFINE([HAVE_COMPLEX_H], [1], [complex.h exists])]) AC_CHECK_HEADER([complex.h],[AC_DEFINE([HAVE_COMPLEX_H], [1], [complex.h exists])])
AC_CHECK_MEMBERS([struct stat.st_blksize]) AC_CHECK_MEMBERS([struct stat.st_blksize])
...@@ -346,6 +347,13 @@ AC_CHECK_LIB([m],[finite],[AC_DEFINE([HAVE_FINITE],[1],[libm includes finite])]) ...@@ -346,6 +347,13 @@ AC_CHECK_LIB([m],[finite],[AC_DEFINE([HAVE_FINITE],[1],[libm includes finite])])
# Check for GNU libc feenableexcept # Check for GNU libc feenableexcept
AC_CHECK_LIB([m],[feenableexcept],[have_feenableexcept=yes AC_DEFINE([HAVE_FEENABLEEXCEPT],[1],[libm includes feenableexcept])]) AC_CHECK_LIB([m],[feenableexcept],[have_feenableexcept=yes AC_DEFINE([HAVE_FEENABLEEXCEPT],[1],[libm includes feenableexcept])])
# Check for SysV fpsetmask
LIBGFOR_CHECK_FPSETMASK
# Check for AIX fp_trap and fp_enable
AC_CHECK_FUNC([fp_trap],[have_fp_trap=yes AC_DEFINE([HAVE_FP_TRAP],[1],[fp_trap is present])])
AC_CHECK_FUNC([fp_enable],[have_fp_enable=yes AC_DEFINE([HAVE_FP_ENABLE],[1],[fp_enable is present])])
# Runs configure.host to set up necessary host-dependent shell variables. # Runs configure.host to set up necessary host-dependent shell variables.
# We then display a message about it, and propagate them through the # We then display a message about it, and propagate them through the
# build chain. # build chain.
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
# DEFAULTS # DEFAULTS
fpu_host=fpu-generic fpu_host='fpu-generic'
# HOST-SPECIFIC OVERRIDES # HOST-SPECIFIC OVERRIDES
case "${host_cpu}" in case "${host_cpu}" in
...@@ -30,3 +30,11 @@ esac ...@@ -30,3 +30,11 @@ esac
if test "x${have_feenableexcept}" = "xyes"; then if test "x${have_feenableexcept}" = "xyes"; then
fpu_host='fpu-glibc' fpu_host='fpu-glibc'
fi fi
if test "x${have_fpsetmask}" = "xyes"; then
fpu_host='fpu-sysv'
fi
if test "x${have_fp_enable}" = "xyes" && test "x${have_fp_trap}" = "xyes"; then
fpu_host='fpu-aix'
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment