diff options
| author | Michael Brown | 2014-04-24 15:49:08 +0200 |
|---|---|---|
| committer | Michael Brown | 2014-04-24 15:49:08 +0200 |
| commit | dce7107fc087092dc95b420504b26261933d5f73 (patch) | |
| tree | 19f2d2d874fcaede9cfe98a52d362cd1b21e2822 /src/include | |
| parent | [test] Add self-tests for flsl() (diff) | |
| download | ipxe-dce7107fc087092dc95b420504b26261933d5f73.tar.gz ipxe-dce7107fc087092dc95b420504b26261933d5f73.tar.xz ipxe-dce7107fc087092dc95b420504b26261933d5f73.zip | |
[libc] Add inline assembly implementation of flsl() using BSR instruction
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/strings.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/strings.h b/src/include/strings.h index c7063d682..924a084fc 100644 --- a/src/include/strings.h +++ b/src/include/strings.h @@ -5,6 +5,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <limits.h> #include <string.h> +#include <bits/strings.h> static inline __attribute__ (( always_inline )) int __constant_flsl ( unsigned long x ) { @@ -42,8 +43,7 @@ __constant_flsl ( unsigned long x ) { return r; } -/* We don't actually have these functions yet */ -extern int __flsl ( long x ); +int __flsl ( long x ); #define flsl( x ) \ ( __builtin_constant_p ( x ) ? __constant_flsl ( x ) : __flsl ( x ) ) |
