Patch for numeric/interval for better Tru64/CXX support.

Hello, 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. Markus 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. #endif -#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. +#endif + # include <float.h> // write_rnd() and read_rnd() struct alpha_rounding_control

Le mardi 10 janvier 2006 à 12:33 +0100, Markus Schöpflin a écrit :
Hello,
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.
I don't have access to an Alpha computer, so I can't test for such patches. Alpha support was submitted by Felix Höfling and he may have had some reasons to test for these macros.
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.
Since you have CVS access, please commit your patch both on the preprocessor file and the jam file. I hope you don't mind me pushing the maintainership of the interval library on Alpha to you :-). This is especially true for the Jamfile modifications since I don't have any way to test them. Thanks a lot for your work. Best regards, Guillaume

Guillaume Melquiond wrote:
Le mardi 10 janvier 2006 à 12:33 +0100, Markus Schöpflin a écrit :
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.
I don't have access to an Alpha computer, so I can't test for such patches. Alpha support was submitted by Felix Höfling and he may have had some reasons to test for these macros.
OK, I left it alone then.
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.
Since you have CVS access, please commit your patch both on the preprocessor file and the jam file.
Done. I have enabled dynamic rounding for both cxx and g++ on Tru64 and added the check to the header file for cxx. As g++ doesn't define a macro for the rounding mode, this check cannot be done for g++, AFAICT.
I hope you don't mind me pushing the maintainership of the interval library on Alpha to you :-). This is especially true for the Jamfile modifications since I don't have any way to test them.
No problem. I just wanted to ask before I go and make changes to your library. Now let's see what failures remain, maybe I'll find a fix for them.
Thanks a lot for your work.
You're welcome. Markus
participants (2)
-
Guillaume Melquiond
-
Markus Schöpflin