clarify the purpose of this project
[nyanglibc.git] / nptl / pthread_mutex_unlock.shared.s
blob2778166b954b9555bcae5b4eb4e0d228cafe888c
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 .type __pthread_mutex_unlock_full, @function
9 __pthread_mutex_unlock_full:
10 movl 16(%rdi), %eax
11 andl $127, %eax
12 subl $16, %eax
13 cmpl $51, %eax
14 ja .L43
15 leaq .L4(%rip), %rdx
16 movslq (%rdx,%rax,4), %rax
17 addq %rdx, %rax
18 jmp *%rax
19 .section .rodata
20 .align 4
21 .align 4
22 .L4:
23 .long .L3-.L4
24 .long .L5-.L4
25 .long .L3-.L4
26 .long .L3-.L4
27 .long .L43-.L4
28 .long .L43-.L4
29 .long .L43-.L4
30 .long .L43-.L4
31 .long .L43-.L4
32 .long .L43-.L4
33 .long .L43-.L4
34 .long .L43-.L4
35 .long .L43-.L4
36 .long .L43-.L4
37 .long .L43-.L4
38 .long .L43-.L4
39 .long .L6-.L4
40 .long .L7-.L4
41 .long .L6-.L4
42 .long .L6-.L4
43 .long .L43-.L4
44 .long .L43-.L4
45 .long .L43-.L4
46 .long .L43-.L4
47 .long .L43-.L4
48 .long .L43-.L4
49 .long .L43-.L4
50 .long .L43-.L4
51 .long .L43-.L4
52 .long .L43-.L4
53 .long .L43-.L4
54 .long .L43-.L4
55 .long .L6-.L4
56 .long .L8-.L4
57 .long .L6-.L4
58 .long .L6-.L4
59 .long .L43-.L4
60 .long .L43-.L4
61 .long .L43-.L4
62 .long .L43-.L4
63 .long .L43-.L4
64 .long .L43-.L4
65 .long .L43-.L4
66 .long .L43-.L4
67 .long .L43-.L4
68 .long .L43-.L4
69 .long .L43-.L4
70 .long .L43-.L4
71 .long .L9-.L4
72 .long .L10-.L4
73 .long .L11-.L4
74 .long .L9-.L4
75 .text
76 .p2align 4,,10
77 .p2align 3
78 .L10:
79 #APP
80 # 298 "pthread_mutex_unlock.c" 1
81 movl %fs:720,%edx
82 # 0 "" 2
83 #NO_APP
84 cmpl %edx, 8(%rdi)
85 movl $1, %eax
86 jne .L1
87 subl $1, 4(%rdi)
88 jne .L78
89 .p2align 4,,10
90 .p2align 3
91 .L9:
92 testl %esi, %esi
93 movl $0, 8(%rdi)
94 je .L39
95 subl $1, 12(%rdi)
96 .L39:
97 movl (%rdi), %eax
98 .L40:
99 movl %eax, %r8d
100 andl $-524288, %r8d
101 lock cmpxchgl %r8d, (%rdi)
102 jne .L40
103 andl $524287, %eax
104 cmpl $1, %eax
105 jbe .L42
106 movl 16(%rdi), %esi
107 xorl %r10d, %r10d
108 movl $1, %edx
109 movl $202, %eax
110 andl $128, %esi
111 xorb $-127, %sil
112 #APP
113 # 209 "../sysdeps/nptl/futex-internal.h" 1
114 syscall
116 # 0 "" 2
117 #NO_APP
118 cmpq $-4096, %rax
119 ja .L82
120 .L42:
121 movl %r8d, %edi
122 movl $-1, %esi
123 sarl $19, %edi
124 jmp __pthread_tpp_change_priority
125 .p2align 4,,10
126 .p2align 3
127 .L5:
128 #APP
129 # 108 "pthread_mutex_unlock.c" 1
130 movl %fs:720,%ecx
131 # 0 "" 2
132 #NO_APP
133 movl (%rdi), %eax
134 movl 8(%rdi), %edx
135 andl $1073741823, %eax
136 cmpl %ecx, %eax
137 je .L83
138 .L12:
139 #APP
140 # 119 "pthread_mutex_unlock.c" 1
141 movl %fs:720,%ecx
142 # 0 "" 2
143 #NO_APP
144 cmpl %edx, %ecx
145 movl $1, %eax
146 je .L84
147 .L1:
148 rep ret
149 .p2align 4,,10
150 .p2align 3
151 .L11:
152 #APP
153 # 308 "pthread_mutex_unlock.c" 1
154 movl %fs:720,%edx
155 # 0 "" 2
156 #NO_APP
157 cmpl %edx, 8(%rdi)
158 movl $1, %eax
159 jne .L1
160 testl $524287, (%rdi)
161 jne .L9
162 rep ret
163 .p2align 4,,10
164 .p2align 3
165 .L3:
166 movl (%rdi), %eax
167 #APP
168 # 132 "pthread_mutex_unlock.c" 1
169 movl %fs:720,%edx
170 # 0 "" 2
171 #NO_APP
172 movl %eax, %ecx
173 andl $1073741823, %ecx
174 cmpl %edx, %ecx
175 jne .L48
176 testl %eax, %eax
177 jne .L85
178 .L48:
179 movl $1, %eax
181 .p2align 4,,10
182 .p2align 3
183 .L7:
184 #APP
185 # 184 "pthread_mutex_unlock.c" 1
186 movl %fs:720,%edx
187 # 0 "" 2
188 #NO_APP
189 cmpl %edx, 8(%rdi)
190 movl $1, %eax
191 jne .L1
192 movl 4(%rdi), %eax
193 subl $1, %eax
194 testl %eax, %eax
195 movl %eax, 4(%rdi)
196 jne .L78
197 .L21:
198 testl %esi, %esi
199 movl %eax, 8(%rdi)
200 je .L27
201 subl $1, 12(%rdi)
202 .L27:
203 movl 16(%rdi), %eax
204 movl $128, %esi
205 testb $16, %al
206 je .L86
207 .L28:
208 movl (%rdi), %edx
209 testl %edx, %edx
210 js .L32
211 #APP
212 # 279 "pthread_mutex_unlock.c" 1
213 movl %fs:720,%eax
214 # 0 "" 2
215 #NO_APP
216 cmpl %edx, %eax
217 jne .L32
218 xorl %edx, %edx
219 lock cmpxchgl %edx, (%rdi)
220 jne .L33
221 .L79:
222 #APP
223 # 175 "pthread_mutex_unlock.c" 1
224 movq $0,%fs:752
225 # 0 "" 2
226 #NO_APP
227 .L78:
228 xorl %eax, %eax
230 .p2align 4,,10
231 .p2align 3
232 .L6:
233 movl (%rdi), %eax
234 #APP
235 # 222 "pthread_mutex_unlock.c" 1
236 movl %fs:720,%edx
237 # 0 "" 2
238 #NO_APP
239 movl %eax, %ecx
240 andl $1073741823, %ecx
241 cmpl %edx, %ecx
242 jne .L48
243 testl %eax, %eax
244 je .L48
245 movl 16(%rdi), %eax
246 andl $16, %eax
247 je .L26
248 xorl %eax, %eax
249 cmpl $2147483647, 8(%rdi)
250 je .L24
251 .L26:
252 movl 16(%rdi), %edx
253 andl $16, %edx
254 je .L21
255 jmp .L25
256 .p2align 4,,10
257 .p2align 3
258 .L8:
259 #APP
260 # 195 "pthread_mutex_unlock.c" 1
261 movl %fs:720,%ecx
262 # 0 "" 2
263 #NO_APP
264 movl (%rdi), %eax
265 movl 8(%rdi), %edx
266 andl $1073741823, %eax
267 cmpl %ecx, %eax
268 je .L87
269 .L22:
270 #APP
271 # 206 "pthread_mutex_unlock.c" 1
272 movl %fs:720,%ecx
273 # 0 "" 2
274 #NO_APP
275 cmpl %edx, %ecx
276 movl $1, %eax
277 jne .L1
278 movl 4(%rdi), %eax
279 subl $1, %eax
280 testl %eax, %eax
281 movl %eax, 4(%rdi)
282 jne .L78
283 .L25:
284 leaq 32(%rdi), %rdx
285 orq $1, %rdx
286 #APP
287 # 246 "pthread_mutex_unlock.c" 1
288 movq %rdx,%fs:752
289 # 0 "" 2
290 #NO_APP
291 movq 32(%rdi), %rcx
292 movq 24(%rdi), %r8
293 movq %rcx, %rdx
294 andq $-2, %rdx
295 movq %r8, -8(%rdx)
296 movq 24(%rdi), %rdx
297 andq $-2, %rdx
298 movq %rcx, (%rdx)
299 movq $0, 24(%rdi)
300 movq $0, 32(%rdi)
301 jmp .L21
302 .p2align 4,,10
303 .p2align 3
304 .L43:
305 movl $22, %eax
307 .p2align 4,,10
308 .p2align 3
309 .L84:
310 subl $1, 4(%rdi)
311 jne .L78
312 .L16:
313 xorl %r8d, %r8d
314 .L15:
315 leaq 32(%rdi), %rax
316 #APP
317 # 146 "pthread_mutex_unlock.c" 1
318 movq %rax,%fs:752
319 # 0 "" 2
320 #NO_APP
321 movq 32(%rdi), %rdx
322 movq 24(%rdi), %rcx
323 movq %rdx, %rax
324 andq $-2, %rax
325 movq %rcx, -8(%rax)
326 movq 24(%rdi), %rax
327 andq $-2, %rax
328 movq %rdx, (%rax)
329 testl %esi, %esi
330 movq $0, 24(%rdi)
331 movq $0, 32(%rdi)
332 movl %r8d, 8(%rdi)
333 je .L17
334 subl $1, 12(%rdi)
335 .L17:
336 xorl %eax, %eax
337 #APP
338 # 163 "pthread_mutex_unlock.c" 1
339 xchgl %eax, (%rdi)
340 # 0 "" 2
341 #NO_APP
342 testl %eax, %eax
343 js .L88
344 .L20:
345 jmp .L79
346 .p2align 4,,10
347 .p2align 3
348 .L85:
349 cmpl $2147483647, 8(%rdi)
350 jne .L16
351 .L13:
352 movl $2147483646, %r8d
353 jmp .L15
354 .L88:
355 xorl %r10d, %r10d
356 movl $1, %edx
357 movl $1, %esi
358 movl $202, %eax
359 #APP
360 # 209 "../sysdeps/nptl/futex-internal.h" 1
361 syscall
363 # 0 "" 2
364 #NO_APP
365 cmpq $-4096, %rax
366 jbe .L20
367 cmpl $-22, %eax
368 je .L20
369 cmpl $-14, %eax
370 je .L20
371 .L19:
372 leaq .LC0(%rip), %rdi
373 subq $8, %rsp
374 call __libc_fatal@PLT
375 .p2align 4,,10
376 .p2align 3
377 .L83:
378 cmpl $2147483647, %edx
379 jne .L12
380 subl $1, 4(%rdi)
381 je .L13
382 .L23:
383 movl $131, %eax
385 .p2align 4,,10
386 .p2align 3
387 .L87:
388 cmpl $2147483647, %edx
389 jne .L22
390 subl $1, 4(%rdi)
391 jne .L23
392 .L24:
393 movl $2147483646, %eax
394 jmp .L26
395 .p2align 4,,10
396 .p2align 3
397 .L82:
398 cmpl $-22, %eax
399 je .L42
400 cmpl $-14, %eax
401 je .L42
402 jmp .L19
403 .p2align 4,,10
404 .p2align 3
405 .L86:
406 movl 16(%rdi), %esi
407 andl $128, %esi
408 jmp .L28
409 .L32:
410 xorb $-121, %sil
411 xorl %r10d, %r10d
412 xorl %edx, %edx
413 movl $202, %eax
414 #APP
415 # 307 "../sysdeps/nptl/futex-internal.h" 1
416 syscall
418 # 0 "" 2
419 #NO_APP
420 cmpq $-4096, %rax
421 jbe .L79
422 cmpl $-11, %eax
423 je .L79
424 jg .L36
425 cmpl $-38, %eax
426 je .L79
427 cmpl $-35, %eax
428 je .L79
429 cmpl $-110, %eax
430 jne .L19
431 jmp .L79
432 .L36:
433 cmpl $-4, %eax
434 jl .L19
435 cmpl $-3, %eax
436 jle .L79
437 addl $1, %eax
438 je .L79
439 jmp .L19
440 .L33:
441 testl %eax, %eax
442 js .L32
443 #APP
444 # 279 "pthread_mutex_unlock.c" 1
445 movl %fs:720,%ecx
446 # 0 "" 2
447 #NO_APP
448 cmpl %ecx, %eax
449 jne .L32
450 lock cmpxchgl %edx, (%rdi)
451 je .L79
452 jmp .L33
453 .size __pthread_mutex_unlock_full, .-__pthread_mutex_unlock_full
454 .section .rodata.str1.1,"aMS",@progbits,1
455 .LC1:
456 .string "pthread_mutex_unlock.c"
457 .section .rodata.str1.8
458 .align 8
459 .LC2:
460 .string "type == PTHREAD_MUTEX_ERRORCHECK_NP"
461 .text
462 .p2align 4,,15
463 .globl __pthread_mutex_unlock_usercnt
464 .hidden __pthread_mutex_unlock_usercnt
465 .type __pthread_mutex_unlock_usercnt, @function
466 __pthread_mutex_unlock_usercnt:
467 movl 16(%rdi), %eax
468 movl %eax, %edx
469 andl $383, %edx
470 andl $124, %eax
471 jne .L111
472 testl %edx, %edx
473 movl %eax, %r8d
474 jne .L91
475 .L99:
476 testl %esi, %esi
477 movl $0, 8(%rdi)
478 jne .L112
479 .L92:
480 movl 16(%rdi), %esi
481 xorl %eax, %eax
482 #APP
483 # 58 "pthread_mutex_unlock.c" 1
484 xchgl %eax, (%rdi)
485 # 0 "" 2
486 #NO_APP
487 cmpl $1, %eax
488 jg .L113
489 .L89:
490 movl %r8d, %eax
492 .p2align 4,,10
493 .p2align 3
494 .L112:
495 subl $1, 12(%rdi)
496 jmp .L92
497 .p2align 4,,10
498 .p2align 3
499 .L111:
500 jmp __pthread_mutex_unlock_full
501 .p2align 4,,10
502 .p2align 3
503 .L91:
504 cmpl $256, %edx
505 jne .L95
506 movl 16(%rdi), %esi
507 andl $128, %esi
508 jmp __lll_unlock_elision
509 .p2align 4,,10
510 .p2align 3
511 .L113:
512 andl $128, %esi
513 xorl %r10d, %r10d
514 movl $1, %edx
515 xorb $-127, %sil
516 movl $202, %eax
517 #APP
518 # 58 "pthread_mutex_unlock.c" 1
519 syscall
521 # 0 "" 2
522 #NO_APP
523 jmp .L89
524 .L95:
525 movl 16(%rdi), %eax
526 andl $127, %eax
527 cmpl $1, %eax
528 jne .L96
529 #APP
530 # 74 "pthread_mutex_unlock.c" 1
531 movl %fs:720,%eax
532 # 0 "" 2
533 #NO_APP
534 cmpl %eax, 8(%rdi)
535 je .L97
536 .L101:
537 movl $1, %r8d
538 jmp .L89
539 .L97:
540 subl $1, 4(%rdi)
541 je .L99
542 jmp .L89
543 .L96:
544 movl 16(%rdi), %eax
545 andl $127, %eax
546 cmpl $3, %eax
547 je .L99
548 cmpl $2, %edx
549 jne .L114
550 #APP
551 # 89 "pthread_mutex_unlock.c" 1
552 movl %fs:720,%eax
553 # 0 "" 2
554 #NO_APP
555 cmpl %eax, 8(%rdi)
556 jne .L101
557 cmpl $0, (%rdi)
558 je .L101
559 jmp .L99
560 .L114:
561 leaq __PRETTY_FUNCTION__.8807(%rip), %rcx
562 leaq .LC1(%rip), %rsi
563 leaq .LC2(%rip), %rdi
564 subq $8, %rsp
565 movl $88, %edx
566 call __assert_fail@PLT
567 .size __pthread_mutex_unlock_usercnt, .-__pthread_mutex_unlock_usercnt
568 .p2align 4,,15
569 .globl __GI___pthread_mutex_unlock
570 .hidden __GI___pthread_mutex_unlock
571 .type __GI___pthread_mutex_unlock, @function
572 __GI___pthread_mutex_unlock:
573 movl $1, %esi
574 jmp __pthread_mutex_unlock_usercnt
575 .size __GI___pthread_mutex_unlock, .-__GI___pthread_mutex_unlock
576 .weak pthread_mutex_unlock
577 .set pthread_mutex_unlock,__GI___pthread_mutex_unlock
578 .globl __pthread_mutex_unlock
579 .set __pthread_mutex_unlock,__GI___pthread_mutex_unlock
580 .section .rodata.str1.16,"aMS",@progbits,1
581 .align 16
582 .type __PRETTY_FUNCTION__.8807, @object
583 .size __PRETTY_FUNCTION__.8807, 31
584 __PRETTY_FUNCTION__.8807:
585 .string "__pthread_mutex_unlock_usercnt"
586 .hidden __lll_unlock_elision
587 .hidden __pthread_tpp_change_priority