clarify the purpose of this project
[nyanglibc.git] / misc / makedev.s
blob68977dc736341d2df6547c9aa2f72bc2a7535d06
1 .text
2 .p2align 4,,15
3 .globl __gnu_dev_major
4 .hidden __gnu_dev_major
5 .type __gnu_dev_major, @function
6 __gnu_dev_major:
7 movq %rdi, %rax
8 shrq $8, %rax
9 movl %eax, %edx
10 movq %rdi, %rax
11 shrq $32, %rax
12 andl $4095, %edx
13 andl $-4096, %eax
14 orl %edx, %eax
15 ret
16 .size __gnu_dev_major, .-__gnu_dev_major
17 .weak gnu_dev_major
18 .hidden gnu_dev_major
19 .set gnu_dev_major,__gnu_dev_major
20 .p2align 4,,15
21 .globl __gnu_dev_minor
22 .hidden __gnu_dev_minor
23 .type __gnu_dev_minor, @function
24 __gnu_dev_minor:
25 movq %rdi, %rax
26 movzbl %dil, %edx
27 shrq $12, %rax
28 xorb %al, %al
29 orl %edx, %eax
30 ret
31 .size __gnu_dev_minor, .-__gnu_dev_minor
32 .weak gnu_dev_minor
33 .hidden gnu_dev_minor
34 .set gnu_dev_minor,__gnu_dev_minor
35 .p2align 4,,15
36 .globl __gnu_dev_makedev
37 .hidden __gnu_dev_makedev
38 .type __gnu_dev_makedev, @function
39 __gnu_dev_makedev:
40 movq %rsi, %rax
41 movabsq $17592184995840, %rdx
42 movl %edi, %edi
43 salq $12, %rax
44 movzbl %sil, %esi
45 andq %rdx, %rax
46 orq %rsi, %rax
47 movq %rdi, %rsi
48 salq $8, %rsi
49 andl $1048320, %esi
50 orq %rax, %rsi
51 movq %rdi, %rax
52 movabsq $-17592186044416, %rdi
53 salq $32, %rax
54 andq %rdi, %rax
55 orq %rsi, %rax
56 ret
57 .size __gnu_dev_makedev, .-__gnu_dev_makedev
58 .weak gnu_dev_makedev
59 .hidden gnu_dev_makedev
60 .set gnu_dev_makedev,__gnu_dev_makedev