summaryrefslogtreecommitdiff
path: root/vere/ext/gmp/gen/aarch64-macos/mpn/lshiftc.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/lshiftc.s
claude is gud
Diffstat (limited to 'vere/ext/gmp/gen/aarch64-macos/mpn/lshiftc.s')
-rw-r--r--vere/ext/gmp/gen/aarch64-macos/mpn/lshiftc.s153
1 files changed, 153 insertions, 0 deletions
diff --git a/vere/ext/gmp/gen/aarch64-macos/mpn/lshiftc.s b/vere/ext/gmp/gen/aarch64-macos/mpn/lshiftc.s
new file mode 100644
index 0000000..438136f
--- /dev/null
+++ b/vere/ext/gmp/gen/aarch64-macos/mpn/lshiftc.s
@@ -0,0 +1,153 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ .text
+ .align 3
+ .globl ___gmpn_lshiftc
+
+___gmpn_lshiftc:
+ add x16, x0, x2, lsl #3
+ add x1, x1, x2, lsl #3
+ sub x8, xzr, x3
+ lsr x17, x2, #2
+ tbz x2, #0, Lbx0
+
+Lbx1: ldr x4, [x1,#-8]
+ tbnz x2, #1, Lb11
+
+Lb01: lsr x0, x4, x8
+ lsl x2, x4, x3
+ cbnz x17, Lgt1
+ mvn x2, x2
+ str x2, [x16,#-8]
+ ret
+Lgt1: ldp x4, x5, [x1,#-24]
+ sub x1, x1, #8
+ add x16, x16, #16
+ b Llo2
+
+Lb11: lsr x0, x4, x8
+ lsl x2, x4, x3
+ ldp x6, x7, [x1,#-24]!
+ b Llo3
+
+Lbx0: ldp x4, x5, [x1,#-16]
+ tbz x2, #1, Lb00
+
+Lb10: lsr x0, x5, x8
+ lsl x13, x5, x3
+ lsr x10, x4, x8
+ lsl x2, x4, x3
+ cbnz x17, Lgt2
+ eon x10, x10, x13
+ mvn x2, x2
+ stp x2, x10, [x16,#-16]
+ ret
+Lgt2: ldp x4, x5, [x1,#-32]
+ eon x10, x10, x13
+ str x10, [x16,#-8]
+ sub x1, x1, #16
+ add x16, x16, #8
+ b Llo2
+
+Lb00: lsr x0, x5, x8
+ lsl x13, x5, x3
+ lsr x10, x4, x8
+ lsl x2, x4, x3
+ ldp x6, x7, [x1,#-32]!
+ eon x10, x10, x13
+ str x10, [x16,#-8]!
+ b Llo0
+
+ .align 4
+Ltop: ldp x4, x5, [x1,#-16]
+ eon x10, x10, x13
+ eon x11, x12, x2
+ stp x10, x11, [x16,#-16]
+ lsl x2, x6, x3
+Llo2: lsr x10, x4, x8
+ lsl x13, x5, x3
+ lsr x12, x5, x8
+ ldp x6, x7, [x1,#-32]!
+ eon x10, x10, x13
+ eon x11, x12, x2
+ stp x10, x11, [x16,#-32]!
+ lsl x2, x4, x3
+Llo0: sub x17, x17, #1
+Llo3: lsr x10, x6, x8
+ lsl x13, x7, x3
+ lsr x12, x7, x8
+ cbnz x17, Ltop
+
+Lend: eon x10, x10, x13
+ eon x11, x12, x2
+ lsl x2, x6, x3
+ stp x10, x11, [x16,#-16]
+ mvn x2, x2
+ str x2, [x16,#-24]
+ ret
+