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/x86_64-linux/mpn/invert_limb.s |
claude is gud
Diffstat (limited to 'vere/ext/gmp/gen/x86_64-linux/mpn/invert_limb.s')
-rw-r--r-- | vere/ext/gmp/gen/x86_64-linux/mpn/invert_limb.s | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/vere/ext/gmp/gen/x86_64-linux/mpn/invert_limb.s b/vere/ext/gmp/gen/x86_64-linux/mpn/invert_limb.s new file mode 100644 index 0000000..d7352e7 --- /dev/null +++ b/vere/ext/gmp/gen/x86_64-linux/mpn/invert_limb.s @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.hidden __gmpn_invert_limb_table + + + .text + .align 16, 0x90 + .globl __gmpn_invert_limb + .type __gmpn_invert_limb,@function + +__gmpn_invert_limb: + + + mov %rdi, %rax + shr $55, %rax + + lea -512+__gmpn_invert_limb_table(%rip), %r8 + + movzwl (%r8,%rax,2), %ecx + + + mov %rdi, %rsi + mov %ecx, %eax + imul %ecx, %ecx + shr $24, %rsi + inc %rsi + imul %rsi, %rcx + shr $40, %rcx + sal $11, %eax + dec %eax + sub %ecx, %eax + + + mov $0x1000000000000000, %rcx + imul %rax, %rsi + sub %rsi, %rcx + imul %rax, %rcx + sal $13, %rax + shr $47, %rcx + add %rax, %rcx + + + mov %rdi, %rsi + shr %rsi + sbb %rax, %rax + sub %rax, %rsi + imul %rcx, %rsi + and %rcx, %rax + shr %rax + sub %rsi, %rax + mul %rcx + sal $31, %rcx + shr %rdx + add %rdx, %rcx + + mov %rdi, %rax + mul %rcx + add %rdi, %rax + mov %rcx, %rax + adc %rdi, %rdx + sub %rdx, %rax + + + ret + .size __gmpn_invert_limb,.-__gmpn_invert_limb + |