projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
setjmp: optimize x86 longjmp epilogues
[musl]
/
arch
/
x86_64
/
atomic_arch.h
diff --git
a/arch/x86_64/atomic_arch.h
b/arch/x86_64/atomic_arch.h
index
9f47f80
..
da4e203
100644
(file)
--- a/
arch/x86_64/atomic_arch.h
+++ b/
arch/x86_64/atomic_arch.h
@@
-96,7
+96,7
@@
static inline void a_barrier()
__asm__ __volatile__( "" : : : "memory" );
}
__asm__ __volatile__( "" : : : "memory" );
}
-#define a_
pause a_pause
+#define a_
spin a_spin
static inline void a_spin()
{
__asm__ __volatile__( "pause" : : : "memory" );
static inline void a_spin()
{
__asm__ __volatile__( "pause" : : : "memory" );
@@
-114,3
+114,10
@@
static inline int a_ctz_64(uint64_t x)
__asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
return 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;
+}