search for: debruijn_idx64

Displaying 3 results from an estimated 3 matches for "debruijn_idx64".

Did you mean: debruijn_idx32
2013 Sep 04
4
PATCH: bugfixes for bitmath.h
...compilers are so smart that can optimize this expression. So it is better to change FLAC__bitmath_ilog2() so it simply calls BitScanReverse() when possible. 3. FLAC__bitmath_ilog2_wide() cannot be compiled with MSVC: it has 'if (v == 0)...' statement followed by a variable (either idx or DEBRUIJN_IDX64) definition. But all calls of this function have FLAC__ASSERT statements that ensure that its argument is greater than 0. So this 'if()' can be removed. 4. Am I right that FLAC__bitmath_ilog2_wide() and FLAC__bitmath_ilog2() return the same value if their argument is less than 2^32? Then...
2012 May 09
1
[PATCH 2/2] bitmath: Finish up optimizations
...ilog2_wide(FLAC__uint64 v); - +/* Brain-damaged compilers will use the fastest possible way that is, + de Bruijn sequences (http://supertech.csail.mit.edu/papers/debruijn.pdf) + (C) Timothy B. Terriberry (tterribe at xiph.org) 2001-2009 LGPL (v2 or later). +*/ + static const unsigned char DEBRUIJN_IDX64[64]={ + 0, 1, 2, 7, 3,13, 8,19, 4,25,14,28, 9,34,20,40, + 5,17,26,38,15,46,29,48,10,31,35,54,21,50,41,57, + 63, 6,12,18,24,27,33,39,16,37,45,47,30,53,49,56, + 62,11,23,32,36,44,52,55,61,22,43,51,60,42,59,58 + }; + int ret; + ret= v>0; + v|= v>>1; +...
2013 Sep 08
0
PATCH: bugfixes for bitmath.h
...() so it simply calls BitScanReverse() when possible. I want to look at this more carefully. Its probably worth writing a unit test for it. > 3. FLAC__bitmath_ilog2_wide() cannot be compiled with MSVC: it has > 'if (v == 0)...' statement followed by a variable (either idx or > DEBRUIJN_IDX64) definition. But all calls of this function have > FLAC__ASSERT statements that ensure that its argument is greater > than 0. So this 'if()' can be removed. I'd actuall prefer to remove those ASSERTS, because they get bypassed for the production compiles anyway. > 4. Am I ri...