Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:49:07

0001 /* Boost interval/hw_rounding.hpp template implementation file
0002  *
0003  * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion
0004  * Copyright 2005 Guillaume Melquiond
0005  *
0006  * Distributed under the Boost Software License, Version 1.0.
0007  * (See accompanying file LICENSE_1_0.txt or
0008  * copy at http://www.boost.org/LICENSE_1_0.txt)
0009  */
0010 
0011 #ifndef BOOST_NUMERIC_INTERVAL_HW_ROUNDING_HPP
0012 #define BOOST_NUMERIC_INTERVAL_HW_ROUNDING_HPP
0013 
0014 #include <boost/config.hpp>
0015 #include <boost/numeric/interval/rounding.hpp>
0016 #include <boost/numeric/interval/rounded_arith.hpp>
0017 
0018 #define BOOST_NUMERIC_INTERVAL_NO_HARDWARE
0019 
0020 // define appropriate specialization of rounding_control for built-in types
0021 #if defined(__x86_64__) && !defined(BOOST_NO_FENV_H)
0022 #  include <boost/numeric/interval/detail/c99_rounding_control.hpp>
0023 #elif defined(__i386__) || defined(_M_IX86) || defined(__BORLANDC__) && !defined(__clang__) || defined(_M_X64)
0024 #  include <boost/numeric/interval/detail/x86_rounding_control.hpp>
0025 #elif defined(__i386) && defined(__SUNPRO_CC)
0026 #  include <boost/numeric/interval/detail/x86_rounding_control.hpp>
0027 #elif defined(powerpc) || defined(__powerpc__) || defined(__ppc__)
0028 #  include <boost/numeric/interval/detail/ppc_rounding_control.hpp>
0029 #elif defined(sparc) || defined(__sparc__)
0030 #  include <boost/numeric/interval/detail/sparc_rounding_control.hpp>
0031 #elif defined(alpha) || defined(__alpha__)
0032 #  include <boost/numeric/interval/detail/alpha_rounding_control.hpp>
0033 #elif defined(ia64) || defined(__ia64) || defined(__ia64__)
0034 #  include <boost/numeric/interval/detail/ia64_rounding_control.hpp>
0035 #endif
0036 
0037 #if defined(BOOST_NUMERIC_INTERVAL_NO_HARDWARE) && !defined(BOOST_NO_FENV_H)
0038 #  include <boost/numeric/interval/detail/c99_rounding_control.hpp>
0039 #endif
0040 
0041 #if defined(BOOST_NUMERIC_INTERVAL_NO_HARDWARE)
0042 #  undef BOOST_NUMERIC_INTERVAL_NO_HARDWARE
0043 #  error Boost.Numeric.Interval: Please specify rounding control mechanism.
0044 #endif
0045 
0046 namespace boost {
0047 namespace numeric {
0048 namespace interval_lib {
0049 
0050 /*
0051  * Three specializations of rounded_math<T>
0052  */
0053 
0054 template<>
0055 struct rounded_math<float>
0056   : save_state<rounded_arith_opp<float> >
0057 {};
0058 
0059 template<>
0060 struct rounded_math<double>
0061   : save_state<rounded_arith_opp<double> >
0062 {};
0063 
0064 template<>
0065 struct rounded_math<long double>
0066   : save_state<rounded_arith_opp<long double> >
0067 {};
0068 
0069 } // namespace interval_lib
0070 } // namespace numeric
0071 } // namespace boost
0072 
0073 #endif // BOOST_NUMERIC_INTERVAL_HW_ROUNDING_HPP