Subject: [Boost-bugs] [Boost C++ Libraries] #5158: [pending] speed up lowest_bit() for gcc 4.x compatibles
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-02-04 00:36:32
#5158: [pending] speed up lowest_bit() for gcc 4.x compatibles
-------------------------------------+--------------------------------------
Reporter: astukalov@⦠| Owner: dlwalker
Type: Patches | Status: new
Milestone: To Be Determined | Component: integer
Version: Boost Development Trunk | Severity: Optimization
Keywords: |
-------------------------------------+--------------------------------------
The patch provides specialization of lowest_bit() template that utilizes
__builtin_ctz[l][l]() function, available for gcc 4.x-compatible
compilers, instead of calculation-intensive path that makes use of
integer_log2().
Since lowest_bit() is used in dynamic_bitset::find_first()/find_next(),
the patch leads to significant speed up for bitset traversal.
The patch was tested on gcc 4.5.2 x86_64 and icc 11.1 x86_64.
Currently, the patch provides no checks, if __builting_ctz is available
for current toolset. I can try to add this, given the overall positive
feedback.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5158> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC