clarify the purpose of this project
[nyanglibc.git] / nptl / pthread_cond_signal.shared.s
blob77c06f7c071848a7e87bd37e70441de4a1feca14
1 .text
2 #APP
3 .symver __pthread_cond_signal,pthread_cond_signal@@GLIBC_2.3.2
4 .section .rodata.str1.8,"aMS",@progbits,1
5 .align 8
6 .LC0:
7 .string "The futex facility returned an unexpected error code.\n"
8 #NO_APP
9 .text
10 .p2align 4,,15
11 .globl __pthread_cond_signal
12 .type __pthread_cond_signal, @function
13 __pthread_cond_signal:
14 pushq %r15
15 pushq %r14
16 pushq %r13
17 pushq %r12
18 pushq %rbp
19 pushq %rbx
20 subq $40, %rsp
21 movl 36(%rdi), %ebp
22 movl %ebp, %eax
23 shrl $3, %eax
24 testl %eax, %eax
25 je .L49
26 movl $128, %eax
27 andl $1, %ebp
28 leaq 32(%rdi), %rbx
29 cmovne %eax, %ebp
30 movl 32(%rdi), %eax
31 movq %rdi, %r9
32 .L4:
33 testb $3, %al
34 jne .L77
35 movl %eax, %edx
36 orl $1, %edx
37 lock cmpxchgl %edx, (%rbx)
38 jne .L4
39 .L5:
40 movq (%r9), %rax
41 leaq 40(%r9), %r12
42 movq %rax, %rdx
43 notq %rdx
44 andl $1, %edx
45 leaq 4(%rdx), %rcx
46 movl %edx, %r8d
47 movl 8(%r9,%rcx,4), %ecx
48 testl %ecx, %ecx
49 jne .L16
50 movq %rax, %rsi
51 shrq %rax
52 andl $1, %esi
53 movq %rsi, (%rsp)
54 movl 32(%r9), %ecx
55 leaq (%r9,%rsi,4), %r15
56 movl %ecx, %edi
57 shrl $2, %edi
58 movl %edi, 12(%rsp)
59 movq 8(%r9), %rcx
60 addl 24(%r15), %eax
61 shrq %rcx
62 movq %rcx, 16(%rsp)
63 subl %edi, %eax
64 cmpl %eax, %ecx
65 jne .L78
66 .L17:
67 movl 32(%r9), %eax
68 .L30:
69 movl %eax, %ecx
70 movl %eax, %edx
71 andl $-4, %ecx
72 lock cmpxchgl %ecx, (%rbx)
73 jne .L30
74 andl $3, %edx
75 xorl %r12d, %r12d
76 cmpl $2, %edx
77 jne .L49
78 .L31:
79 movl %ebp, %esi
80 xorl %r10d, %r10d
81 movl $1, %edx
82 xorb $-127, %sil
83 movq %rbx, %rdi
84 movl $202, %eax
85 #APP
86 # 209 "../sysdeps/nptl/futex-internal.h" 1
87 syscall
89 # 0 "" 2
90 #NO_APP
91 cmpq $-4096, %rax
92 ja .L79
93 .L28:
94 testb %r12b, %r12b
95 jne .L80
96 .L49:
97 addq $40, %rsp
98 xorl %eax, %eax
99 popq %rbx
100 popq %rbp
101 popq %r12
102 popq %r13
103 popq %r14
104 popq %r15
106 .p2align 4,,10
107 .p2align 3
108 .L19:
109 cmpq $1, (%rsp)
110 movq 8(%r9), %rcx
111 movl 12(%rsp), %eax
112 sbbl %edx, %edx
113 andl $2, %edx
114 leal -1(%rdx,%rax,2), %eax
115 addq %rcx, %rax
116 movq %rax, 8(%r9)
117 movq 24(%rsp), %rax
118 movl $0, (%rax)
119 movq (%r9), %rax
120 .L24:
121 movq %rax, %rcx
122 movq %rax, %rdx
123 xorq $1, %rcx
124 lock cmpxchgq %rcx, (%r9)
125 jne .L24
126 movq %rdx, %rax
127 movl 12(%rsp), %edx
128 addl 16(%rsp), %edx
129 shrq %rax
130 subl %edx, %eax
131 movl 32(%r9), %edx
132 leal 0(,%rax,4), %ecx
133 andl $3, %edx
134 orl %ecx, %edx
135 movl %edx, %esi
136 xchgl (%rbx), %esi
137 xorl %esi, %edx
138 andl $3, %edx
139 je .L25
140 orl $2, %ecx
141 movl %ecx, 32(%r9)
142 .L25:
143 addl 24(%r15), %eax
144 movl (%rsp), %r8d
145 testl %eax, %eax
146 movl %eax, 24(%r15)
147 je .L17
148 .p2align 4,,10
149 .p2align 3
150 .L16:
151 movl %r8d, %eax
152 salq $2, %rax
153 leaq (%r12,%rax), %rdi
154 lock addl $2, (%rdi)
155 subl $1, 24(%r9,%rax)
156 movl 32(%r9), %eax
157 .L26:
158 movl %eax, %ecx
159 movl %eax, %edx
160 andl $-4, %ecx
161 lock cmpxchgl %ecx, (%rbx)
162 jne .L26
163 andl $3, %edx
164 cmpl $2, %edx
165 je .L81
166 .L27:
167 movl %ebp, %esi
168 xorl %r10d, %r10d
169 movl $1, %edx
170 xorb $-127, %sil
171 movl $202, %eax
172 #APP
173 # 209 "../sysdeps/nptl/futex-internal.h" 1
174 syscall
176 # 0 "" 2
177 #NO_APP
178 cmpq $-4096, %rax
179 jbe .L49
180 cmpl $-22, %eax
181 je .L49
182 cmpl $-14, %eax
183 je .L49
184 jmp .L13
185 .p2align 4,,10
186 .p2align 3
187 .L78:
188 leaq 40(%r9), %r12
189 salq $2, %rdx
190 leaq (%r12,%rdx), %rax
191 movq %rax, 24(%rsp)
192 lock orl $1, (%rax)
193 leaq 16(%r9,%rdx), %r8
194 movl (%r8), %eax
195 .L18:
196 movl %eax, %edx
197 lock cmpxchgl %eax, (%r8)
198 jne .L18
199 shrl %edx
200 je .L19
201 movl %ebp, %r14d
202 movl $202, %r13d
203 xorb $-128, %r14b
204 jmp .L22
205 .p2align 4,,10
206 .p2align 3
207 .L21:
208 movl (%r8), %eax
209 shrl %eax
210 je .L19
211 .L22:
212 movl (%r8), %eax
213 .L20:
214 movl %eax, %ecx
215 orl $1, %ecx
216 lock cmpxchgl %ecx, (%r8)
217 jne .L20
218 movl %ecx, %eax
219 movl %ecx, %edx
220 shrl %eax
221 je .L21
222 xorl %r10d, %r10d
223 movl %r14d, %esi
224 movq %r8, %rdi
225 movl %r13d, %eax
226 #APP
227 # 146 "../sysdeps/nptl/futex-internal.h" 1
228 syscall
230 # 0 "" 2
231 #NO_APP
232 cmpq $-4096, %rax
233 jbe .L21
234 leal 11(%rax), %ecx
235 cmpl $11, %ecx
236 ja .L13
237 movl $1, %eax
238 salq %cl, %rax
239 testl $2177, %eax
240 jne .L21
241 jmp .L13
242 .p2align 4,,10
243 .p2align 3
244 .L79:
245 cmpl $-22, %eax
246 je .L28
247 cmpl $-14, %eax
248 je .L28
249 jmp .L13
250 .p2align 4,,10
251 .p2align 3
252 .L81:
253 movl $1, %r12d
254 jmp .L31
255 .p2align 4,,10
256 .p2align 3
257 .L77:
258 movl %ebp, %r12d
259 movl $202, %r8d
260 movl $1, %r13d
261 xorb $-128, %r12b
262 .p2align 4,,10
263 .p2align 3
264 .L7:
265 movl %eax, %edx
266 movl %eax, %ecx
267 andl $-4, %edx
268 andl $3, %ecx
269 orl $2, %edx
270 cmpl $2, %ecx
271 je .L9
272 lock cmpxchgl %edx, (%rbx)
273 jne .L7
274 testb $3, %al
275 je .L5
276 andl $-4, %eax
277 orl $2, %eax
278 movl %eax, %edx
279 .L9:
280 xorl %r10d, %r10d
281 movl %r12d, %esi
282 movq %rbx, %rdi
283 movl %r8d, %eax
284 #APP
285 # 146 "../sysdeps/nptl/futex-internal.h" 1
286 syscall
288 # 0 "" 2
289 #NO_APP
290 cmpq $-4096, %rax
291 ja .L82
292 .L11:
293 movl (%rbx), %eax
294 jmp .L7
295 .p2align 4,,10
296 .p2align 3
297 .L82:
298 leal 11(%rax), %ecx
299 cmpl $11, %ecx
300 ja .L13
301 movq %r13, %rax
302 salq %cl, %rax
303 testl $2177, %eax
304 jne .L11
305 .L13:
306 leaq .LC0(%rip), %rdi
307 call __libc_fatal@PLT
308 .L80:
309 leaq 40(%r9,%r8,4), %rdi
310 jmp .L27
311 .size __pthread_cond_signal, .-__pthread_cond_signal