clarify the purpose of this project
[nyanglibc.git] / stdlib / ldbl2mpn.s
blobadde43450bd04b218b573ef038b88b5d7abe005f
1 .text
2 .p2align 4,,15
3 .globl __mpn_extract_long_double
4 .hidden __mpn_extract_long_double
5 .type __mpn_extract_long_double, @function
6 __mpn_extract_long_double:
7 movq %rdi, %r8
8 movl 16(%rsp), %edi
9 movq 8(%rsp), %rsi
10 movl %edi, -16(%rsp)
11 movzbl -15(%rsp), %eax
12 movq %rsi, -24(%rsp)
13 shrb $7, %al
14 movzbl %al, %eax
15 movl %eax, (%rcx)
16 movzwl -16(%rsp), %eax
17 movq %rdi, %rcx
18 andl $32767, %eax
19 subl $16383, %eax
20 andw $32767, %cx
21 movl %eax, (%rdx)
22 movq %rsi, %rax
23 movq %rsi, (%r8)
24 jne .L2
25 testq %rsi, %rsi
26 je .L6
27 movabsq $9223372036854775807, %rcx
28 andq %rcx, %rax
29 testq %rax, %rax
30 movq %rax, (%r8)
31 je .L5
32 bsrq %rax, %rcx
33 xorq $63, %rcx
34 salq %cl, %rax
35 movq %rax, (%r8)
36 movl $-16382, %eax
37 subl %ecx, %eax
38 movl %eax, (%rdx)
39 .L4:
40 movl $1, %eax
41 ret
42 .p2align 4,,10
43 .p2align 3
44 .L2:
45 testq %rsi, %rsi
46 jne .L4
47 cmpw $32767, %cx
48 je .L4
49 .L6:
50 movl $0, (%rdx)
51 movl $1, %eax
52 ret
53 .p2align 4,,10
54 .p2align 3
55 .L5:
56 movabsq $-9223372036854775808, %rax
57 movq %rax, (%r8)
58 movl $-16382, (%rdx)
59 movl $1, %eax
60 ret
61 .size __mpn_extract_long_double, .-__mpn_extract_long_double