mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-10 08:22:43 +02:00
Function mask_find_rank_bit() returns the bit position in mask <m> of the nth bit set of rank <r>, between 0 and LONGBITS-1 included, starting from the left. For example ranks 0,1,2,3 for mask 0x55 will be 6, 4, 2 and 0 respectively. This algorithm is based on a popcount variant and is described here : https://graphics.stanford.edu/~seander/bithacks.html.