GitHub Link: https://github.com/EpsilonNought117/libapac
I have inspired my API and naming scheme from GMP's public API, but the internals are (to the best of my knowledge) completely my own. The library uses a runtime dispatch to micro-arch specific versions of assembly functions on x86-64 CPUs currently for Unix-like and Windows OS, with future support planned on ARM64 on both as well. I have handwritten all the assembly routines (probably obvious by the writing style) using MASM and GAS assemblers, with a few SIMD based routines written with compiler intrinsic functions.
The performance (so far) seems to be on par with GMP for small to medium-sized Big Integers (performance graphs in README). I have implemented a few algorithms such as the Karatsuba Algorithm and Divide-&-Conquer division (Balanced and Unbalanced) with more algorithms on the way as needed. The books "Modern Computer Arithmetic" by Brent and Zimmerman and "Hacker's Delight" by Henry Warren Jr have really helped a lot.
Still largely WIP.
Interested in any feedback and/or criticisms. Happy to answer any questions.
Tommyrexx•1h ago