sqrt algorithm

Marco Bodrato bodrato at mail.dm.unipi.it
Wed Aug 12 06:21:31 UTC 2015


Ciao,

On Tue, August 11, 2015 2:47 pm, Torbjörn Granlund wrote:
> In some cases, I'd expect the cutoff between
> functions A and B will be different depending on usage;

We have an explicit example of this: INV_MULMOD_BNM1_THRESHOLD is
typically larger than the MULMOD_BNM1_THRESHOLD, the latter is only used
internally .

> I took a new look at mullo now.  Our C code calls mul_1 and addmul_1
> (never mul_2, addmul_2) and furthermore calls the functions with a count
> argument so large that the return value is ignored.  I'd expect things
> to be faster by decreasing the count and compensate by performing a
> plain limb multiply in C.

I tested this approach for sqrlo_basecase too, you can find the code
enclosed by
#ifdef SQRLO_SHORTCUT_MULTIPLICATIONS

But I'm not sure it is faster, so it is currently disabled.

Regards,
m

-- 
http://bodrato.it/



More information about the gmp-devel mailing list