summaryrefslogtreecommitdiff
path: root/vere/ext/gmp/gen/aarch64-macos/mpn/bdiv_q_1.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/bdiv_q_1.s
claude is gud
Diffstat (limited to 'vere/ext/gmp/gen/aarch64-macos/mpn/bdiv_q_1.s')
-rw-r--r--vere/ext/gmp/gen/aarch64-macos/mpn/bdiv_q_1.s137
1 files changed, 137 insertions, 0 deletions
diff --git a/vere/ext/gmp/gen/aarch64-macos/mpn/bdiv_q_1.s b/vere/ext/gmp/gen/aarch64-macos/mpn/bdiv_q_1.s
new file mode 100644
index 0000000..8ee70a5
--- /dev/null
+++ b/vere/ext/gmp/gen/aarch64-macos/mpn/bdiv_q_1.s
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ .text
+ .align 3
+ .globl ___gmpn_bdiv_q_1
+
+___gmpn_bdiv_q_1:
+
+ rbit x6, x3
+ clz x5, x6
+ lsr x3, x3, x5
+
+ adrp x7, ___gmp_binvert_limb_table@GOTPAGE
+ ubfx x6, x3, 1, 7
+ ldr x7, [x7, ___gmp_binvert_limb_table@GOTPAGEOFF]
+ ldrb w6, [x7, x6]
+ ubfiz x7, x6, 1, 8
+ umull x6, w6, w6
+ msub x6, x6, x3, x7
+ lsl x7, x6, 1
+ mul x6, x6, x6
+ msub x6, x6, x3, x7
+ lsl x7, x6, 1
+ mul x6, x6, x6
+ msub x4, x6, x3, x7
+
+ b ___gmpn_pi1_bdiv_q_1
+
+
+ .text
+ .align 3
+ .globl ___gmpn_pi1_bdiv_q_1
+
+___gmpn_pi1_bdiv_q_1:
+ sub x2, x2, #1
+ subs x6, x6, x6
+ ldr x9, [x1],#8
+ cbz x5, Lnorm
+
+Lunorm:
+ lsr x12, x9, x5
+ cbz x2, Leu1
+ sub x8, xzr, x5
+
+Ltpu: ldr x9, [x1],#8
+ lsl x7, x9, x8
+ orr x7, x7, x12
+ sbcs x6, x7, x6
+ mul x7, x6, x4
+ str x7, [x0],#8
+ lsr x12, x9, x5
+ umulh x6, x7, x3
+ sub x2, x2, #1
+ cbnz x2, Ltpu
+
+Leu1: sbcs x6, x12, x6
+ mul x6, x6, x4
+ str x6, [x0]
+ ret
+
+Lnorm:
+ mul x5, x9, x4
+ str x5, [x0],#8
+ cbz x2, Len1
+
+Ltpn: ldr x9, [x1],#8
+ umulh x5, x5, x3
+ sbcs x5, x9, x5
+ mul x5, x5, x4
+ str x5, [x0],#8
+ sub x2, x2, #1
+ cbnz x2, Ltpn
+
+Len1: ret
+