numeric::interval library an Alpha processor under OSF1

Hello, I would like to use the numeric::interval library on an Alpha EV 6.8 processor under the OSF1 operating system. My program runs fine under Linux on a Pentium 4, but on the Alpha machine, g++ tells me: boost/numeric/interval/hw_rounding.hpp:26:4: #error Boost.Numeric.Interval: Please specify rounding control mechanism. What has to be done? Where do I have to specifiy the rounding controls, how much do I need to know about processor internals etc? Which tests can and have to be done afterwards? Thanks for any advice! Best regards, Erwin

Le jeudi 21 juillet 2005 à 11:35 +0200, Erwin a écrit :
Hello,
I would like to use the numeric::interval library on an Alpha EV 6.8 processor under the OSF1 operating system. My program runs fine under Linux on a Pentium 4, but on the Alpha machine, g++ tells me:
boost/numeric/interval/hw_rounding.hpp:26:4: #error Boost.Numeric.Interval: Please specify rounding control mechanism.
What has to be done? Where do I have to specifiy the rounding controls, how much do I need to know about processor internals etc? Which tests can and have to be done afterwards?
I unfortunately never had access to an Alpha computer, so I didn't get to write the rounding routines for this processor (EV6.8 is a 21264, right?). If you want to add support for it, you could first try to create a new rounding detail file. It would be almost identical to boost/numeric/interval/detail/ppc_rounding_control.hpp. It has to be referenced from the file boost/numeric/interval/hw_rounding.hpp. This is only a matter of adding a few preprocessor directives. In this new file, the asm instructions mtfsf and mfss of the PowerPC have to be replaced by accesses (mf_fcpr and mt_fcpr?) to the fpcr register of the Alpha processor. The rounding mode constants also have to be changed accordingly. This is the stage that requires to know a bit about the processor internals. Then your programs would probably have to be compiled with these GCC options in order for these changes to have effect: -mieee -mfp-rounding-mode=d -mfloat-ieee The tests are in libs/numeric/interval/test. Best regards, Guillaume PS: Do not hesitate to contact me privately, if you want to add support for your processor. I would be glad to help you and then commit the modifications to the Boost library.

Guillaume Melquiond wrote:
I unfortunately never had access to an Alpha computer, so I didn't get to write the rounding routines for this processor (EV6.8 is a 21264, right?).
If you want to add support for it, you could first try to create a new rounding detail file. It would be almost identical to boost/numeric/interval/detail/ppc_rounding_control.hpp. It has to be referenced from the file boost/numeric/interval/hw_rounding.hpp. This is only a matter of adding a few preprocessor directives.
In this new file, the asm instructions mtfsf and mfss of the PowerPC have to be replaced by accesses (mf_fcpr and mt_fcpr?) to the fpcr register of the Alpha processor. The rounding mode constants also have to be changed accordingly. This is the stage that requires to know a bit about the processor internals.
Then your programs would probably have to be compiled with these GCC options in order for these changes to have effect: -mieee -mfp-rounding-mode=d -mfloat-ieee
The tests are in libs/numeric/interval/test.
Attached is a first stab at this I did ages ago. It is a good starting
point, but unfortunately not all tests pass, mainly because of issues with
sqrt, IIRC. I had some mail exchange with HP about this but I can't
remember the details right now. I seem to remember that sqrt doesn't have
to adhere to the dynamic rounding modes, and maybe the tests are wrong in
this area, but I'm not really sure.
I will be away for a week, but upon return I will be available to perhaps
create real support for interval on alpha.
Note that for the rounding mode to have any effect, you need to use special
compiler (and linker) options, -ieee -fprmd should be enough for cxx, IIRC.
HTH, Markus
/* Boost interval/detail/alpha_rounding_control.hpp file
*
* Copyright 2005 Markus Schöpflin
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or
* copy at http://www.boost.org/LICENSE_1_0.txt)
*
* The basic code in this file was kindly provided by Jeremy Siek.
*/
#ifndef BOOST_NUMERIC_INTERVAL_DETAIL_ALPHA_ROUNDING_CONTROL_HPP
#define BOOST_NUMERIC_INTERVAL_DETAIL_ALPHA_ROUNDING_CONTROL_HPP
#if !defined(__alpha)
# error This header is only intended for ALPHA CPUs.
#endif
#include
participants (3)
-
Erwin
-
Guillaume Melquiond
-
Markus Schöpflin