]> www.ginac.de Git - cln.git/commitdiff
Get rid of CL_REQUIRE/CL_PROVIDE(cl_ieee).
authorAlexei Sheplyakov <varg@theor.jinr.ru>
Thu, 21 Aug 2008 18:00:49 +0000 (22:00 +0400)
committerAlexei Sheplyakov <varg@theor.jinr.ru>
Wed, 27 Aug 2008 04:41:04 +0000 (08:41 +0400)
While at it, remove work around for ancient (fixed in 8+ years) glibc/Linux
bug (the kernel and/or libc was initializing FPU into non-IEEE mode, so division
by 0 resulted in SIGFPE instead of NaN).

17 files changed:
autoconf/aclocal.m4
configure.ac
include/cln/dfloat.h
include/cln/ffloat.h
include/cln/float.h
m4/fpu_control.m4 [deleted file]
src/float/base/cl_ieee.cc [deleted file]
src/float/base/cl_ieee.h [deleted file]
src/float/cl_float_config.h.in [deleted file]
src/float/dfloat/elem/cl_DF_div.cc
src/float/dfloat/elem/cl_DF_minus.cc
src/float/dfloat/elem/cl_DF_mul.cc
src/float/dfloat/elem/cl_DF_plus.cc
src/float/ffloat/elem/cl_FF_div.cc
src/float/ffloat/elem/cl_FF_minus.cc
src/float/ffloat/elem/cl_FF_mul.cc
src/float/ffloat/elem/cl_FF_plus.cc

index 4edddfe6008502da73c72dcaeb284c783f3b5c4a..a0bc057bc65177e05c807c9876b794b6796af72e 100644 (file)
@@ -7,7 +7,6 @@ dnl Borrowed from GNU clisp.
 m4_include([alloca.m4])
 m4_include([as-underscore.m4])
 m4_include([c++-constructors.m4])
-m4_include([fpu_control.m4])
 m4_include([general.m4])
 m4_include([gettimeofday.m4])
 m4_include([param.m4]) dnl called intparam.m4 in clisp
index 32325d9b58fe51c0949f185a7d75b1573a768444..f8a8fa945c7c3fb537ec03dae7845963cdf5f346 100644 (file)
@@ -13,7 +13,7 @@ dnl
 dnl
 AC_INIT(src/integer/gcd/cl_I_gcd.cc)
 AC_CONFIG_AUX_DIR(autoconf)
-AC_CONFIG_HEADER(include/cln/config.h include/cln/version.h src/base/cl_base_config.h src/base/cl_gmpconfig.h src/float/cl_float_config.h src/timing/cl_t_config.h)
+AC_CONFIG_HEADER(include/cln/config.h include/cln/version.h src/base/cl_base_config.h src/base/cl_gmpconfig.h src/timing/cl_t_config.h)
 AC_PROG_MAKE_SET
 dnl This piece of sed script replaces every line containing '@subdir@'
 dnl by several consecutive lines, each referencing one subdir.
@@ -135,8 +135,6 @@ dnl           checks for functions and declarations
 dnl
 CL_ALLOCA
                       dnl set variable ALLOCA, DEFS NO_ALLOCA
-CL_FPU_CONTROL
-                      dnl DEFS HAVE_FPU_CONTROL_T, HAVE_SETFPUCW
 CL_GETTIMEOFDAY
                       dnl DEFS HAVE_GETTIMEOFDAY, GETTIMEOFDAY_DOTS, GETTIMEOFDAY_TZP_T
 ac_cv_func_ftime=no
index edb8574ad0ee3cd05f8c0ee71ac45fb2cdab2c9b..2e96eb3c5c777ce7b8327f7dfd5c120d02549dd3 100644 (file)
@@ -309,7 +309,6 @@ inline cl_DF& operator/= (cl_DF& x, const double y) { return x = x / y; }
 
 
 /* */
-CL_REQUIRE(cl_ieee)
 
 
 // Runtime typing support.
index 9c150bfae5b00fff50f8912d11f4e8ecc07c438e..61417a0f5f1e71d0b87a8e0c897fdbc939e7e28c 100644 (file)
@@ -308,7 +308,6 @@ inline cl_FF& operator/= (cl_FF& x, const cl_FF& y) { return x = x / y; }
 inline cl_FF& operator/= (cl_FF& x, const float y) { return x = x / y; }
 
 
-CL_REQUIRE(cl_ieee)
 /* */
 
 
index 1ab2d3d2c5feac32f6ef4bf6be0b0cdd4e7ad093..e262ca067ae2bf3ecdb0c907e036307bbfc10c65 100644 (file)
@@ -760,7 +760,6 @@ public:
 };
 
 
-CL_REQUIRE(cl_ieee)
 
 
 // If this is true, floating point underflow returns zero instead of throwing an exception.
diff --git a/m4/fpu_control.m4 b/m4/fpu_control.m4
deleted file mode 100644 (file)
index b494d68..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-dnl -*- Autoconf -*-
-dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
-
-AC_PREREQ(2.57)
-
-AC_DEFUN([CL_FPU_CONTROL],
-[dnl Check for Linux with <fpu_control.h> and fpu_control_t or __setfpucw().
-dnl glibc versions since October 1998 define fpu_control_t. Earlier versions
-dnl define and declare __setfpucw(). Very early Linux libc versions have none,
-dnl and __fpu_control is of type `unsigned short'.
-CL_COMPILE_CHECK([fpu_control_t], cl_cv_type_fpu_control_t,
-[#include <fpu_control.h>], [fpu_control_t x;],
-AC_DEFINE(HAVE_FPU_CONTROL_T,,[have <fpu_control.h> and it defines the fpu_control_t type]))
-CL_COMPILE_CHECK([__setfpucw], cl_cv_func_setfpucw,
-[#include <fpu_control.h>], [__setfpucw(_FPU_IEEE);],
-AC_DEFINE(HAVE_SETFPUCW,,[have <fpu_control.h> and it declares the __setfpucw() function]))
-])
diff --git a/src/float/base/cl_ieee.cc b/src/float/base/cl_ieee.cc
deleted file mode 100644 (file)
index 73b6105..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-// System dependent IEEE floating-point coprocessor initialization.
-
-// General includes.
-#include "cl_sysdep.h"
-
-CL_PROVIDE(cl_ieee)
-
-// Specification.
-#include "cl_ieee.h"
-
-
-// Implementation.
-
-#include "cl_FF.h"
-#include "cl_DF.h"
-#include "cl_float_config.h"
-
-#if (defined(linux) || defined(__linux)) && (defined(FAST_FLOAT) || defined(FAST_DOUBLE))
-
-// Division by 0.0 should return NaN and not raise an SIGFPE.
-// For this, we either have to link with -lieee or copy some
-// part from libc-linux/sysdeps/linux/{i386,m68k}/ieee.c:
-
-#include <fpu_control.h>
-
-#if 0 // Unfortunately this gives an error if also linked with -lieee
-       #if defined(HAVE_FPU_CONTROL_T)
-               fpu_control_t __fpu_control = _FPU_IEEE;
-       #else
-               unsigned short __fpu_control = _FPU_IEEE;
-       #endif
-#else
-AT_INITIALIZATION(ieee)
-{
-       #if defined(_FPU_IEEE)
-               #if defined(HAVE_FPU_CONTROL_T)
-                       extern fpu_control_t __fpu_control;
-                       __fpu_control = _FPU_IEEE;
-               #elif defined(HAVE_SETFPUCW)
-                       __setfpucw(_FPU_IEEE);
-               #else
-                       extern unsigned short __fpu_control;
-                       __fpu_control = _FPU_IEEE;
-               #endif
-       #else
-               // Nothing to do (as on some architectures):
-               // probably this means that _FPU_DEFAULT is just as good as _FPU_IEEE.
-       #endif
-}
-#endif
-
-#endif
-
-namespace cln {
-
-// This dummy links in this module whenever some module needs IEEE floats.
-int cl_ieee_module;
-
-}  // namespace cln
-
-CL_PROVIDE_END(cl_ieee)
diff --git a/src/float/base/cl_ieee.h b/src/float/base/cl_ieee.h
deleted file mode 100644 (file)
index 0081c46..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// IEEE floating-point
-
-#ifndef _CL_IEEE_H
-#define _CL_IEEE_H
-
-namespace cln {
-
-// To make sure that cl_ieee.cc is linked in.
-// NEED_IEEE_FLOATS()
-#if (defined(linux) || defined(__linux)) // only needed on Linux
-  #define NEED_IEEE_FLOATS()  \
-    CL_REQUIRE(cl_ieee)                                                        \
-    CL_FORCE_LINK(CONCAT(cl_ieee_dummy_,__LINE__), cl_ieee_module)
-#else
-  #define NEED_IEEE_FLOATS()
-#endif
-extern int cl_ieee_module;
-
-}  // namespace cln
-
-#endif /* _CL_IEEE_H */
diff --git a/src/float/cl_float_config.h.in b/src/float/cl_float_config.h.in
deleted file mode 100644 (file)
index bc62a1e..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Defines OS dependent macros
-
-#ifndef _CL_FLOAT_CONFIG_H
-#define _CL_FLOAT_CONFIG_H
-
-/* These definitions are adjusted by `configure' automatically. */
-
-
-/* functions and declarations */
-
-/* CL_FPU_CONTROL */
-/* Define if you have <fpu_control.h> and it defines the fpu_control_t type. */
-#undef HAVE_FPU_CONTROL_T
-/* Define if you have <fpu_control.h> and it declares the __setfpucw()
-   function. */
-#undef HAVE_SETFPUCW
-
-
-#endif /* _CL_FLOAT_CONFIG_H */
-
index c8211d414780adc60238dfd39bd58e4b7c210afb..d2d8adaec0711fae732a015ea30b8f6d1c0bb0ea 100644 (file)
 #include "cl_F.h"
 #include "cl_low.h"
 #include "cl_DS.h"
-#include "cl_ieee.h"
 
 #include "cl_inline.h"
 #include "cl_DF_zerop.cc"
 
 namespace cln {
 
-NEED_IEEE_FLOATS()
 
 const cl_DF operator/ (const cl_DF& x1, const cl_DF& x2)
 {
index 5c2608361e54d2f148aea5f87485f27b2ba242f6..1e5447f773109bd4e6ce6c93d3ece66fab49d75f 100644 (file)
 // Implementation.
 
 #include "cl_DF.h"
-#include "cl_ieee.h"
 
 namespace cln {
 
-NEED_IEEE_FLOATS()
 
 const cl_DF operator- (const cl_DF& x1, const cl_DF& x2)
 {
index 762b7799de61ad116271480a732cd39753403611..050d2c5a41166e942c0c58c96e52cc442dff1479 100644 (file)
 #include "cl_F.h"
 #include "cl_low.h"
 #include "cl_DS.h"
-#include "cl_ieee.h"
 
 #include "cl_inline.h"
 #include "cl_DF_zerop.cc"
 
 namespace cln {
 
-NEED_IEEE_FLOATS()
 
 const cl_DF operator* (const cl_DF& x1, const cl_DF& x2)
 {
index 90cb6ce27276ba7bc1b58051ebb46ad85184aff2..4b94b486eab2c6adef6705d3248e24f27eede73b 100644 (file)
 
 #include "cl_DF.h"
 #include "cl_F.h"
-#include "cl_ieee.h"
 #include "cl_xmacros.h"
 
 namespace cln {
 
-NEED_IEEE_FLOATS()
 
 const cl_DF operator+ (const cl_DF& x1, const cl_DF& x2)
 {
index 2d90939dd3b8da451b8f6233a62ff9657e39139c..ac41927db8668776225c7d84cf777c1a7e811f84 100644 (file)
 #include "cl_N.h"
 #include "cl_F.h"
 #include "cl_low.h"
-#include "cl_ieee.h"
 
 #include "cl_inline.h"
 #include "cl_FF_zerop.cc"
 
 namespace cln {
 
-NEED_IEEE_FLOATS()
 
 const cl_FF operator/ (const cl_FF& x1, const cl_FF& x2)
 {
index fbcd72dba4d6ea9074e3353f86ec925eafdfc54c..48045d3192cfad628c633f5d9c81d2c392856f17 100644 (file)
 // Implementation.
 
 #include "cl_FF.h"
-#include "cl_ieee.h"
 
 namespace cln {
 
-NEED_IEEE_FLOATS()
 
 const cl_FF operator- (const cl_FF& x1, const cl_FF& x2)
 {
index c258c71f8e1301a4c987b9a12273ee3838528b80..7127c8b88fb69916ed2d1adfd8dd09a6ff85fff4 100644 (file)
 #include "cl_FF.h"
 #include "cl_F.h"
 #include "cl_low.h"
-#include "cl_ieee.h"
 
 #include "cl_inline.h"
 #include "cl_FF_zerop.cc"
 
 namespace cln {
 
-NEED_IEEE_FLOATS()
 
 const cl_FF operator* (const cl_FF& x1, const cl_FF& x2)
 {
index f84954b8fb549de078e0fd56c4c9b95bdd6b5d22..7937e2ab39d796c36cb1d15b196c1c4c6e533ade 100644 (file)
 
 #include "cl_FF.h"
 #include "cl_F.h"
-#include "cl_ieee.h"
 #include "cl_xmacros.h"
 
 namespace cln {
 
-NEED_IEEE_FLOATS()
 
 const cl_FF operator+ (const cl_FF& x1, const cl_FF& x2)
 {