mpn_mul is embarrassingly slow

Marco Bodrato bodrato at
Fri Apr 20 17:25:49 UTC 2018


Il Ven, 20 Aprile 2018 12:39 pm, Marc Glisse ha scritto:
> I just tried (LTO+PGO) on a trivial testcase, and gcc didn't manage to do
> anything clever with it. Doing it by hand to see how much potential gain
> there is, the timings are:
> mpn_mul: .56
> mpn_mul_n: .36
> mpn_mul_basecase: .16

Did you try also the documented function mpn_sec_mul?

If you know in advance that the size of your operand are bounded by some
given sizes, you can preallocate the required scratch space...



More information about the gmp-devel mailing list