[Gmp-commit] /var/hg/gmp: 2 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Sun Nov 10 10:37:17 UTC 2019


details:   /var/hg/gmp/rev/a0ba29da8637
changeset: 17958:a0ba29da8637
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sun Nov 10 11:06:56 2019 +0100
description:
mini-gmp/mini-gmp.c: Use already defined constants.

details:   /var/hg/gmp/rev/5042923d8c45
changeset: 17959:5042923d8c45
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sun Nov 10 11:07:27 2019 +0100
description:
ChangeLog

diffstat:

 mini-gmp/ChangeLog  |  6 +++++-
 mini-gmp/mini-gmp.c |  4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diffs (41 lines):

diff -r dc44b59ee8db -r 5042923d8c45 mini-gmp/ChangeLog
--- a/mini-gmp/ChangeLog	Sat Nov 09 18:16:54 2019 +0100
+++ b/mini-gmp/ChangeLog	Sun Nov 10 11:07:27 2019 +0100
@@ -1,4 +1,4 @@
-2018-11-09 Marco Bodrato <bodrato at mail.dm.unipi.it>
+2019-11-09 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* mini-gmp/mini-gmp.c (gmp_clz, gmp_popcount_limb, mpz_export):
 	Avoid undefined behaviour with small limb sizes.
@@ -8,6 +8,10 @@
 	* tests/t-gcd.c (gcdext_valid_p): Stricter checks for gcdext
 	corner cases.
 
+2018-12-21 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* mini-gmp/mini-gmp.c: Support for micro-gmp.
+
 2018-11-07 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* mini-gmp/mini-gmp.c: Silence a couple of warnings.
diff -r dc44b59ee8db -r 5042923d8c45 mini-gmp/mini-gmp.c
--- a/mini-gmp/mini-gmp.c	Sat Nov 09 18:16:54 2019 +0100
+++ b/mini-gmp/mini-gmp.c	Sun Nov 10 11:07:27 2019 +0100
@@ -96,7 +96,7 @@
     mp_limb_t __clz_x = (x);						\
     unsigned __clz_c = 0;						\
     int LOCAL_SHIFT_BITS = 8;						\
-    if (sizeof(mp_limb_t) * CHAR_BIT > LOCAL_SHIFT_BITS)				\
+    if (GMP_LIMB_BITS > LOCAL_SHIFT_BITS)				\
       for (;								\
 	   (__clz_x & ((mp_limb_t) 0xff << (GMP_LIMB_BITS - 8))) == 0;	\
 	   __clz_c += 8)						\
@@ -4000,7 +4000,7 @@
       w =  (w >> 4) + w;
       w = ((w >> 8) & 0x000f) + (w & 0x000f);
       c += w;
-      if (sizeof(mp_limb_t) * CHAR_BIT > LOCAL_SHIFT_BITS)
+      if (GMP_LIMB_BITS > LOCAL_SHIFT_BITS)
 	x >>= LOCAL_SHIFT_BITS;
       else
 	x = 0;


More information about the gmp-commit mailing list