-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: forgot to commit some gmp files
- Loading branch information
Showing
3 changed files
with
415 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,235 @@ | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
.text | ||
.align 3 | ||
.globl ___gmpn_preinv_divrem_1 | ||
|
||
___gmpn_preinv_divrem_1: | ||
cbz x3, Lfz | ||
stp x29, x30, [sp, #-80]! | ||
mov x29, sp | ||
stp x19, x20, [sp, #16] | ||
stp x21, x22, [sp, #32] | ||
stp x23, x24, [sp, #48] | ||
|
||
sub x21, x3, #1 | ||
add x7, x21, x1 | ||
add x20, x2, x21, lsl #3 | ||
add x19, x0, x7, lsl #3 | ||
mov x24, x1 | ||
mov x22, x4 | ||
mov x0, x5 | ||
tbnz x4, #63, Lnentry | ||
mov x23, x6 | ||
b Luentry | ||
|
||
|
||
.text | ||
.align 3 | ||
.globl ___gmpn_divrem_1 | ||
|
||
___gmpn_divrem_1: | ||
cbz x3, Lfz | ||
stp x29, x30, [sp, #-80]! | ||
mov x29, sp | ||
stp x19, x20, [sp, #16] | ||
stp x21, x22, [sp, #32] | ||
stp x23, x24, [sp, #48] | ||
|
||
sub x21, x3, #1 | ||
add x7, x21, x1 | ||
add x20, x2, x21, lsl #3 | ||
add x19, x0, x7, lsl #3 | ||
mov x24, x1 | ||
mov x22, x4 | ||
tbnz x4, #63, Lnormalised | ||
|
||
Lunnorm: | ||
clz x23, x22 | ||
lsl x0, x22, x23 | ||
bl ___gmpn_invert_limb | ||
Luentry: | ||
lsl x22, x22, x23 | ||
ldr x7, [x20], #-8 | ||
sub x8, xzr, x23 | ||
lsr x11, x7, x8 | ||
lsl x1, x7, x23 | ||
cbz x21, Luend | ||
|
||
Lutop:ldr x7, [x20], #-8 | ||
add x2, x11, #1 | ||
mul x10, x11, x0 | ||
umulh x17, x11, x0 | ||
lsr x9, x7, x8 | ||
orr x1, x1, x9 | ||
adds x10, x1, x10 | ||
adc x2, x2, x17 | ||
msub x11, x22, x2, x1 | ||
lsl x1, x7, x23 | ||
cmp x10, x11 | ||
add x14, x11, x22 | ||
csel x11, x14, x11, cc | ||
sbc x2, x2, xzr | ||
cmp x11, x22 | ||
bcs Lufx | ||
Luok: str x2, [x19], #-8 | ||
sub x21, x21, #1 | ||
cbnz x21, Lutop | ||
|
||
Luend:add x2, x11, #1 | ||
mul x10, x11, x0 | ||
umulh x17, x11, x0 | ||
adds x10, x1, x10 | ||
adc x2, x2, x17 | ||
msub x11, x22, x2, x1 | ||
cmp x10, x11 | ||
add x14, x11, x22 | ||
csel x11, x14, x11, cc | ||
sbc x2, x2, xzr | ||
subs x14, x11, x22 | ||
adc x2, x2, xzr | ||
csel x11, x14, x11, cs | ||
str x2, [x19], #-8 | ||
|
||
cbnz x24, Lftop | ||
lsr x0, x11, x23 | ||
ldp x19, x20, [sp, #16] | ||
ldp x21, x22, [sp, #32] | ||
ldp x23, x24, [sp, #48] | ||
ldp x29, x30, [sp], #80 | ||
ret | ||
|
||
Lufx: add x2, x2, #1 | ||
sub x11, x11, x22 | ||
b Luok | ||
|
||
|
||
Lnormalised: | ||
mov x0, x22 | ||
bl ___gmpn_invert_limb | ||
Lnentry: | ||
ldr x7, [x20], #-8 | ||
subs x14, x7, x22 | ||
adc x2, xzr, xzr | ||
csel x11, x14, x7, cs | ||
b Lnok | ||
|
||
Lntop:ldr x1, [x20], #-8 | ||
add x2, x11, #1 | ||
mul x10, x11, x0 | ||
umulh x17, x11, x0 | ||
adds x10, x1, x10 | ||
adc x2, x2, x17 | ||
msub x11, x22, x2, x1 | ||
cmp x10, x11 | ||
add x14, x11, x22 | ||
csel x11, x14, x11, cc | ||
sbc x2, x2, xzr | ||
cmp x11, x22 | ||
bcs Lnfx | ||
Lnok: str x2, [x19], #-8 | ||
sub x21, x21, #1 | ||
tbz x21, #63, Lntop | ||
|
||
Lnend:cbnz x24, Lfrac | ||
mov x0, x11 | ||
ldp x19, x20, [sp, #16] | ||
ldp x21, x22, [sp, #32] | ||
ldp x23, x24, [sp, #48] | ||
ldp x29, x30, [sp], #80 | ||
ret | ||
|
||
Lnfx: add x2, x2, #1 | ||
sub x11, x11, x22 | ||
b Lnok | ||
|
||
Lfrac:mov x23, #0 | ||
Lftop:add x2, x11, #1 | ||
mul x10, x11, x0 | ||
umulh x17, x11, x0 | ||
add x2, x2, x17 | ||
msub x11, x22, x2, xzr | ||
cmp x10, x11 | ||
add x14, x11, x22 | ||
csel x11, x14, x11, cc | ||
sbc x2, x2, xzr | ||
str x2, [x19], #-8 | ||
sub x24, x24, #1 | ||
cbnz x24, Lftop | ||
|
||
lsr x0, x11, x23 | ||
ldp x19, x20, [sp, #16] | ||
ldp x21, x22, [sp, #32] | ||
ldp x23, x24, [sp, #48] | ||
ldp x29, x30, [sp], #80 | ||
ret | ||
|
||
|
||
Lfz: cbz x1, Lzend | ||
Lztop:str xzr, [x0], #8 | ||
sub x1, x1, #1 | ||
cbnz x1, Lztop | ||
Lzend:mov x0, #0 | ||
ret | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
.text | ||
.align 3 | ||
.globl ___gmpn_add_nc | ||
|
||
___gmpn_add_nc: | ||
cmp x4, #1 | ||
b Lent | ||
|
||
.text | ||
.align 3 | ||
.globl ___gmpn_add_n | ||
|
||
___gmpn_add_n: | ||
cmn xzr, xzr | ||
Lent: lsr x17, x3, #2 | ||
tbz x3, #0, Lbx0 | ||
|
||
Lbx1: ldr x7, [x1] | ||
ldr x11, [x2] | ||
adcs x13, x7, x11 | ||
str x13, [x0],#8 | ||
tbnz x3, #1, Lb11 | ||
|
||
Lb01: cbz x17, Lret | ||
ldp x4, x5, [x1,#8] | ||
ldp x8, x9, [x2,#8] | ||
sub x1, x1, #8 | ||
sub x2, x2, #8 | ||
b Lmid | ||
|
||
Lb11: ldp x6, x7, [x1,#8] | ||
ldp x10, x11, [x2,#8] | ||
add x1, x1, #8 | ||
add x2, x2, #8 | ||
cbz x17, Lend | ||
b Ltop | ||
|
||
Lbx0: tbnz x3, #1, Lb10 | ||
|
||
Lb00: ldp x4, x5, [x1] | ||
ldp x8, x9, [x2] | ||
sub x1, x1, #16 | ||
sub x2, x2, #16 | ||
b Lmid | ||
|
||
Lb10: ldp x6, x7, [x1] | ||
ldp x10, x11, [x2] | ||
cbz x17, Lend | ||
|
||
.align 4 | ||
Ltop: ldp x4, x5, [x1,#16] | ||
ldp x8, x9, [x2,#16] | ||
adcs x12, x6, x10 | ||
adcs x13, x7, x11 | ||
stp x12, x13, [x0],#16 | ||
Lmid: ldp x6, x7, [x1,#32]! | ||
ldp x10, x11, [x2,#32]! | ||
adcs x12, x4, x8 | ||
adcs x13, x5, x9 | ||
stp x12, x13, [x0],#16 | ||
sub x17, x17, #1 | ||
cbnz x17, Ltop | ||
|
||
Lend: adcs x12, x6, x10 | ||
adcs x13, x7, x11 | ||
stp x12, x13, [x0] | ||
Lret: cset x0, cs | ||
ret | ||
|
Oops, something went wrong.