diff options
author | Kevin Ryde <user42@zip.com.au> | 2004-02-14 01:39:29 +0100 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2004-02-14 01:39:29 +0100 |
commit | cfd4d344126fbb7036f1126caefbef19ccb55f65 (patch) | |
tree | a180dbb47025f2f6b1b2bc7612f64c03c376de98 /mpn | |
parent | 967158e289dcafd502471d0969e07d42cad91550 (diff) | |
download | gmp-cfd4d344126fbb7036f1126caefbef19ccb55f65.tar.gz |
* mpn/generic/mul_n.c: Add some remarks about toom3 high zero
stripping.
Diffstat (limited to 'mpn')
-rw-r--r-- | mpn/generic/mul_n.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mpn/generic/mul_n.c b/mpn/generic/mul_n.c index 1c78f20e5..7a6d798d0 100644 --- a/mpn/generic/mul_n.c +++ b/mpn/generic/mul_n.c @@ -386,6 +386,20 @@ mpn_kara_sqr_n (mp_ptr p, mp_srcptr a, mp_size_t n, mp_ptr ws) vinf0 is the low limb of vinf. ws is temporary space, and should have at least 2r limbs. + + Think about: + + The evaluated point a-b+c stands a good chance of having a zero carry + limb, a+b+c would have a 1/4 chance, and 4*a+2*b+c a 1/8 chance, roughly. + Perhaps this could be tested and stripped. Doing so before recursing + would be better than stripping at the start of mpn_toom3_mul_n/sqr_n, + since then the recursion could be based on the new size. Although in + truth the kara vs toom3 crossover is never so exact that one limb either + way makes a difference. + + A small value like 1 or 2 for the carry could perhaps also be handled + with an add_n or addlsh1_n. Would that be faster than an extra limb on a + (recursed) multiply/square? */ static void toom3_interpolate (mp_ptr c, mp_srcptr v1, mp_ptr v2, mp_ptr vm1, |