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
|
||||
lock cmpxchg [rdi], edx
|
||||
|
||||
jnz .Lnz
|
||||
xor eax, eax
|
||||
ret
|
||||
.Lnz:
|
||||
mov eax, 1
|
||||
setnz al
|
||||
movzx eax, al
|
||||
ret
|
||||
|
||||
.global atomic_xadd
|
||||
|
|
|
|||
Loading…
Reference in a new issue