mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-04 19:19:33 +00:00
BUG/MEDIUM: tools: fix direction of my_ffsl()
Commit 27346b01a
("OPTIM: tools: optimize my_ffsl() for x86_64") optimized
my_ffsl() for intensive use cases in the scheduler, but as half of the times
I got it wrong so it counted bits the reverse way. It doesn't matter for the
scheduler nor fd cache but it broke cpu-map with threads which heavily relies
on proper ordering.
We should probably consider dropping support for gcc < 3.4 and switching
to builtins for these ones, though often they are as ambiguous.
No backport is needed.
This commit is contained in:
parent
bddf292cbd
commit
ce487aab46
@ -815,7 +815,7 @@ static inline unsigned int my_ffsl(unsigned long a)
|
||||
unsigned long cnt;
|
||||
|
||||
#if defined(__x86_64__)
|
||||
__asm__("bsr %1,%0\n" : "=r" (cnt) : "rm" (a));
|
||||
__asm__("bsf %1,%0\n" : "=r" (cnt) : "rm" (a));
|
||||
cnt++;
|
||||
#else
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user