GMP use in vcpkg on Windows

Neill Clift NeillClift at
Tue Sep 21 16:49:23 UTC 2021

I just built a thin layer so I can run my addition chain code with GMP instead of boost fixed size integers. I am using the low level MPN_ routines.
I got about an 8% improvement in performance. My integers are not that big though. I am currently trying to find an optimal addition chain for 2^141-1 so my calculation are limited to ~140 bits.
I test performance with the much easier 2^145-1 test case. So 64 bit limbs are mostly going to be 2 in most calculations.
I am seeing about 4% of the time in _gmpn_invert_limb. I am guessing for division (division and GCD are the most complicated thing I do) the code is calculating the inverse of the leading limb of the divisor?
I use GMP in windows under vcpkg. I am wondering if people have experience with this.
How can I check how GMP is configured (AVX2 etc, my main machine is a dual EPYC 7713 but I do have an AVX512 machine as well as a Broadwell)? I assume there is some output header file or something.
I see that the divide code is not using say tzcnt type intrinsics for count_leading_zeros. I also see that we are generating security cookie code which is a waste for my application. I don't have much clue how this code is getting built at this point.

More information about the gmp-discuss mailing list