OSDN Git Service
(root)
/
android-x86
/
external-musl-libc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
add a_clz_64 helper function
[android-x86/external-musl-libc.git]
/
arch
/
x32
/
atomic_arch.h
diff --git
a/arch/x32/atomic_arch.h
b/arch/x32/atomic_arch.h
index
7daf4ae
..
a744c29
100644
(file)
--- a/
arch/x32/atomic_arch.h
+++ b/
arch/x32/atomic_arch.h
@@
-112,3
+112,10
@@
static inline int a_ctz_l(unsigned long x)
__asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
return x;
}
+
+#define a_clz_64 a_clz_64
+static inline int a_clz_64(uint64_t x)
+{
+ __asm__( "bsr %1,%0 ; xor $63,%0" : "=r"(x) : "r"(x) );
+ return x;
+}