Boost logo

Boost Users :

Subject: Re: [Boost-users] run-time integer log2
From: Vicente Botet Escriba (vicente.botet_at_[hidden])
Date: 2010-07-13 09:31:27

Joel Falcou-3 wrote:
> Tim Blechmann wrote:
>> i see, maybe it would be an interesting addition to boost.integer to
>> provide
>> a generic and efficient version, based on bsr/ffs or the like ...
> There is a lot of branchless or SWAR algorithm to salvaged from there
> and to be indeed made generic or at least platform independant w/r to
> various things. Other thign we never did is benching all of the versions
> of a given algorithm (with/without branch) on different platform to add
> a proper #ifdef/else to maximize performance.
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]


there is a GSOC project "Bits and Ints" that is working on a lot off this
kind of branch less algorithms. I can suggest him to include the integer
runtime variant of some math functions, as log2.

Anyway, on the meantime, for the run-time you can use the cmath header
working on floats and then convert to an integer if this is what you need.


View this message in context:
Sent from the Boost - Users mailing list archive at

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at