Add fls() for non-constant values.

This commit is contained in:
Michael Brown
2007-09-16 17:36:40 +01:00
parent f09173326c
commit db124b1255
2 changed files with 11 additions and 5 deletions

10
src/core/bitops.c Normal file
View File

@@ -0,0 +1,10 @@
#include <strings.h>
int __flsl ( long x ) {
int r = 0;
for ( r = 0 ; x ; r++ ) {
x >>= 1;
}
return r;
}