[PPL-devel] [GIT] ppl/ppl(ppl-0_11-branch): The `--disable-fpmath' configure option now disables all floating point computations.

Roberto Bagnara bagnara at cs.unipr.it
Mon Feb 21 09:56:36 CET 2011


Module: ppl/ppl
Branch: ppl-0_11-branch
Commit: d5fdb856d2f20c2dc0fb8f99b76b53cdf66daf58
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=d5fdb856d2f20c2dc0fb8f99b76b53cdf66daf58

Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date:   Mon Feb 21 09:56:13 2011 +0100

The `--disable-fpmath' configure option now disables all floating point computations.

---

 NEWS                       |   13 +++++++++++++
 README.configure           |    5 ++++-
 configure.ac               |   30 ++++++++++++++++++++----------
 m4/ac_check_fpu_control.m4 |    3 ---
 4 files changed, 37 insertions(+), 14 deletions(-)

diff --git a/NEWS b/NEWS
index 0adac77..12cc4a7 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,19 @@ Parma Polyhedra Library NEWS -- history of user-visible changes
 
 
 --------------------------------------------------------------------------
+NEWS for version 0.11.2  (released date to be decided)
+--------------------------------------------------------------------------
+
+Bugfixes
+========
+
+o Fixed the semantics of the `--disable-fpmath' configure option
+   (which is equivalent to `--enable-fpmath=no').  It now disables all
+   floating point computations and, consequently, all numerical
+   abstractions based on floating point numbers.
+
+
+--------------------------------------------------------------------------
 NEWS for version 0.11.1  (released on February 20, 2011)
 --------------------------------------------------------------------------
 
diff --git a/README.configure b/README.configure
index 7f87184..d25ac3f 100644
--- a/README.configure
+++ b/README.configure
@@ -357,7 +357,10 @@ For floating point computations, the option
 
 allows for selecting, on the IA32 and x86_64, the floating point instruction
 set.  The allowed values for INSTRUCTION_SET are `sse', `sse2', `387,
-`sse+387', and `sse2+387'.
+`sse+387', and `sse2+387', `default', and `no'.  The latter option, which
+is equivalent to specifying `--disable-fpmath', has the effect of disabling
+all floating point computation and, consequently, all the numerical
+abstractions based on floating point numbers.
 
 On the other hand, there are configure options to request lesser
 degrees of optimization for the sake of debugging.  These are,
diff --git a/configure.ac b/configure.ac
index baab52d..fdc7610 100644
--- a/configure.ac
+++ b/configure.ac
@@ -378,23 +378,24 @@ no)
 esac
 
 enableval=default
+use_fpmath=yes
 fpmath_may_use_387=yes
 fpmath_may_use_sse=yes
-AC_MSG_CHECKING([whether to select specific floating point arithmetics])
+AC_MSG_CHECKING([whether to use (a specific) floating point arithmetic])
 AC_ARG_ENABLE(fpmath,
   AS_HELP_STRING([--enable-fpmath=INSTRUCTION_SET],
-                 [select floating point arithmetics]))
+                 [select floating point arithmetic]))
 case "${enableval}" in
 sse)
   AC_MSG_RESULT(sse)
   OPT_FLAGS="$OPT_FLAGS -msse -mfpmath=sse"
-  # The SSE instruction set only supports single precision arithmetics:
-  # double and extended precision arithmetics is still done using 387.
+  # The SSE instruction set only supports single precision arithmetic:
+  # double and extended precision arithmetic is still done using 387.
   ;;
 sse2)
   AC_MSG_RESULT(sse2)
   OPT_FLAGS="$OPT_FLAGS -msse2 -mfpmath=sse"
-  # SSE2 still does not support extended precision arithmetics.
+  # SSE2 still does not support extended precision arithmetic.
   ;;
 387)
   AC_MSG_RESULT(387)
@@ -418,7 +419,8 @@ default)
   AC_MSG_RESULT(default)
   ;;
 no)
-  AC_MSG_RESULT(default)
+  AC_MSG_RESULT(no)
+  use_fpmath=no
   ;;
 *)
   AC_MSG_ERROR([bad value ${enableval} for --enable-fpmath, needs sse, sse2, 387, sse+387, sse2+387, default or no])
@@ -427,12 +429,12 @@ esac
 
 if test x"$fpmath_may_use_387" = xyes
 then
-  AC_DEFINE(PPL_FPMATH_MAY_USE_387, 1, [Defined if floating point arithmetics may use the 387 unit.])
+  AC_DEFINE(PPL_FPMATH_MAY_USE_387, 1, [Defined if floating point arithmetic may use the 387 unit.])
 fi
 
 if test x"$fpmath_may_use_sse" = xyes
 then
-  AC_DEFINE(PPL_FPMATH_MAY_USE_SSE, 1, [Defined if floating point arithmetics may use the SSE instruction set.])
+  AC_DEFINE(PPL_FPMATH_MAY_USE_SSE, 1, [Defined if floating point arithmetic may use the SSE instruction set.])
 fi
 
 # Disable all transformations and optimizations that assume default
@@ -663,8 +665,16 @@ AC_LANG(C++)
 # The PPL uses <cmath> for sqrt and other functions in several places.
 AC_SEARCH_LIBS([sqrt], [m])
 
-# Check for the possibility to control the FPU.
-AC_CHECK_FPU_CONTROL
+if test x"$use_fpmath" = xyes
+then
+  # Check for the possibility to control the FPU.
+  AC_CHECK_FPU_CONTROL
+else
+  ac_cv_can_control_fpu=0
+fi
+AM_CONDITIONAL(CAN_CONTROL_FPU, test $ac_cv_can_control_fpu = 1)
+AC_DEFINE_UNQUOTED(PPL_CAN_CONTROL_FPU, $ac_cv_can_control_fpu,
+    [Not zero if the FPU can be controlled.])
 
 # Check whether for the C++ compiler the plain char type is signed.
 AC_CXX_PLAIN_CHAR_IS_SIGNED
diff --git a/m4/ac_check_fpu_control.m4 b/m4/ac_check_fpu_control.m4
index e285f77..cac3a32 100644
--- a/m4/ac_check_fpu_control.m4
+++ b/m4/ac_check_fpu_control.m4
@@ -141,8 +141,5 @@ main() {
     ac_cv_can_control_fpu=0
   )
 )
-AM_CONDITIONAL(CAN_CONTROL_FPU, test $ac_cv_can_control_fpu = 1)
-AC_DEFINE_UNQUOTED(PPL_CAN_CONTROL_FPU, $ac_cv_can_control_fpu,
-    [Not zero if the FPU can be controlled.])
 AC_LANG_POP(C++)
 ])




More information about the PPL-devel mailing list