Niels Möller nisse at
Fri Feb 24 14:55:36 CET 2012

Here's a patch adding a new function mpn_mul_2c. Like mpn_mul_2, but
accepting an single-limb input carry.

I'd like to have it (and also mpn_addmul_2c) for generating diagonal
terms in sqr_basecase, but there may be other uses.

In the x86_64 assembly, I was tempted to move the initial
multiplication earlier, but when I tried I made mpn_mul_2 run a cycle
slower (problem is that n_param is in %rdx which collides with the
multiplication). Instead I had to duplicate the code for selecting the
loop entrypoint, and leave the old mul_2 code path unchanged.

Added support in devel/try.c, but there are no other testcases.
Comments appreciated.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: mul_2c.patch
Type: text/x-patch
Size: 8330 bytes
Desc: not available
URL: <>
-------------- next part --------------

Niels M?ller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.

More information about the gmp-devel mailing list