clarify the purpose of this project
[nyanglibc.git] / nptl / pthread_mutex_unlock.s
blob09b73cdd08a05f5990904392ebf872f21ad7dc21
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@PLT
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 .type __pthread_mutex_unlock_usercnt, @function
465 __pthread_mutex_unlock_usercnt:
466 movl 16(%rdi), %eax
467 movl %eax, %edx
468 andl $383, %edx
469 andl $124, %eax
470 jne .L111
471 testl %edx, %edx
472 movl %eax, %r8d
473 jne .L91
474 .L99:
475 testl %esi, %esi
476 movl $0, 8(%rdi)
477 jne .L112
478 .L92:
479 movl 16(%rdi), %esi
480 xorl %eax, %eax
481 #APP
482 # 58 "pthread_mutex_unlock.c" 1
483 xchgl %eax, (%rdi)
484 # 0 "" 2
485 #NO_APP
486 cmpl $1, %eax
487 jg .L113
488 .L89:
489 movl %r8d, %eax
491 .p2align 4,,10
492 .p2align 3
493 .L112:
494 subl $1, 12(%rdi)
495 jmp .L92
496 .p2align 4,,10
497 .p2align 3
498 .L111:
499 jmp __pthread_mutex_unlock_full
500 .p2align 4,,10
501 .p2align 3
502 .L91:
503 cmpl $256, %edx
504 jne .L95
505 movl 16(%rdi), %esi
506 andl $128, %esi
507 jmp __lll_unlock_elision@PLT
508 .p2align 4,,10
509 .p2align 3
510 .L113:
511 andl $128, %esi
512 xorl %r10d, %r10d
513 movl $1, %edx
514 xorb $-127, %sil
515 movl $202, %eax
516 #APP
517 # 58 "pthread_mutex_unlock.c" 1
518 syscall
520 # 0 "" 2
521 #NO_APP
522 jmp .L89
523 .L95:
524 movl 16(%rdi), %eax
525 andl $127, %eax
526 cmpl $1, %eax
527 jne .L96
528 #APP
529 # 74 "pthread_mutex_unlock.c" 1
530 movl %fs:720,%eax
531 # 0 "" 2
532 #NO_APP
533 cmpl %eax, 8(%rdi)
534 je .L97
535 .L101:
536 movl $1, %r8d
537 jmp .L89
538 .L97:
539 subl $1, 4(%rdi)
540 je .L99
541 jmp .L89
542 .L96:
543 movl 16(%rdi), %eax
544 andl $127, %eax
545 cmpl $3, %eax
546 je .L99
547 cmpl $2, %edx
548 jne .L114
549 #APP
550 # 89 "pthread_mutex_unlock.c" 1
551 movl %fs:720,%eax
552 # 0 "" 2
553 #NO_APP
554 cmpl %eax, 8(%rdi)
555 jne .L101
556 cmpl $0, (%rdi)
557 je .L101
558 jmp .L99
559 .L114:
560 leaq __PRETTY_FUNCTION__.8779(%rip), %rcx
561 leaq .LC1(%rip), %rsi
562 leaq .LC2(%rip), %rdi
563 subq $8, %rsp
564 movl $88, %edx
565 call __assert_fail@PLT
566 .size __pthread_mutex_unlock_usercnt, .-__pthread_mutex_unlock_usercnt
567 .p2align 4,,15
568 .globl __pthread_mutex_unlock
569 .type __pthread_mutex_unlock, @function
570 __pthread_mutex_unlock:
571 movl $1, %esi
572 jmp __pthread_mutex_unlock_usercnt
573 .size __pthread_mutex_unlock, .-__pthread_mutex_unlock
574 .weak pthread_mutex_unlock
575 .set pthread_mutex_unlock,__pthread_mutex_unlock
576 .section .rodata.str1.16,"aMS",@progbits,1
577 .align 16
578 .type __PRETTY_FUNCTION__.8779, @object
579 .size __PRETTY_FUNCTION__.8779, 31
580 __PRETTY_FUNCTION__.8779:
581 .string "__pthread_mutex_unlock_usercnt"