clarify the purpose of this project
[nyanglibc.git] / stdlib / sub_n.shared.s
bloba4015f595c039b89000fe6f9eb2a7fa82adbf4c4
1 .text
2 .globl __mpn_sub_n
3 .type __mpn_sub_n,@function
4 .align 1<<4
5 __mpn_sub_n:
6 xor %r8, %r8
7 mov (%rsi), %r10
8 mov (%rdx), %r11
9 lea -8(%rsi,%rcx,8), %rsi
10 lea -8(%rdx,%rcx,8), %rdx
11 lea -16(%rdi,%rcx,8), %rdi
12 mov %ecx, %eax
13 neg %rcx
14 and $3, %eax
15 je .Lb00
16 add %rax, %rcx
17 cmp $2, %eax
18 jl .Lb01
19 je .Lb10
20 .Lb11: shr %r8
21 jmp .Le11
22 .Lb00: shr %r8
23 mov %r10, %r8
24 mov %r11, %r9
25 lea 4(%rcx), %rcx
26 jmp .Le00
27 .Lb01: shr %r8
28 jmp .Le01
29 .Lb10: shr %r8
30 mov %r10, %r8
31 mov %r11, %r9
32 jmp .Le10
33 .Lend: sbb %r11, %r10
34 mov %r10, 8(%rdi)
35 mov %ecx, %eax
36 adc %eax, %eax
37 ret
38 .p2align 4
39 .Ltop:
40 mov -24(%rsi,%rcx,8), %r8
41 mov -24(%rdx,%rcx,8), %r9
42 sbb %r11, %r10
43 mov %r10, -24(%rdi,%rcx,8)
44 .Le00:
45 mov -16(%rsi,%rcx,8), %r10
46 mov -16(%rdx,%rcx,8), %r11
47 sbb %r9, %r8
48 mov %r8, -16(%rdi,%rcx,8)
49 .Le11:
50 mov -8(%rsi,%rcx,8), %r8
51 mov -8(%rdx,%rcx,8), %r9
52 sbb %r11, %r10
53 mov %r10, -8(%rdi,%rcx,8)
54 .Le10:
55 mov (%rsi,%rcx,8), %r10
56 mov (%rdx,%rcx,8), %r11
57 sbb %r9, %r8
58 mov %r8, (%rdi,%rcx,8)
59 .Le01:
60 jrcxz .Lend
61 lea 4(%rcx), %rcx
62 jmp .Ltop
63 .size __mpn_sub_n,.-__mpn_sub_n