Boost logo

Boost-Commit :

From: guillaume.melquiond_at_[hidden]
Date: 2008-08-05 12:28:35


Author: gmelquio
Date: 2008-08-05 12:28:34 EDT (Tue, 05 Aug 2008)
New Revision: 47993
URL: http://svn.boost.org/trac/boost/changeset/47993

Log:
Added support for Sun compiler on x86. Removed some template parameters when forcing rounding.
Text files modified:
   trunk/boost/numeric/interval/detail/c99_rounding_control.hpp | 27 +++++++++++++++------------
   trunk/boost/numeric/interval/detail/c99sub_rounding_control.hpp | 4 ++--
   trunk/boost/numeric/interval/detail/x86_rounding_control.hpp | 4 ++--
   3 files changed, 19 insertions(+), 16 deletions(-)

Modified: trunk/boost/numeric/interval/detail/c99_rounding_control.hpp
==============================================================================
--- trunk/boost/numeric/interval/detail/c99_rounding_control.hpp (original)
+++ trunk/boost/numeric/interval/detail/c99_rounding_control.hpp 2008-08-05 12:28:34 EDT (Tue, 05 Aug 2008)
@@ -16,27 +16,30 @@
 namespace boost {
 namespace numeric {
 namespace interval_lib {
-namespace detail {
-
-struct c99_rounding_control: c99_rounding
-{
- template<class T>
- static T force_rounding(const T& r) { volatile T r_ = r; return r_; }
-};
-
-} // namespace detail
 
 template<>
 struct rounding_control<float>:
- detail::c99_rounding_control { };
+ detail::c99_rounding_control
+{
+ static float force_rounding(float const &r)
+ { volatile float r_ = r; return r_; }
+};
 
 template<>
 struct rounding_control<double>:
- detail::c99_rounding_control { };
+ detail::c99_rounding_control
+{
+ static double force_rounding(double const &r)
+ { volatile double r_ = r; return r_; }
+};
 
 template<>
 struct rounding_control<long double>:
- detail::c99_rounding_control { };
+ detail::c99_rounding_control
+{
+ static long double force_rounding(long double const &r)
+ { volatile long double r_ = r; return r_; }
+};
 
 } // namespace interval_lib
 } // namespace numeric

Modified: trunk/boost/numeric/interval/detail/c99sub_rounding_control.hpp
==============================================================================
--- trunk/boost/numeric/interval/detail/c99sub_rounding_control.hpp (original)
+++ trunk/boost/numeric/interval/detail/c99sub_rounding_control.hpp 2008-08-05 12:28:34 EDT (Tue, 05 Aug 2008)
@@ -20,11 +20,11 @@
 
 extern "C" { double rint(double); }
 
-struct c99_rounding
+struct c99_rounding_control
 {
   typedef int rounding_mode;
 
- static void set_rounding_mode(const rounding_mode mode) { fesetround(mode); }
+ static void set_rounding_mode(rounding_mode mode) { fesetround(mode); }
   static void get_rounding_mode(rounding_mode &mode) { mode = fegetround(); }
   static void downward() { set_rounding_mode(FE_DOWNWARD); }
   static void upward() { set_rounding_mode(FE_UPWARD); }

Modified: trunk/boost/numeric/interval/detail/x86_rounding_control.hpp
==============================================================================
--- trunk/boost/numeric/interval/detail/x86_rounding_control.hpp (original)
+++ trunk/boost/numeric/interval/detail/x86_rounding_control.hpp 2008-08-05 12:28:34 EDT (Tue, 05 Aug 2008)
@@ -17,7 +17,7 @@
 # include <boost/numeric/interval/detail/bcc_rounding_control.hpp>
 #elif defined(_MSC_VER)
 # include <boost/numeric/interval/detail/msvc_rounding_control.hpp>
-#elif defined(__MWERKS__) || defined(__ICC)
+#elif defined(__MWERKS__) || defined(__ICC) || defined (__SUNPRO_CC)
 # define BOOST_NUMERIC_INTERVAL_USE_C99_SUBSYSTEM
 # include <boost/numeric/interval/detail/c99sub_rounding_control.hpp>
 #else
@@ -31,7 +31,7 @@
 namespace detail {
 
 #ifdef BOOST_NUMERIC_INTERVAL_USE_C99_SUBSYSTEM
-typedef c99_rounding x86_rounding_control;
+typedef c99_rounding_control x86_rounding_control;
 #undef BOOST_NUMERIC_INTERVAL_USE_C99_SUBSYSTEM
 #else
 struct fpu_rounding_modes


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk