mirror of
https://github.com/boostorg/multiprecision.git
synced 2026-01-19 04:22:11 +00:00
First pass double_fp single-limb optimizations
This commit is contained in:
@@ -298,6 +298,8 @@ class cpp_double_fp_backend
|
||||
|
||||
int u_index { 1 };
|
||||
|
||||
float_type p2_flt { cpp_df_qf_detail::pow2_maker<float_type>::value(std::numeric_limits<float_type>::digits) };
|
||||
|
||||
while (u > static_cast<local_unsigned_integral_type>(UINT8_C(0)))
|
||||
{
|
||||
u >>= static_cast<unsigned>(std::numeric_limits<float_type>::digits);
|
||||
@@ -305,13 +307,14 @@ class cpp_double_fp_backend
|
||||
const float_type
|
||||
xhi
|
||||
{
|
||||
static_cast<float_type>(u & flt_mask)
|
||||
* cpp_df_qf_detail::pow2_maker<float_type>::value(std::numeric_limits<float_type>::digits * u_index)
|
||||
static_cast<float_type>(u & flt_mask) * p2_flt
|
||||
};
|
||||
|
||||
eval_add(*this, cpp_double_fp_backend(xhi));
|
||||
|
||||
++u_index;
|
||||
|
||||
p2_flt *= 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
#include "performance_test_df.hpp"
|
||||
|
||||
// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/Test
|
||||
// g++ -std=gnu++14 -Wall -Wextra -O3 -I/mnt/c/ChrisGitRepos/boost_gsoc2021/multiprecision/performance -I/mnt/c/ChrisGitRepos/boost_gsoc2021/multiprecision/include -I/mnt/c/boost/boost_1_87_0 ./test.cpp -lquadmath -o test
|
||||
// g++ -std=gnu++14 -Wall -Wextra -O3 -I/mnt/c/ChrisGitRepos/modular_boost/multiprecision/performance -I/mnt/c/ChrisGitRepos/modular_boost/multiprecision/include -I/mnt/c/boost/boost_1_89_0 ./test.cpp -lquadmath -o test
|
||||
|
||||
//
|
||||
// Keys in order are:
|
||||
|
||||
@@ -60,9 +60,17 @@
|
||||
#include <boost/multiprecision/float128.hpp>
|
||||
#endif
|
||||
#ifdef TEST_CPP_DOUBLE_FLOAT
|
||||
|
||||
// When using very old GCC, categorically disable this test for cpp_double_fp_backend.
|
||||
// Do not attempt, at the moment, to track down the compiler's "internal failure".
|
||||
|
||||
#if (defined(BOOST_GCC) && !defined(BOOST_CLANG) && (BOOST_GCC < 80000))
|
||||
#else
|
||||
#include <boost/multiprecision/cpp_double_fp.hpp>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable : 4127)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user