|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r81062 - in sandbox/big_number: boost/multiprecision/cpp_int libs/multiprecision/test
From: john_at_[hidden]
Date: 2012-10-25 05:29:05
Author: johnmaddock
Date: 2012-10-25 05:29:04 EDT (Thu, 25 Oct 2012)
New Revision: 81062
URL: http://svn.boost.org/trac/boost/changeset/81062
Log:
Minor changes for __int128 support and fix some C++0x issues
Text files modified:
sandbox/big_number/boost/multiprecision/cpp_int/cpp_int_config.hpp | 19 +++++++++----------
sandbox/big_number/libs/multiprecision/test/test_constexpr.cpp | 10 +++++-----
2 files changed, 14 insertions(+), 15 deletions(-)
Modified: sandbox/big_number/boost/multiprecision/cpp_int/cpp_int_config.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/cpp_int/cpp_int_config.hpp (original)
+++ sandbox/big_number/boost/multiprecision/cpp_int/cpp_int_config.hpp 2012-10-25 05:29:04 EDT (Thu, 25 Oct 2012)
@@ -63,13 +63,12 @@
} // namepsace detail
-#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))) \
- && !defined(BOOST_INTEL) && defined(__WORDSIZE) && (__WORDSIZE == 64)
+#if defined(BOOST_HAS_INT128)
typedef detail::largest_unsigned_type<64>::type limb_type;
typedef detail::largest_signed_type<64>::type signed_limb_type;
-typedef unsigned __int128 double_limb_type;
-typedef __int128 signed_double_limb_type;
+typedef boost::uint128_type double_limb_type;
+typedef boost::int128_type signed_double_limb_type;
static const limb_type max_block_10 = 1000000000000000000uLL;
static const limb_type digits_per_block_10 = 18;
@@ -88,14 +87,14 @@
} // namespace multiprecision
template<>
-class integer_traits<double_limb_type>
- : public std::numeric_limits<double_limb_type>,
- public detail::integer_traits_base<double_limb_type, 0, ~static_cast<double_limb_type>(0)>
+class integer_traits<multiprecision::double_limb_type>
+ : public std::numeric_limits<multiprecision::double_limb_type>,
+ public detail::integer_traits_base<multiprecision::double_limb_type, 0, ~static_cast<multiprecision::double_limb_type>(0)>
{ };
template<>
-class integer_traits<signed_double_limb_type>
- : public std::numeric_limits<signed_double_limb_type>,
- public detail::integer_traits_base<signed_double_limb_type, static_cast<signed_double_limb_type>(static_cast<double_limb_type>(1) << 127), static_cast<signed_double_limb_type>((~static_cast<double_limb_type>(0)) >> 1)>
+class integer_traits<multiprecision::signed_double_limb_type>
+ : public std::numeric_limits<multiprecision::signed_double_limb_type>,
+ public detail::integer_traits_base<multiprecision::signed_double_limb_type, static_cast<multiprecision::signed_double_limb_type>((static_cast<multiprecision::double_limb_type>(1) << 127)), static_cast<multiprecision::signed_double_limb_type>(((~static_cast<multiprecision::double_limb_type>(0)) >> 1))>
{ };
namespace multiprecision{
Modified: sandbox/big_number/libs/multiprecision/test/test_constexpr.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_constexpr.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_constexpr.cpp 2012-10-25 05:29:04 EDT (Thu, 25 Oct 2012)
@@ -31,9 +31,9 @@
using namespace boost::multiprecision;
-template void test1<number<backends::cpp_int_backend<64, false, void, true>, et_off> >();
-template void test1<number<backends::cpp_int_backend<64, true, void, true>, et_off> >();
-template void test3<number<backends::cpp_int_backend<2048, false, void>, et_off> >();
-template void test2<number<backends::cpp_int_backend<2048, true, void>, et_off> >();
+template void test1<number<cpp_int_backend<64, 64, unsigned_magnitude, unchecked, void>, et_off> >();
+template void test1<number<cpp_int_backend<64, 64, signed_magnitude, unchecked, void>, et_off> >();
+template void test3<number<cpp_int_backend<2048, 2048, unsigned_magnitude, unchecked, void>, et_off> >();
+template void test2<number<cpp_int_backend<2048, 2048, signed_magnitude, unchecked, void>, et_off> >();
-#endif
\ No newline at end of file
+#endif
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