Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2006-01-10 06:33:04


support for this platform has recently appeared in Boost but currently
there are a number of test failures.

Some of these test failures can be attributed to the fact that the
regression tests are compiled without dynamic rounding mode enabled. Cxx
needs an extra command line flag (-fprm d) for this.

If I understand things correctly, the interval library relies on dynamic
rounding to be always enabled, therefore I propose attached patch which
checks this for Tru64/cxx.

Note that when this patch is applied, all interval tests will fail for
Tru64/cxx, but this can be fixed by modifying the test Jamfile to enable
dynamic rounding for the tests. If the patch is accepted, I will fix this
or provide a patch, whichever is preferred.

Attached patch also changes the test for __DECCXX__ to __DECCXX, because
this is the macro that the Tru64/cxx compiler defines. Also I'm wondering
what the test for __digital__ is supposed to do, AFAIK there are only cxx
and g++ available for this platform anyway.

The same problem exists for g++ on alpha but I don't know if the presence
of dynamic rounding can be checked for this compiler. Anyway, the needed
flag to enable dynamic rounding is -mfp-rounding-mode=d on this compiler. I
could add this to the test Jamfile, too.

Note that enabling dynamic rounding doesn't clear all errors, but it would
be a start and perhaps enable me or others to root out the other errors and
achieve proper support of Alpha hardware in the interval library.


Index: alpha_rounding_control.hpp
RCS file: /cvsroot/boost/boost/boost/numeric/interval/detail/alpha_rounding_control.hpp,v
retrieving revision 1.2
diff -u -w -r1.2 alpha_rounding_control.hpp
--- alpha_rounding_control.hpp 27 Sep 2005 06:08:10 -0000 1.2
+++ alpha_rounding_control.hpp 10 Jan 2006 11:05:03 -0000
@@ -14,7 +14,7 @@
 #error This header only works on Alpha CPUs.
-#if defined(__GNUC__) || defined(__digital__) || defined(__DECCXX__)
+#if defined(__GNUC__) || defined(__digital__) || defined(__DECCXX)
 namespace boost {
 namespace numeric {
@@ -49,7 +49,12 @@
     static void to_nearest() { set_rounding_mode(mode_to_nearest.dmode); }
     static void toward_zero() { set_rounding_mode(mode_toward_zero.dmode); }
-#elif defined(__digital__) || defined(__DECCXX__)
+#elif defined(__digital__) || defined(__DECCXX)
+#if defined(__DECCXX) && !(defined(__FLT_ROUNDS) && __FLT_ROUNDS == -1)
+#error Dynamic rounding mode not enabled. See cxx man page for details.
 # include <float.h> // write_rnd() and read_rnd()
     struct alpha_rounding_control

Boost list run by bdawes at, gregod at, cpdaniel at, john at