speed of unbalanced multiplication

bodrato at mail.dm.unipi.it bodrato at mail.dm.unipi.it
Thu Feb 7 11:06:31 CET 2013


Ciao Niels,

Il Gio, 7 Febbraio 2013 10:29 am, Niels Möller ha scritto:
> I don't understand the details, like the align parameter to the

Unfortunately, it's the same for me... I only tried to mimic the MPN_MUL_N
macro.

> Makes sense to me to have the r parameter give the size of the smaller
> operand. Are there any drawbacks?

If (large_size<2*small_size), my patch saves some allocated memory.
If (large_size>2*small_size), my code is more greedy.

Default is to measure "large=small"...

> But if we change the meaning of r, maybe it would make sense to
> interpret it as follows:
[...]
>   if r > size, its the size of the *product*, so do size limbs by (r -
>   size) limbs.
>
> That would make it a bit more convenient to measure how smooth the
> performance is for unbalanced multiplications.

I like the proposal!
A single line added, and it's done (README should be updated too).

But it might be difficoult to read runs like:

$ tune/speed -s 3-8 mpn_mul.6
            mpn_mul.6
3         0.000000412
4         0.000000277
5         0.000000236
6         0.000000850
7         0.000000827
8         0.000000942

Best regards,
m

-- 
http://bodrato.it/software/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: speed.diff
Type: text/x-patch
Size: 2232 bytes
Desc: not available
URL: <http://gmplib.org/list-archives/gmp-devel/attachments/20130207/9938ea4e/attachment.bin>


More information about the gmp-devel mailing list