clarify the purpose of this project
[nyanglibc.git] / misc / qefgcvt_r.s
blob85badeb2d9a596e546198403312d08471a714015
1 .text
2 .section .rodata.str1.1,"aMS",@progbits,1
3 .LC3:
4 .string "%.*Lf"
5 .text
6 .p2align 4,,15
7 .globl __qfcvt_r
8 .hidden __qfcvt_r
9 .type __qfcvt_r, @function
10 __qfcvt_r:
11 pushq %r15
12 pushq %r14
13 pushq %r13
14 pushq %r12
15 pushq %rbp
16 pushq %rbx
17 subq $24, %rsp
18 testq %rcx, %rcx
19 fldt 80(%rsp)
20 je .L50
21 fldt .LC0(%rip)
22 fld %st(1)
23 fabs
24 fxch %st(1)
25 fucomip %st(1), %st
26 fstp %st(0)
27 jnb .L51
28 movl $0, (%rdx)
29 .L46:
30 cmpl $21, %edi
31 movl $21, %r13d
32 cmovg %r13d, %edi
33 xorl %r13d, %r13d
34 .L7:
35 subq $16, %rsp
36 movq %rcx, %rbp
37 leaq .LC3(%rip), %rdx
38 fld %st(0)
39 fstpt (%rsp)
40 movl %edi, %ecx
41 xorl %eax, %eax
42 movq %rsi, %r14
43 movq %rbp, %rdi
44 movq %r8, %rsi
45 movq %r8, %r12
46 fstpt 16(%rsp)
47 call __snprintf
48 movslq %eax, %rbx
49 cmpq %rbx, %r12
50 popq %rdx
51 popq %rcx
52 jle .L26
53 testq %rbx, %rbx
54 fldt (%rsp)
55 jle .L57
56 movsbl 0(%rbp), %edx
57 subl $48, %edx
58 cmpl $9, %edx
59 ja .L58
60 xorl %r10d, %r10d
61 jmp .L12
62 .p2align 4,,10
63 .p2align 3
64 .L53:
65 movsbl 1(%rbp,%r10), %edx
66 subl $48, %edx
67 cmpl $9, %edx
68 ja .L52
69 movq %r9, %r10
70 .L12:
71 leaq 1(%r10), %r9
72 cmpq %r9, %rbx
73 jne .L53
74 fstp %st(0)
75 movl %eax, (%r14)
76 .L14:
77 testl %r13d, %r13d
78 je .L48
79 subq $1, %r12
80 addl %r13d, (%r14)
81 cmpq %rbx, %r12
82 jle .L48
83 subl $1, %r13d
84 .p2align 4,,10
85 .p2align 3
86 .L24:
87 addq $1, %rbx
88 cmpq %rbx, %r12
89 movb $48, -1(%rbp,%rbx)
90 setg %dl
91 testl %r13d, %r13d
92 setg %al
93 subl $1, %r13d
94 testb %al, %dl
95 jne .L24
96 movb $0, 0(%rbp,%rbx)
97 .L48:
98 xorl %eax, %eax
99 .L1:
100 addq $24, %rsp
101 popq %rbx
102 popq %rbp
103 popq %r12
104 popq %r13
105 popq %r14
106 popq %r15
108 .p2align 4,,10
109 .p2align 3
110 .L51:
111 xorl %r9d, %r9d
112 fxam
113 fnstsw %ax
114 andl $512, %eax
115 setne %r9b
116 movl %r9d, (%rdx)
117 je .L5
118 fchs
119 .L5:
120 testl %edi, %edi
121 jns .L46
122 fld %st(0)
123 negl %edi
124 xorl %eax, %eax
125 movl %edi, %r13d
126 fldl .LC1(%rip)
127 fld1
128 fxch %st(3)
129 jmp .L8
130 .p2align 4,,10
131 .p2align 3
132 .L59:
133 fxch %st(2)
134 fxch %st(1)
135 fxch %st(3)
136 .L8:
137 fmul %st(1), %st
138 fxch %st(3)
139 fucomi %st(3), %st
140 ja .L25
141 fstp %st(2)
142 fxch %st(1)
143 addl $1, %eax
144 fld %st(2)
145 cmpl %eax, %r13d
146 jne .L59
147 fstp %st(0)
148 fstp %st(0)
149 fstp %st(0)
150 xorl %edi, %edi
151 jmp .L7
152 .p2align 4,,10
153 .p2align 3
154 .L52:
155 movslq %r9d, %rcx
156 movl %r9d, (%r14)
157 leaq 2(%rbp,%r10), %rdx
158 jmp .L16
159 .p2align 4,,10
160 .p2align 3
161 .L54:
162 movsbl (%rsi), %eax
163 addq $1, %rdx
164 subl $48, %eax
165 cmpl $9, %eax
166 jbe .L15
167 movq %r15, %r9
168 .L16:
169 leaq 1(%r9), %r15
170 movq %rdx, %rsi
171 cmpq %r15, %rbx
172 jg .L54
173 .L15:
174 cmpl $1, %ecx
175 je .L55
176 fstp %st(0)
177 testl %ecx, %ecx
178 movl $0, %edi
179 cmovns %rcx, %rdi
180 addq %rbp, %rdi
181 .L20:
182 movq %rbx, %rdx
183 subq %r15, %rdx
184 call memmove
185 movl (%r14), %eax
186 testl %eax, %eax
187 movl $0, %eax
188 cmovns (%r14), %eax
189 cltq
190 subq %rax, %r15
191 movq %rbx, %rax
192 subq %r15, %rax
193 movb $0, 0(%rbp,%rax)
194 jmp .L14
195 .p2align 4,,10
196 .p2align 3
197 .L55:
198 cmpb $48, 0(%rbp)
199 jne .L60
200 fldz
201 movl $1, %edx
202 fucomip %st(1), %st
203 fstp %st(0)
204 setp %al
205 cmovne %edx, %eax
206 testb %al, %al
207 jne .L18
208 jmp .L31
209 .L60:
210 fstp %st(0)
211 .L31:
212 leaq 1(%rbp), %rdi
213 jmp .L20
214 .p2align 4,,10
215 .p2align 3
216 .L57:
217 fstp %st(0)
218 jmp .L10
219 .p2align 4,,10
220 .p2align 3
221 .L58:
222 fstp %st(0)
223 .L10:
224 movl $0, (%r14)
225 addq $24, %rsp
226 xorl %eax, %eax
227 popq %rbx
228 popq %rbp
229 popq %r12
230 popq %r13
231 popq %r14
232 popq %r15
234 .p2align 4,,10
235 .p2align 3
236 .L25:
237 fstp %st(0)
238 fstp %st(0)
239 fstp %st(1)
240 movl %eax, %r13d
241 xorl %edi, %edi
242 jmp .L7
243 .L18:
244 cmpq %r15, %rbx
245 movl $0, (%r14)
246 jle .L30
247 cmpb $48, (%rsi)
248 jne .L30
249 leaq 2(%rbp,%r9), %rcx
250 movl $-1, %edx
251 jmp .L22
252 .p2align 4,,10
253 .p2align 3
254 .L21:
255 subl $1, %edx
256 cmpb $48, (%rsi)
257 leaq 1(%rcx), %rcx
258 jne .L56
259 .L22:
260 addq $1, %r15
261 movslq %edx, %rax
262 movl %edx, (%r14)
263 cmpq %r15, %rbx
264 movq %rcx, %rsi
265 jne .L21
266 testl %edx, %edx
267 movl $0, %edi
268 cmovns %edx, %edi
269 movslq %edi, %rdi
270 addq %rbp, %rdi
271 jmp .L20
272 .L26:
273 movl $-1, %eax
274 jmp .L1
275 .L50:
276 fstp %st(0)
277 movq __libc_errno@gottpoff(%rip), %rax
278 movl $22, %fs:(%rax)
279 movl $-1, %eax
280 jmp .L1
281 .L56:
282 testl %eax, %eax
283 movl $0, %edi
284 cmovns %rax, %rdi
285 addq %rbp, %rdi
286 jmp .L20
287 .L30:
288 movq %rbp, %rdi
289 jmp .L20
290 .size __qfcvt_r, .-__qfcvt_r
291 .weak qfcvt_r
292 .set qfcvt_r,__qfcvt_r
293 .p2align 4,,15
294 .globl __qecvt_r
295 .hidden __qecvt_r
296 .type __qecvt_r, @function
297 __qecvt_r:
298 pushq %rbp
299 pushq %rbx
300 movq %rsi, %rbp
301 subq $8, %rsp
302 testl %edi, %edi
303 fldt 32(%rsp)
304 setle %al
305 testq %r8, %r8
306 setne %sil
307 andl %esi, %eax
308 fld %st(0)
309 fabs
310 fldt .LC0(%rip)
311 fucomip %st(1), %st
312 fstp %st(0)
313 jb .L62
314 fldz
315 fxch %st(1)
316 fucomi %st(1), %st
317 fstp %st(1)
318 jp .L86
319 je .L97
320 .L86:
321 fldz
322 fld %st(1)
323 fxch %st(1)
324 fucomip %st(2), %st
325 ja .L103
326 .L65:
327 fldt .LC6(%rip)
328 xorl %ebx, %ebx
329 fucomi %st(1), %st
330 jbe .L106
331 fstp %st(1)
332 fdivrp %st, %st(1)
333 movl $-4931, %ebx
334 fldz
335 fld %st(1)
336 fxch %st(1)
337 fucomip %st(2), %st
338 ja .L104
339 jmp .L67
340 .p2align 4,,10
341 .p2align 3
342 .L106:
343 fstp %st(0)
344 .L67:
345 flds .LC7(%rip)
346 fld1
347 fucomi %st(2), %st
348 ja .L105
349 fld %st(1)
350 fxch %st(3)
351 fucomi %st(3), %st
352 fstp %st(3)
353 jb .L107
354 .p2align 4,,10
355 .p2align 3
356 .L74:
357 fld %st(1)
358 addl $1, %ebx
359 fmul %st, %st(1)
360 fmul %st(1), %st
361 fxch %st(3)
362 fucomi %st(3), %st
363 fstp %st(3)
364 jnb .L74
365 fstp %st(2)
366 fstp %st(0)
367 fdivrp %st, %st(1)
368 jmp .L63
369 .p2align 4,,10
370 .p2align 3
371 .L62:
372 xorl %ebx, %ebx
373 testb %al, %al
374 je .L75
375 fstp %st(0)
376 movb $0, (%rcx)
377 xorl %ebx, %ebx
378 movl $1, 0(%rbp)
379 xorl %eax, %eax
380 .L76:
381 movl %eax, (%rdx)
382 .L77:
383 addl %ebx, 0(%rbp)
384 xorl %eax, %eax
385 .L61:
386 addq $8, %rsp
387 popq %rbx
388 popq %rbp
390 .p2align 4,,10
391 .p2align 3
392 .L75:
393 cmpl $21, %edi
394 movl $21, %eax
395 movq %rbp, %rsi
396 cmovg %eax, %edi
397 subq $16, %rsp
398 subl $1, %edi
399 fstpt (%rsp)
400 call __qfcvt_r
401 testl %eax, %eax
402 popq %rdx
403 popq %rcx
404 je .L77
405 movl $-1, %eax
406 jmp .L61
407 .p2align 4,,10
408 .p2align 3
409 .L97:
410 xorl %ebx, %ebx
411 jmp .L63
412 .p2align 4,,10
413 .p2align 3
414 .L107:
415 fstp %st(0)
416 fstp %st(0)
417 fstp %st(0)
418 .p2align 4,,10
419 .p2align 3
420 .L63:
421 testb %al, %al
422 je .L75
423 fldt .LC0(%rip)
424 movb $0, (%rcx)
425 movl $1, 0(%rbp)
426 fld %st(1)
427 fabs
428 fxch %st(1)
429 fucomip %st(1), %st
430 fstp %st(0)
431 jb .L84
432 fxam
433 fnstsw %ax
434 fstp %st(0)
435 testb $2, %ah
436 setne %al
437 movzbl %al, %eax
438 jmp .L76
439 .p2align 4,,10
440 .p2align 3
441 .L105:
442 fld1
443 fxch %st(1)
444 .p2align 4,,10
445 .p2align 3
446 .L72:
447 fmul %st(2), %st
448 subl $1, %ebx
449 fld %st(3)
450 fmul %st(1), %st
451 fxch %st(2)
452 fucomi %st(2), %st
453 fstp %st(2)
454 ja .L72
455 fstp %st(3)
456 fstp %st(0)
457 fstp %st(0)
458 fmulp %st, %st(1)
459 jmp .L63
460 .p2align 4,,10
461 .p2align 3
462 .L103:
463 fchs
464 jmp .L65
465 .p2align 4,,10
466 .p2align 3
467 .L104:
468 fchs
469 movl $-4931, %ebx
470 jmp .L67
471 .L84:
472 fstp %st(0)
473 xorl %eax, %eax
474 jmp .L76
475 .size __qecvt_r, .-__qecvt_r
476 .weak qecvt_r
477 .set qecvt_r,__qecvt_r
478 .section .rodata.cst16,"aM",@progbits,16
479 .align 16
480 .LC0:
481 .long 4294967295
482 .long 4294967295
483 .long 32766
484 .long 0
485 .section .rodata.cst8,"aM",@progbits,8
486 .align 8
487 .LC1:
488 .long 2576980378
489 .long 1069128089
490 .section .rodata.cst16
491 .align 16
492 .LC6:
493 .long 3168843697
494 .long 3193661164
495 .long 2
496 .long 0
497 .section .rodata.cst4,"aM",@progbits,4
498 .align 4
499 .LC7:
500 .long 1092616192
501 .hidden memmove
502 .hidden __snprintf