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