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

mercurial at gmplib.org mercurial at gmplib.org
Mon Nov 14 19:41:24 UTC 2016


details:   /var/hg/gmp/rev/f049e75390fc
changeset: 17098:f049e75390fc
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Wed Nov 09 23:07:54 2016 +0100
description:
mpz/iset_str.c: Lazy allocation

details:   /var/hg/gmp/rev/56f4a38cb31a
changeset: 17099:56f4a38cb31a
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Mon Nov 14 20:40:48 2016 +0100
description:
mini-gmp/tests/t-pprime_p.c: Smaller operands (and different size)

details:   /var/hg/gmp/rev/ebb44438be48
changeset: 17100:ebb44438be48
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Mon Nov 14 20:41:20 2016 +0100
description:
Trivial merge

diffstat:

 acinclude.m4                |  12 ++++++------
 mini-gmp/tests/t-pprime_p.c |   8 ++++----
 mpz/iset_str.c              |   5 +++--
 mpz/set_str.c               |   2 +-
 4 files changed, 14 insertions(+), 13 deletions(-)

diffs (87 lines):

diff -r 82a55ed8bbd0 -r ebb44438be48 acinclude.m4
--- a/acinclude.m4	Wed Nov 02 20:27:27 2016 +0100
+++ b/acinclude.m4	Mon Nov 14 20:41:20 2016 +0100
@@ -1802,8 +1802,8 @@
 AC_CACHE_CHECK([if .align assembly directive is logarithmic],
                gmp_cv_asm_align_log,
 [GMP_TRY_ASSEMBLE(
-[      	$gmp_cv_asm_data
-      	.align  4
+[	$gmp_cv_asm_data
+	.align  4
 	$gmp_cv_asm_globl	foo
 	$gmp_cv_asm_byte	1
 	.align	4
@@ -1857,10 +1857,10 @@
 AC_CACHE_CHECK([if the .align directive accepts an 0x90 fill in .text],
                gmp_cv_asm_align_fill_0x90,
 [GMP_TRY_ASSEMBLE(
-[      	$gmp_cv_asm_text
-      	.align  4, 0x90
+[	$gmp_cv_asm_text
+	.align  4, 0x90
 	.byte   0
-      	.align  4, 0x90],
+	.align  4, 0x90],
 [if grep "Warning: Fill parameter ignored for executable section" conftest.out >/dev/null; then
   echo "Suppressing this warning by omitting 0x90" 1>&AC_FD_CC
   gmp_cv_asm_align_fill_0x90=no
@@ -3403,7 +3403,7 @@
           got[12] == "124" &&  \
           got[13] == "000" &&  \
           got[14] == "000" &&  \
-	  got[15] == "000")
+          got[15] == "000")
         {
           print "IEEE big endian"
           found = 1
diff -r 82a55ed8bbd0 -r ebb44438be48 mini-gmp/tests/t-pprime_p.c
--- a/mini-gmp/tests/t-pprime_p.c	Wed Nov 02 20:27:27 2016 +0100
+++ b/mini-gmp/tests/t-pprime_p.c	Mon Nov 14 20:41:20 2016 +0100
@@ -117,15 +117,15 @@
 
   for (i = 0; i < reps; i++)
     {
-      mini_urandomb (bs, 32);
-      size_range = mpz_get_ui (bs) % 12 + 1; /* 0..4096 bit operands */
+      mini_urandomb (bs, 16);
+      size_range = mpz_get_ui (bs) % 10 + 1; /* 0..1024 bit operands */
 
       mini_urandomb (bs, size_range);
       size = mpz_get_ui (bs);
       mini_rrandomb (a, size);
 
-      mini_urandomb (bs, 32);
-      size_range = mpz_get_ui (bs) % 12 + 1; /* 0..4096 bit operands */
+      mini_urandomb (bs, size_range);
+      size = mpz_get_ui (bs);
       mini_rrandomb (b, size);
 
       /* Exclude trivial factors */
diff -r 82a55ed8bbd0 -r ebb44438be48 mpz/iset_str.c
--- a/mpz/iset_str.c	Wed Nov 02 20:27:27 2016 +0100
+++ b/mpz/iset_str.c	Mon Nov 14 20:41:20 2016 +0100
@@ -36,8 +36,9 @@
 int
 mpz_init_set_str (mpz_ptr x, const char *str, int base)
 {
-  ALLOC (x) = 1;
-  PTR (x) = __GMP_ALLOCATE_FUNC_LIMBS (1);
+  static const mp_limb_t dummy_limb=0xc1a0;
+  ALLOC (x) = 0;
+  PTR (x) = (mp_ptr) &dummy_limb;
 
   /* if str has no digits mpz_set_str leaves x->_mp_size unset */
   SIZ (x) = 0;
diff -r 82a55ed8bbd0 -r ebb44438be48 mpz/set_str.c
--- a/mpz/set_str.c	Wed Nov 02 20:27:27 2016 +0100
+++ b/mpz/set_str.c	Mon Nov 14 20:41:20 2016 +0100
@@ -133,7 +133,7 @@
   str_size = s - begs;
 
   LIMBS_PER_DIGIT_IN_BASE (xsize, str_size, base);
-  MPZ_REALLOC (x, xsize);
+  MPZ_NEWALLOC (x, xsize);
 
   /* Convert the byte array in base BASE to our bignum format.  */
   xsize = mpn_set_str (PTR (x), (unsigned char *) begs, str_size, base);


More information about the gmp-commit mailing list