clarify the purpose of this project
[nyanglibc.git] / nptl / elision-trylock.s
blob7805adb2c32ea19b52364d6b4ea47dab68e041ff
1 .text
2 .p2align 4,,15
3 .globl __lll_trylock_elision
4 .type __lll_trylock_elision, @function
5 __lll_trylock_elision:
6 xabort $253
7 movzwl (%rsi), %eax
8 testw %ax, %ax
9 jg .L2
10 movl $-1, %eax
11 xbegin .L3
12 .L3:
13 cmpl $-1, %eax
14 je .L13
15 testb $2, %al
16 je .L14
17 .L6:
18 xorl %eax, %eax
19 movl $1, %edx
20 lock cmpxchgl %edx, (%rdi)
21 setne %al
22 movzbl %al, %eax
23 .L1:
24 rep ret
25 .p2align 4,,10
26 .p2align 3
27 .L2:
28 movzwl (%rsi), %eax
29 subl $1, %eax
30 movw %ax, (%rsi)
31 jmp .L6
32 .p2align 4,,10
33 .p2align 3
34 .L13:
35 movl (%rdi), %eax
36 testl %eax, %eax
37 je .L1
38 xabort $255
39 jmp .L6
40 .p2align 4,,10
41 .p2align 3
42 .L14:
43 movswl (%rsi), %eax
44 movl 4+__elision_aconf(%rip), %edx
45 cmpl %edx, %eax
46 je .L6
47 movw %dx, (%rsi)
48 jmp .L6
49 .size __lll_trylock_elision, .-__lll_trylock_elision