Recent changes to mpn_get_str/mpn_set_str

Marco Bodrato bodrato at
Mon Feb 13 17:54:32 UTC 2017


Il Gio, 2 Febbraio 2017 5:02 pm, Torbjörn Granlund ha scritto:
> "Marco Bodrato" <bodrato at> writes:
>   Maybe I'll try, the basecase...
> I take this as a promise. :-)

A first attempt is attached.
It is not specialised for base 10, and it is not faster than current code
if only a few limbs must be converted, but around 10 limbs it should be a
For some bases it the current code is particularly slow for a single
limb... the attached one is faster in those cases...

> power will be available.  One should be computed with mpn_pow_1 (or a
> new mpn_1_pow_1 (or whatever to call it; it would take a mp_limb_t base
> unlike mpn_pow_1 which takes a (mp_ptr,mp_size_t) base).

I quickly wrote a sort-of pow_1, but this part needs refinement.


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

More information about the gmp-devel mailing list