clarify the purpose of this project
[nyanglibc.git] / stdlib / addmul_1.s
blob15dde4cc5e1976ca5581c9a63893a7a62fb74d7a
1 .text
2 .globl __mpn_addmul_1
3 .type __mpn_addmul_1,@function
4 .align 1<<4
5 __mpn_addmul_1:
6 push %rbx
7 push %rbp
8 lea (%rdx), %rbx
9 neg %rbx
10 mov (%rsi), %rax
11 mov (%rdi), %r10
12 lea -16(%rdi,%rdx,8), %rdi
13 lea (%rsi,%rdx,8), %rsi
14 mul %rcx
15 bt $0, %ebx
16 jc .Lodd
17 lea (%rax), %r11
18 mov 8(%rsi,%rbx,8), %rax
19 lea (%rdx), %rbp
20 mul %rcx
21 add $2, %rbx
22 jns .Ln2
23 lea (%rax), %r8
24 mov (%rsi,%rbx,8), %rax
25 lea (%rdx), %r9
26 jmp .Lmid
27 .Lodd: add $1, %rbx
28 jns .Ln1
29 lea (%rax), %r8
30 mov (%rsi,%rbx,8), %rax
31 lea (%rdx), %r9
32 mul %rcx
33 lea (%rax), %r11
34 mov 8(%rsi,%rbx,8), %rax
35 lea (%rdx), %rbp
36 jmp .Le
37 .p2align 4
38 .Ltop: mul %rcx
39 add %r8, %r10
40 lea (%rax), %r8
41 mov (%rsi,%rbx,8), %rax
42 adc %r9, %r11
43 mov %r10, -8(%rdi,%rbx,8)
44 mov (%rdi,%rbx,8), %r10
45 lea (%rdx), %r9
46 adc $0, %rbp
47 .Lmid: mul %rcx
48 add %r11, %r10
49 lea (%rax), %r11
50 mov 8(%rsi,%rbx,8), %rax
51 adc %rbp, %r8
52 mov %r10, (%rdi,%rbx,8)
53 mov 8(%rdi,%rbx,8), %r10
54 lea (%rdx), %rbp
55 adc $0, %r9
56 .Le: add $2, %rbx
57 js .Ltop
58 mul %rcx
59 add %r8, %r10
60 adc %r9, %r11
61 mov %r10, -8(%rdi)
62 adc $0, %rbp
63 .Ln2: mov (%rdi), %r10
64 add %r11, %r10
65 adc %rbp, %rax
66 mov %r10, (%rdi)
67 adc $0, %rdx
68 .Ln1: mov 8(%rdi), %r10
69 add %rax, %r10
70 mov %r10, 8(%rdi)
71 mov %ebx, %eax
72 adc %rdx, %rax
73 pop %rbp
74 pop %rbx
75 ret
76 .size __mpn_addmul_1,.-__mpn_addmul_1