Conversation
ibmibmibm
force-pushed
the
frexp-speed
branch
2 times, most recently
from
October 3, 2026 07:32
fe185ca to
c057a25
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1488 +/- ##
=========================================
+ Coverage 98.8% 98.8% +0.1%
=========================================
Files 318 319 +1
Lines 26496 26596 +100
Branches 2252 2258 +6
=========================================
+ Hits 26160 26260 +100
Misses 336 336
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Member
|
Hi @ibmibmibm I believe you can find the 128 and 256 bit integer operations in the existing codebase already without writing them from scratch. I did not check the exact operations, but normal ones should be available. If you need some specialized optimized ones, however, they might not be already present in the repo. |
ibmibmibm
marked this pull request as ready for review
October 3, 2026 12:03
ibmibmibm
marked this pull request as draft
October 3, 2026 12:30
ibmibmibm
force-pushed
the
frexp-speed
branch
3 times, most recently
from
October 3, 2026 23:46
2d17965 to
56db856
Compare
Contributor
Author
|
Duplicated functions removed, thanks |
umul512_hi computes four umul256 products and adds them with carry compares. umul256 also has branches for operands below 2^64. The new umul512_hi computes a schoolbook product of 64-bit limbs, which gives the same value. umul256_hi gives the high 128 bits of the product of two uint128_t. It adds only uint128_t values, because GCC adds a uint64_t to a uint128_t with a compare and a branch. The next commit uses both functions in frexp.
ibmibmibm
force-pushed
the
frexp-speed
branch
3 times, most recently
from
October 4, 2026 11:56
32ba1d3 to
8d7fcbc
Compare
frexp_impl writes v * 10^n as s * 5^k5 * 2^k5, and gets s * 5^k5 in a word of 64, 128 or 256 bits from a table of powers of 5. fenv_round rounds the digits once in the current rounding mode. decimal64 and decimal128 first try a word of half the width, and use the full width only if the error of the narrow word can change the result. countl_zero gives the correct count for types of fewer than 64 bits on compilers without __builtin_clz. frexp computes in the type of the value, also when BOOST_DECIMAL_DEC_EVAL_METHOD is 1 or 2. Fixes boostorg#1487
ibmibmibm
marked this pull request as ready for review
October 4, 2026 12:53
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
frexp now gives the correctly rounded result for all finite inputs in the current rounding mode, and it is 16 to 39 times faster.
The old frexp_impl has four defects:
The new frexp_impl
Other changes
Results
Fixes #1487