mini-gmp

Marco Bodrato bodrato at mail.dm.unipi.it
Fri Dec 21 22:36:22 UTC 2018


Ciao,

Il Ven, 21 Dicembre 2018 7:13 pm, Niels Möller ha scritto:
> tg at gmplib.org (Torbjörn Granlund) writes:

>> mini-gmp's main goal of being small en simple.
>
> Agree, we should not compromise simplicity. To me it might make sense to

I agree too.

Before my changes, lcov (
https://gmplib.org/devel/lcov/shell/gmp/mini-gmp/ ) reported for the file
mini-gmp.c:

Date:		2018-12-15 08:18:37
Line Coverage:	98.5 % 	2034 / 2066
Functions:	99.0 % 	197 / 199
Branches:	87.6 % 	1117 / 1275

Now it says:

Date: 	2018-12-21 08:03:29
Line Coverage:	98.4 % 	2029 / 2061
Functions:	99.0 % 	196 / 198
Branches:	87.4 % 	1107 / 1267

I mean, the lines of code, and branches actually used if mp_limb_t is
unsigned long, did not increase.

> 2. Reduce the number of places that depend on mp_limb_t == unsigned
>    long, where that also makes code simpler. E.g, using init_set_ui or
>    roinit_ui in more of the _ui functions.

I agree, let's do that!

> 3. Make it easy to omit remaining the functions/macros depending on
>    mp_limb_t == unsigned long, to enable some separate wrapping which
>    defines substitutes and then includes mini-gmp.c.

That's an interesting approach. After the step 2 you proposed, we will
decide the best way: code protected with compile time optimised if (cond),
or completely removed by #ifdef with replacements in another file.

Ĝis,
m



More information about the gmp-devel mailing list