diff options
author | polwex <polwex@sortug.com> | 2025-10-05 21:56:51 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-10-05 21:56:51 +0700 |
commit | fcedfddf00b3f994e4f4e40332ac7fc192c63244 (patch) | |
tree | 51d38e62c7bdfcc5f9a5e9435fe820c93cfc9a3d /vere/ext/gmp/gen/aarch64-macos/mpn/mod_34lsub1.s |
claude is gud
Diffstat (limited to 'vere/ext/gmp/gen/aarch64-macos/mpn/mod_34lsub1.s')
-rw-r--r-- | vere/ext/gmp/gen/aarch64-macos/mpn/mod_34lsub1.s | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/vere/ext/gmp/gen/aarch64-macos/mpn/mod_34lsub1.s b/vere/ext/gmp/gen/aarch64-macos/mpn/mod_34lsub1.s new file mode 100644 index 0000000..9ba8210 --- /dev/null +++ b/vere/ext/gmp/gen/aarch64-macos/mpn/mod_34lsub1.s @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + .text + .align 5 + .text + .align 3 + .globl ___gmpn_mod_34lsub1 + +___gmpn_mod_34lsub1: + subs x1, x1, #3 + mov x8, #0 + b.lt Lle2 + + ldp x2, x3, [x0, #0] + ldr x4, [x0, #16] + add x0, x0, #24 + subs x1, x1, #3 + b.lt Lsum + cmn x0, #0 + +Ltop: ldp x5, x6, [x0, #0] + ldr x7, [x0, #16] + add x0, x0, #24 + sub x1, x1, #3 + adcs x2, x2, x5 + adcs x3, x3, x6 + adcs x4, x4, x7 + tbz x1, #63, Ltop + + adc x8, xzr, xzr + +Lsum: cmn x1, #2 + mov x5, #0 + b.lo 1f + ldr x5, [x0], #8 +1: mov x6, #0 + b.ls 1f + ldr x6, [x0], #8 +1: adds x2, x2, x5 + adcs x3, x3, x6 + adcs x4, x4, xzr + adc x8, x8, xzr + +Lsum2: + and x0, x2, #0xffffffffffff + add x0, x0, x2, lsr #48 + add x0, x0, x8 + + lsl x8, x3, #16 + and x1, x8, #0xffffffffffff + add x0, x0, x1 + add x0, x0, x3, lsr #32 + + lsl x8, x4, #32 + and x1, x8, #0xffffffffffff + add x0, x0, x1 + add x0, x0, x4, lsr #16 + ret + +Lle2: cmn x1, #1 + b.ne L1 + ldp x2, x3, [x0] + mov x4, #0 + b Lsum2 +L1: ldr x2, [x0] + and x0, x2, #0xffffffffffff + add x0, x0, x2, lsr #48 + ret + |