Dear Torbjörn,

> What do you think about this stopgap change?

I would entirely drop all the squaring-related stuff from mpn_mul:
the user/developer should call mpn_sqr instead (see my previous mail).

Then the code would become:

   if (BELOW_THRESHOLD (vn, MUL_TOOM22_THRESHOLD))
     {
       mpn_mul_basecase (prodp, up, un, vp, vn);
       return prodp[un + vn - 1];       /* historic */
     }

   if (un == vn)
       return mpn_mul_n (prodp, up, vp, un);

   ...

(I believe it is vn and not un that should be compared to MUL_TOOM22_THRESHOLD.)

Paul
_______________________________________________
gmp-devel mailing list
[email protected]
https://gmplib.org/mailman/listinfo/gmp-devel

Reply via email to