diff options
author | Bruno Haible <bruno@clisp.org> | 2007-03-25 23:59:54 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2007-03-25 23:59:54 +0000 |
commit | cbda7205fd670a9d63b8fbfd02f6fff81c142fd4 (patch) | |
tree | 46bc4ff134960271ba4d21342bf6ad6dd1f8b08f | |
parent | b5a781f1425a6550a857c7f36816728aa1039665 (diff) | |
download | gnulib-cbda7205fd670a9d63b8fbfd02f6fff81c142fd4.tar.gz |
New module 'fpieee'.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | m4/fpieee.m4 | 45 | ||||
-rw-r--r-- | modules/fpieee | 23 | ||||
-rw-r--r-- | modules/isnan-nolibm | 1 | ||||
-rw-r--r-- | modules/isnanl | 1 | ||||
-rw-r--r-- | modules/isnanl-nolibm | 1 |
6 files changed, 79 insertions, 0 deletions
@@ -1,5 +1,13 @@ 2007-03-25 Bruno Haible <bruno@clisp.org> + * modules/fpieee: New file. + * m4/fpieee.m4: New file. + * modules/isnan-nolibm (Depends-on): Add fpieee. + * modules/isnanl-nolibm (Depends-on): Add fpieee. + * modules/isnanl (Depends-on): Add fpieee. + +2007-03-25 Bruno Haible <bruno@clisp.org> + * m4/frexpl.m4 (gl_FUNC_FREXPL_WORKS): Test also finite numbers. 2007-03-25 Bruno Haible <bruno@clisp.org> diff --git a/m4/fpieee.m4 b/m4/fpieee.m4 new file mode 100644 index 0000000000..fd897b0e8b --- /dev/null +++ b/m4/fpieee.m4 @@ -0,0 +1,45 @@ +# fpieee.m4 serial 1 +dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl IEEE 754 standardized three items: +dnl - The formats of single-float and double-float - nowadays commonly +dnl available as 'float' and 'double' in C and C++. +dnl No autoconf test needed. +dnl - The overflow and division by zero behaviour: The result are values +dnl '±Inf' and 'NaN', rather than exceptions as it was before. +dnl This file provides an autoconf macro for ensuring this behaviour of +dnl floating-point operations. +dnl - A set of conditions (overflow, underflow, inexact, etc.) which can +dnl be configured to trigger an exception. +dnl This cannot be done in a portable way: it depends on the compiler, +dnl libc, kernel, and CPU. No autoconf macro is provided for this. + +dnl Ensure non-trapping behaviour of floating-point overflow and +dnl floating-point division by zero. +dnl (For integer overflow, see gcc's -ftrapv option; for integer division by +dnl zero, see the autoconf macro in intdiv0.m4.) + +AC_DEFUN([gl_FP_IEEE], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + # IEEE behaviour is the default on all CPUs except Alpha + # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4). + case "$host_cpu" in + alpha*) + # On Alpha systems, a compiler option provides the behaviour. + # See the ieee(3) manual page, also available at + # <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM> + if test -n "$GCC"; then + # GCC has the option -mieee. + CPPFLAGS="$CPPFLAGS -mieee" + else + # Compaq (ex-DEC) C has the option -ieee. + CPPFLAGS="$CPPFLAGS -mieee" + fi + ;; + esac +]) diff --git a/modules/fpieee b/modules/fpieee new file mode 100644 index 0000000000..174627a94a --- /dev/null +++ b/modules/fpieee @@ -0,0 +1,23 @@ +Description: +Ensure IEEE compliant floating-point operations (overflow and division by zero). + +Files: +m4/fpieee.m4 + +Depends-on: + +configure.ac-early: +AC_REQUIRE([gl_FP_IEEE]) + +configure.ac: + +Makefile.am: + +Include: + +License: +LGPL + +Maintainer: +Bruno Haible + diff --git a/modules/isnan-nolibm b/modules/isnan-nolibm index 43adb609f9..101dd94f7d 100644 --- a/modules/isnan-nolibm +++ b/modules/isnan-nolibm @@ -8,6 +8,7 @@ lib/float+.h m4/isnan.m4 Depends-on: +fpieee configure.ac: gl_FUNC_ISNAN_NO_LIBM diff --git a/modules/isnanl b/modules/isnanl index 7e60555745..c3f768a8a5 100644 --- a/modules/isnanl +++ b/modules/isnanl @@ -10,6 +10,7 @@ m4/isnanl.m4 m4/longdouble.m4 Depends-on: +fpieee configure.ac: gl_FUNC_ISNANL diff --git a/modules/isnanl-nolibm b/modules/isnanl-nolibm index d45825a0d0..9da825c467 100644 --- a/modules/isnanl-nolibm +++ b/modules/isnanl-nolibm @@ -10,6 +10,7 @@ m4/isnanl.m4 m4/longdouble.m4 Depends-on: +fpieee configure.ac: gl_FUNC_ISNANL_NO_LIBM |