Tuning of hgcd2 div2

2020-01-23 Thread Niels Möller
Below is an attempt to add automatic tuning of HGCD2_DIV2_METHOD. On my laptop, method 1 (using div1 in the common case) is 9% faster than the current default method 2 (bitwise division). I wonder if it's really useful to support all variants in speed, or if that could be deleted, to simplify a b

Re: hgcd2_jacobi

2020-01-23 Thread Niels Möller
t...@gmplib.org (Torbjörn Granlund) writes: > ni...@lysator.liu.se (Niels Möller) writes: > > What about mpn/generic/hgcd2-div.h? > > Sounds OK. Done. > I'm leaning towards keeping static for now. Tables aren't that big, and > most archs don't use them anyway. > > You could hide them #if

Re: hgcd2_jacobi

2020-01-23 Thread Torbjörn Granlund
ni...@lysator.liu.se (Niels Möller) writes: Replying to myself... Best answers that way! :-) > Into gmp-impl.h, or its own file? In the latter case, what's a good name > and location? What about mpn/generic/hgcd2-div.h? Sounds OK. > How to deal with the tables (used for method 4 a

Re: hgcd2_jacobi

2020-01-23 Thread Niels Möller
Replying to myself... ni...@lysator.liu.se (Niels Möller) writes: > Into gmp-impl.h, or its own file? In the latter case, what's a good name > and location? What about mpn/generic/hgcd2-div.h? > How to deal with the tables (used for method 4 and 5)? We could keep the > static declaration (at l