clarify the purpose of this project
[nyanglibc.git] / stdlib / inlines.s
blob8483b453ca8f3c7af102fc81330849aba042ca56
1 .text
2 .p2align 4,,15
3 .globl __mpn_add_1
4 .hidden __mpn_add_1
5 .type __mpn_add_1, @function
6 __mpn_add_1:
7 xorl %eax, %eax
8 addq (%rsi), %rcx
9 leaq 8(%rsi), %r8
10 leaq 8(%rdi), %rsi
11 setc %al
12 movq %rcx, (%rdi)
13 testq %rax, %rax
14 jne .L4
15 .L5:
16 cmpq %r8, %rsi
17 je .L9
18 cmpq $1, %rdx
19 jle .L9
20 subq $1, %rdx
21 xorl %eax, %eax
22 .p2align 4,,10
23 .p2align 3
24 .L10:
25 movq (%r8,%rax,8), %rcx
26 movq %rcx, (%rsi,%rax,8)
27 addq $1, %rax
28 cmpq %rax, %rdx
29 jne .L10
30 .L9:
31 xorl %eax, %eax
32 ret
33 .p2align 4,,10
34 .p2align 3
35 .L6:
36 addq $8, %r8
37 movq -8(%r8), %rax
38 addq $8, %rsi
39 addq $1, %rax
40 testq %rax, %rax
41 movq %rax, -8(%rsi)
42 jne .L5
43 .L4:
44 subq $1, %rdx
45 jne .L6
46 movl $1, %eax
47 ret
48 .size __mpn_add_1, .-__mpn_add_1
49 .p2align 4,,15
50 .globl __mpn_add
51 .type __mpn_add, @function
52 __mpn_add:
53 pushq %r12
54 pushq %rbp
55 xorl %eax, %eax
56 pushq %rbx
57 movq %rdi, %rbp
58 movq %rsi, %r12
59 movq %rdx, %rbx
60 subq $16, %rsp
61 testq %r8, %r8
62 jne .L21
63 .L15:
64 cmpq %rbx, %r8
65 je .L14
66 leaq 0(,%r8,8), %rdi
67 addq $16, %rsp
68 subq %r8, %rbx
69 movq %rbx, %rdx
70 movq %rax, %rcx
71 leaq (%r12,%rdi), %rsi
72 addq %rbp, %rdi
73 popq %rbx
74 popq %rbp
75 popq %r12
76 jmp __mpn_add_1
77 .p2align 4,,10
78 .p2align 3
79 .L14:
80 addq $16, %rsp
81 popq %rbx
82 popq %rbp
83 popq %r12
84 ret
85 .p2align 4,,10
86 .p2align 3
87 .L21:
88 movq %rcx, %rdx
89 movq %r8, %rcx
90 movq %r8, 8(%rsp)
91 call __mpn_add_n
92 movq 8(%rsp), %r8
93 jmp .L15
94 .size __mpn_add, .-__mpn_add
95 .p2align 4,,15
96 .globl __mpn_sub_1
97 .hidden __mpn_sub_1
98 .type __mpn_sub_1, @function
99 __mpn_sub_1:
100 movq (%rsi), %rax
101 leaq 8(%rsi), %r8
102 movq %rax, %rsi
103 xorl %eax, %eax
104 subq %rcx, %rsi
105 leaq 8(%rdi), %rcx
106 setb %al
107 movq %rsi, (%rdi)
108 testq %rax, %rax
109 jne .L25
110 .L26:
111 cmpq %r8, %rcx
112 je .L30
113 cmpq $1, %rdx
114 jle .L30
115 subq $1, %rdx
116 xorl %eax, %eax
117 .p2align 4,,10
118 .p2align 3
119 .L31:
120 movq (%r8,%rax,8), %rsi
121 movq %rsi, (%rcx,%rax,8)
122 addq $1, %rax
123 cmpq %rax, %rdx
124 jne .L31
125 .L30:
126 xorl %eax, %eax
128 .p2align 4,,10
129 .p2align 3
130 .L27:
131 addq $8, %r8
132 movq -8(%r8), %rax
133 addq $8, %rcx
134 leaq -1(%rax), %rsi
135 testq %rax, %rax
136 movq %rsi, -8(%rcx)
137 jne .L26
138 .L25:
139 subq $1, %rdx
140 jne .L27
141 movl $1, %eax
143 .size __mpn_sub_1, .-__mpn_sub_1
144 .p2align 4,,15
145 .globl __mpn_sub
146 .type __mpn_sub, @function
147 __mpn_sub:
148 pushq %r12
149 pushq %rbp
150 xorl %eax, %eax
151 pushq %rbx
152 movq %rdi, %rbp
153 movq %rsi, %r12
154 movq %rdx, %rbx
155 subq $16, %rsp
156 testq %r8, %r8
157 jne .L41
158 .L35:
159 cmpq %rbx, %r8
160 je .L34
161 leaq 0(,%r8,8), %rdi
162 addq $16, %rsp
163 subq %r8, %rbx
164 movq %rbx, %rdx
165 movq %rax, %rcx
166 leaq (%r12,%rdi), %rsi
167 addq %rbp, %rdi
168 popq %rbx
169 popq %rbp
170 popq %r12
171 jmp __mpn_sub_1
172 .p2align 4,,10
173 .p2align 3
174 .L34:
175 addq $16, %rsp
176 popq %rbx
177 popq %rbp
178 popq %r12
180 .p2align 4,,10
181 .p2align 3
182 .L41:
183 movq %rcx, %rdx
184 movq %r8, %rcx
185 movq %r8, 8(%rsp)
186 call __mpn_sub_n
187 movq 8(%rsp), %r8
188 jmp .L35
189 .size __mpn_sub, .-__mpn_sub
190 .hidden __mpn_sub_n
191 .hidden __mpn_add_n