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]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>

Hi,

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.

Best,
Vicente

-- 
View this message in context: http://old.nabble.com/run-time-integer-log2-tp29149060p29150418.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net