HomePhabricator

Consolidate all uses of the fast range mapping technique in util/fastrange.h

Description

Consolidate all uses of the fast range mapping technique in util/fastrange.h

Summary:

Several places in the codebase use the fast range mapping technique described in https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/, some for 32-bit ranges, some for 64-bit ones.

Move all of these to util/fastrange.h, and give them a consistent name.

Backport of core#23994.

Test Plan:

ninja all check-all
ninja bitcoin-fuzzers

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

Differential Revision: https://reviews.bitcoinabc.org/D14394

Details

Provenance
Pieter Wuille <pieter@wuille.net>Authored on Jan 6 2022, 16:27
FabienCommitted on Aug 22 2023, 15:21
FabienPushed on Aug 22 2023, 15:21
Reviewer
Restricted Project
Differential Revision
D14394: Consolidate all uses of the fast range mapping technique in util/fastrange.h
Parents
rABCf4f86f57510d: [Chronik] Add `-chronikperfstats` flag to write performance stats into…
Branches
Unknown
Tags
Unknown