clarify the purpose of this project
[nyanglibc.git] / stdlib / float1282mpn.s
blob9ef3bfd5615bd2113453af6bf3b1425d8b04b13e
1 .text
2 .p2align 4,,15
3 .globl __mpn_extract_float128
4 .hidden __mpn_extract_float128
5 .type __mpn_extract_float128, @function
6 __mpn_extract_float128:
7 movaps %xmm0, -24(%rsp)
8 movq -16(%rsp), %r8
9 movq -24(%rsp), %rsi
10 movq %r8, %rax
11 movdqa -24(%rsp), %xmm1
12 shrq $63, %rax
13 movl %eax, (%rcx)
14 movq %r8, %rax
15 movl %r8d, %r8d
16 shrq $48, %rax
17 pextrw $7, %xmm1, %ecx
18 andl $32767, %eax
19 subl $16383, %eax
20 movl %eax, (%rdx)
21 pextrw $6, %xmm1, %eax
22 movq %rsi, (%rdi)
23 salq $32, %rax
24 orq %r8, %rax
25 testw $32767, %cx
26 movq %rax, 8(%rdi)
27 jne .L2
28 testq %rsi, %rsi
29 je .L10
30 testq %rax, %rax
31 jne .L4
32 bsrq %rsi, %rax
33 xorq $63, %rax
34 cmpl $14, %eax
35 movl %eax, %r8d
36 jg .L11
37 movl $15, %ecx
38 movq %rsi, %r10
39 subl %eax, %ecx
40 shrq %cl, %r10
41 leal 49(%rax), %ecx
42 movq %r10, 8(%rdi)
43 salq %cl, %rsi
44 movq %rsi, (%rdi)
45 .L8:
46 movl $-16431, %eax
47 subl %r8d, %eax
48 movl %eax, (%rdx)
49 movl $2, %eax
50 ret
51 .p2align 4,,10
52 .p2align 3
53 .L2:
54 movabsq $281474976710656, %rdx
55 orq %rdx, %rax
56 movq %rax, 8(%rdi)
57 movl $2, %eax
58 ret
59 .p2align 4,,10
60 .p2align 3
61 .L10:
62 testq %rax, %rax
63 je .L12
64 .L4:
65 bsrq %rax, %r8
66 movl $64, %ecx
67 movq %rsi, %r9
68 xorq $63, %r8
69 subl $15, %r8d
70 subl %r8d, %ecx
71 shrq %cl, %r9
72 movl %r8d, %ecx
73 salq %cl, %rax
74 salq %cl, %rsi
75 orq %r9, %rax
76 movq %rsi, (%rdi)
77 movq %rax, 8(%rdi)
78 movl $-16382, %eax
79 subl %r8d, %eax
80 movl %eax, (%rdx)
81 movl $2, %eax
82 ret
83 .p2align 4,,10
84 .p2align 3
85 .L12:
86 movl $0, (%rdx)
87 movl $2, %eax
88 ret
89 .p2align 4,,10
90 .p2align 3
91 .L11:
92 leal -15(%rax), %ecx
93 movq $0, (%rdi)
94 salq %cl, %rsi
95 movq %rsi, 8(%rdi)
96 jmp .L8
97 .size __mpn_extract_float128, .-__mpn_extract_float128