diff options
author | Cristian RodrÃguez <crrodriguez@opensuse.org> | 2012-05-08 23:58:19 -0400 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2012-06-08 19:58:29 +1000 |
commit | 387b72731dbf79450050987b9b36bf70f286b098 (patch) | |
tree | 45eaca7bb2325b0419fc5904d3b7719fd8b5bf3c /src/libFLAC/bitmath.c | |
parent | 605f9208165e9da36753bc22d2b0ae75c90cc3dd (diff) | |
download | flac-387b72731dbf79450050987b9b36bf70f286b098.tar.gz |
bitmath: Finish up optimizations
This patch adds support for other compilers and systems
including MSVC, Intel C compiler etc..
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Diffstat (limited to 'src/libFLAC/bitmath.c')
-rw-r--r-- | src/libFLAC/bitmath.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/libFLAC/bitmath.c b/src/libFLAC/bitmath.c index 189977c6..4fdde4b9 100644 --- a/src/libFLAC/bitmath.c +++ b/src/libFLAC/bitmath.c @@ -36,54 +36,6 @@ #include "private/bitmath.h" #include "FLAC/assert.h" -/* An example of what FLAC__bitmath_ilog2() computes: - * - * ilog2( 0) = assertion failure - * ilog2( 1) = 0 - * ilog2( 2) = 1 - * ilog2( 3) = 1 - * ilog2( 4) = 2 - * ilog2( 5) = 2 - * ilog2( 6) = 2 - * ilog2( 7) = 2 - * ilog2( 8) = 3 - * ilog2( 9) = 3 - * ilog2(10) = 3 - * ilog2(11) = 3 - * ilog2(12) = 3 - * ilog2(13) = 3 - * ilog2(14) = 3 - * ilog2(15) = 3 - * ilog2(16) = 4 - * ilog2(17) = 4 - * ilog2(18) = 4 - */ - -#ifndef __GNUC__ - -/* For GNUC, use static inline version in include/private/bitmath.h. */ - -unsigned FLAC__bitmath_ilog2(FLAC__uint32 v) -{ - unsigned l = 0; - if (v == 0) - return 0; - while(v >>= 1) - l++; - return l; -} - -unsigned FLAC__bitmath_ilog2_wide(FLAC__uint64 v) -{ - unsigned l = 0; - if (v == 0) - return 0; - while(v >>= 1) - l++; - return l; -} -#endif - /* An example of what FLAC__bitmath_silog2() computes: * * silog2(-10) = 5 |