General mpn_gcd_basecase

Marco Bodrato bodrato at mail.dm.unipi.it
Sun Sep 1 22:00:11 UTC 2019


Il Dom, 1 Settembre 2019 11:10 pm, Marco Bodrato ha scritto:

> I send it again, I changed some variable names, added some comments and
> some #ifdef to experiment the different flavours.
>
> I get:

>  -DNLIMBS=10 -DSTAT=1
> bits/iteration avg: 2.60

If the mask is checked with the highest bit... I mean, if you compute the
mask with:

      /* maskm = ((1 << cnt) - 1) | 1 */
      maskm = GMP_NUMB_MASK >> (GMP_NUMB_BITS - MAX (cnt , 1));
#ifndef NO_MASK_ADJUST
      maskm = (maskm << (ucnt != 0)) | 1;
      maskm >>= ((ucnt != 0) & (cnt != GMP_NUMB_BITS)
		 & (up[n - 1] < (vp[n - 1] + 1) * (m & maskm)));
#endif
      m &= maskm;

Then you get
bits/iteration avg: 2.71


Ĝis,
m

-- 
http://bodrato.it/



More information about the gmp-devel mailing list