summaryrefslogtreecommitdiff
path: root/vere/ext/gmp/gen/aarch64-macos/mpn/cnd_add_n.s
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-10-05 21:56:51 +0700
committerpolwex <polwex@sortug.com>2025-10-05 21:56:51 +0700
commitfcedfddf00b3f994e4f4e40332ac7fc192c63244 (patch)
tree51d38e62c7bdfcc5f9a5e9435fe820c93cfc9a3d /vere/ext/gmp/gen/aarch64-macos/mpn/cnd_add_n.s
claude is gud
Diffstat (limited to 'vere/ext/gmp/gen/aarch64-macos/mpn/cnd_add_n.s')
-rw-r--r--vere/ext/gmp/gen/aarch64-macos/mpn/cnd_add_n.s136
1 files changed, 136 insertions, 0 deletions
diff --git a/vere/ext/gmp/gen/aarch64-macos/mpn/cnd_add_n.s b/vere/ext/gmp/gen/aarch64-macos/mpn/cnd_add_n.s
new file mode 100644
index 0000000..606d6c4
--- /dev/null
+++ b/vere/ext/gmp/gen/aarch64-macos/mpn/cnd_add_n.s
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ .text
+ .align 3
+ .globl ___gmpn_cnd_add_n
+
+___gmpn_cnd_add_n:
+ cmp x0, #1
+ sbc x0, x0, x0
+
+ cmn xzr, xzr
+
+ lsr x17, x4, #2
+ tbz x4, #0, Lbx0
+
+Lbx1: ldr x13, [x3]
+ ldr x11, [x2]
+ bic x7, x13, x0
+ adcs x9, x11, x7
+ str x9, [x1]
+ tbnz x4, #1, Lb11
+
+Lb01: cbz x17, Lrt
+ ldp x12, x13, [x3,#8]
+ ldp x10, x11, [x2,#8]
+ sub x2, x2, #8
+ sub x3, x3, #8
+ sub x1, x1, #24
+ b Lmid
+
+Lb11: ldp x12, x13, [x3,#8]!
+ ldp x10, x11, [x2,#8]!
+ sub x1, x1, #8
+ cbz x17, Lend
+ b Ltop
+
+Lbx0: ldp x12, x13, [x3]
+ ldp x10, x11, [x2]
+ tbnz x4, #1, Lb10
+
+Lb00: sub x2, x2, #16
+ sub x3, x3, #16
+ sub x1, x1, #32
+ b Lmid
+
+Lb10: sub x1, x1, #16
+ cbz x17, Lend
+
+ .align 4
+Ltop: bic x6, x12, x0
+ bic x7, x13, x0
+ ldp x12, x13, [x3,#16]
+ adcs x8, x10, x6
+ adcs x9, x11, x7
+ ldp x10, x11, [x2,#16]
+ stp x8, x9, [x1,#16]
+Lmid: bic x6, x12, x0
+ bic x7, x13, x0
+ ldp x12, x13, [x3,#32]!
+ adcs x8, x10, x6
+ adcs x9, x11, x7
+ ldp x10, x11, [x2,#32]!
+ stp x8, x9, [x1,#32]!
+ sub x17, x17, #1
+ cbnz x17, Ltop
+
+Lend: bic x6, x12, x0
+ bic x7, x13, x0
+ adcs x8, x10, x6
+ adcs x9, x11, x7
+ stp x8, x9, [x1,#16]
+Lrt: cset x0, cs
+ ret
+