clarify the purpose of this project
[nyanglibc.git] / posix / sched_cpucount.s
blob168e0021b40a2ab86804a319f04449cee8a7a87e
1 .text
2 .globl __popcountdi2
3 .p2align 4,,15
4 .globl __sched_cpucount
5 .type __sched_cpucount, @function
6 __sched_cpucount:
7 andq $-8, %rdi
8 pushq %r12
9 pushq %rbp
10 leaq (%rsi,%rdi), %rbp
11 pushq %rbx
12 cmpq %rbp, %rsi
13 jnb .L5
14 movq %rsi, %rbx
15 xorl %r12d, %r12d
16 .p2align 4,,10
17 .p2align 3
18 .L4:
19 addq $8, %rbx
20 movq -8(%rbx), %rdi
21 testq %rdi, %rdi
22 je .L3
23 call __popcountdi2@PLT
24 addl %eax, %r12d
25 .L3:
26 cmpq %rbx, %rbp
27 ja .L4
28 movl %r12d, %eax
29 popq %rbx
30 popq %rbp
31 popq %r12
32 ret
33 .p2align 4,,10
34 .p2align 3
35 .L5:
36 xorl %r12d, %r12d
37 movl %r12d, %eax
38 popq %rbx
39 popq %rbp
40 popq %r12
41 ret
42 .size __sched_cpucount, .-__sched_cpucount