Shared toom evaluation functions

bodrato at bodrato at
Sun Nov 15 21:13:51 CET 2009


> Several have mpn_addlsh1_n, and they run up to 2x faster than separate
> lshift and add_n.  (Same goes for sub.)  No machine or almost no has
> mpn_addlsh_n, since it has proven tricky to make fast.

In Toom evaluations addlsh2_n would be much more useful than addlsh1_n,
and also a speed-up of 1.5x can be better than nothing...

> We should use mpn_addlsh1_n in more places I think, even for the s,t
> related computations, such as pm2 in toom72.  That will be a bit tricky,

All evaluations in \pm2 and \pm1/2 for operands split in two should better
use the simple trick:
b0 + 2*b1 = (b0 + b1) + b1
b0 - 2*b1 = (b0 - b1) - b1
2*b0 + b1 = (b0 + b1) + b0
2*b0 - b1 = (b0 - b1) + b0
where one needs the evaluations in \pm1, but avoid any shift.



More information about the gmp-devel mailing list