hgcd1/2
Torbjörn Granlund
tg at gmplib.org
Thu Sep 5 09:27:59 UTC 2019
nisse at lysator.liu.se (Niels Möller) writes:
For tuned *_METHOD values, it might be useful to let tuneup also add a
comment with next best method and margin, something like
#define HGCD2_METHOD 2 /* 3.2% faster than method 1 */
That'd be good!
I did one variant with table lookup and an approximative quotient, which
implies that one needed conditional swaps depending on a < b. That
didn't beat plain division in my testing. But I also expect that we can
beat plain division on more machines.
My suggested code was not 6 times faster! I was fooled by inlining. It
is 2-3 times faster only (on the system shell).
--
Torbjörn
Please encrypt, key id 0xC8601622
More information about the gmp-devel
mailing list