clarify the purpose of this project
[nyanglibc.git] / nptl / pthread_rwlock_unlock.s
blobeb0aeee2b01a3c8203c4fef0911ab40135d5651d
1 .text
2 .section .rodata.str1.8,"aMS",@progbits,1
3 .align 8
4 .LC0:
5 .string "The futex facility returned an unexpected error code.\n"
6 .text
7 .p2align 4,,15
8 .globl __pthread_rwlock_unlock
9 .type __pthread_rwlock_unlock, @function
10 __pthread_rwlock_unlock:
11 pushq %rbp
12 pushq %rbx
13 movq %rdi, %r8
14 subq $8, %rsp
15 movl 24(%rdi), %edx
16 #APP
17 # 40 "pthread_rwlock_unlock.c" 1
18 movl %fs:720,%eax
19 # 0 "" 2
20 #NO_APP
21 cmpl %eax, %edx
22 je .L58
23 movl 28(%rdi), %ebx
24 movl $128, %eax
25 testl %ebx, %ebx
26 cmovne %eax, %ebx
27 movl (%rdi), %eax
28 .L18:
29 leal -8(%rax), %r9d
30 movl %r9d, %edx
31 shrl $3, %edx
32 testl %edx, %edx
33 je .L59
34 .L16:
35 lock cmpxchgl %r9d, (%r8)
36 movl %eax, %ebp
37 jne .L18
38 testb $1, %r9b
39 jne .L60
40 .L20:
41 xorl %ebp, %r9d
42 andl $4, %r9d
43 je .L14
44 movl %ebx, %esi
45 xorl %r10d, %r10d
46 movl $2147483647, %edx
47 xorb $-127, %sil
48 movq %r8, %rdi
49 movl $202, %eax
50 #APP
51 # 209 "../sysdeps/nptl/futex-internal.h" 1
52 syscall
54 # 0 "" 2
55 #NO_APP
56 cmpq $-4096, %rax
57 ja .L55
58 .L14:
59 addq $8, %rsp
60 xorl %eax, %eax
61 popq %rbx
62 popq %rbp
63 ret
64 .p2align 4,,10
65 .p2align 3
66 .L59:
67 movl %r9d, %edx
68 orl $1, %edx
69 testb $2, %r9b
70 cmovne %edx, %r9d
71 andl $-5, %r9d
72 jmp .L16
73 .p2align 4,,10
74 .p2align 3
75 .L60:
76 leaq 8(%r8), %rdi
77 movl $1, %eax
78 xchgl (%rdi), %eax
79 testb $2, %al
80 je .L20
81 movl %ebx, %esi
82 xorl %r10d, %r10d
83 movl $2147483647, %edx
84 xorb $-127, %sil
85 movl $202, %eax
86 #APP
87 # 209 "../sysdeps/nptl/futex-internal.h" 1
88 syscall
90 # 0 "" 2
91 #NO_APP
92 cmpq $-4096, %rax
93 jbe .L20
94 cmpl $-22, %eax
95 je .L20
96 cmpl $-14, %eax
97 je .L20
98 jmp .L10
99 .p2align 4,,10
100 .p2align 3
101 .L58:
102 movl 28(%rdi), %ebp
103 movl $128, %eax
104 leaq 12(%rdi), %rbx
105 movl $0, 24(%rdi)
106 testl %ebp, %ebp
107 cmovne %eax, %ebp
108 xorl %r9d, %r9d
109 xchgl (%rbx), %r9d
110 movl 48(%rdi), %eax
111 andl $2, %r9d
112 testl %eax, %eax
113 jne .L4
114 .L6:
115 movl (%r8), %eax
116 .L5:
117 movl %eax, %edx
118 movl %eax, %ecx
119 shrl $3, %edx
120 testl %edx, %edx
121 setne %dl
122 xorl $2, %ecx
123 movzbl %dl, %edx
124 xorl %ecx, %edx
125 lock cmpxchgl %edx, (%r8)
126 jne .L5
127 shrl $3, %eax
128 testl %eax, %eax
129 jne .L61
130 .L11:
131 testl %r9d, %r9d
132 je .L14
133 movl %ebp, %esi
134 xorl %r10d, %r10d
135 movl $1, %edx
136 xorb $-127, %sil
137 movq %rbx, %rdi
138 movl $202, %eax
139 #APP
140 # 209 "../sysdeps/nptl/futex-internal.h" 1
141 syscall
143 # 0 "" 2
144 #NO_APP
145 cmpq $-4096, %rax
146 jbe .L14
147 .L55:
148 cmpl $-22, %eax
149 je .L14
150 cmpl $-14, %eax
151 jne .L10
152 addq $8, %rsp
153 xorl %eax, %eax
154 popq %rbx
155 popq %rbp
157 .p2align 4,,10
158 .p2align 3
159 .L4:
160 movl 4(%rdi), %eax
161 leaq 4(%rdi), %rdx
162 .L56:
163 testl %eax, %eax
164 je .L6
165 movl %eax, %ecx
166 orl $-2147483648, %ecx
167 lock cmpxchgl %ecx, (%rdx)
168 je .L11
169 jmp .L56
170 .p2align 4,,10
171 .p2align 3
172 .L61:
173 leaq 8(%r8), %rdi
174 xorl %eax, %eax
175 xchgl (%rdi), %eax
176 testb $2, %al
177 je .L11
178 movl %ebp, %esi
179 xorl %r10d, %r10d
180 movl $2147483647, %edx
181 xorb $-127, %sil
182 movl $202, %eax
183 #APP
184 # 209 "../sysdeps/nptl/futex-internal.h" 1
185 syscall
187 # 0 "" 2
188 #NO_APP
189 cmpq $-4096, %rax
190 jbe .L11
191 cmpl $-22, %eax
192 je .L11
193 cmpl $-14, %eax
194 je .L11
195 .L10:
196 leaq .LC0(%rip), %rdi
197 call __libc_fatal@PLT
198 .size __pthread_rwlock_unlock, .-__pthread_rwlock_unlock
199 .weak pthread_rwlock_unlock
200 .set pthread_rwlock_unlock,__pthread_rwlock_unlock