mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 20:10:18 +03:00
[libc] Add inline assembly implementation of flsl() using BSR instruction
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
#include <strings.h>
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
int __flsl ( long x ) {
|
||||
unsigned long value = x;
|
||||
int ls = 0;
|
||||
|
||||
for ( ls = 0 ; value ; ls++ ) {
|
||||
value >>= 1;
|
||||
}
|
||||
return ls;
|
||||
}
|
||||
Reference in New Issue
Block a user