GMP 4.4 remaining tasks

bodrato at bodrato at
Tue Dec 8 10:41:22 CET 2009

>> I suppose we could write a special mulmod_bnm1 for the degenerate case
>> where 2bn < rn.
> I don't think you need any interesting special handling for that case.
> What happens is just that the top-level split into b mod (B^n + 1) and b
> mod (B^n - 1) are nops, where the "normal" case needs an add and a sub.
> Current code handles that (even though Marco has marked that handling as

The additional restrictions given by "#define ALLOW_MISUSE 0", affect size
an only. The product with (an > rn/2) && (an => bn) will work anyway.

My goal, when I modified mulmod_bnm1, was to allow the case (an+bn)<=rn.
So that mulmod_bnm1 can be used for the full product.
It is _not_ slower than current mpn_mul_fft_full...

The "misuse" forbidden by the definition above are _very_ degenerate:
 - (an+bn) < rn/2
 - (an < rn/2) && (rn < 2*MUL_FFT_MODF_THRESHOLD)
... they are allowed now, because the test function requires them too.



More information about the gmp-devel mailing list