atomic: make atomic_cmpxchg branchless
Co-authored-by: wuangg <3d7777456@gmail.com> Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
2a309d9671
commit
72cb81c45a
1 changed files with 2 additions and 5 deletions
|
|
@ -4,11 +4,8 @@ atomic_cmpxchg:
|
||||||
mov eax, esi
|
mov eax, esi
|
||||||
lock cmpxchg [rdi], edx
|
lock cmpxchg [rdi], edx
|
||||||
|
|
||||||
jnz .Lnz
|
setnz al
|
||||||
xor eax, eax
|
movzx eax, al
|
||||||
ret
|
|
||||||
.Lnz:
|
|
||||||
mov eax, 1
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.global atomic_xadd
|
.global atomic_xadd
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue