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

mercurial at gmplib.org mercurial at gmplib.org
Mon May 7 23:52:00 CEST 2012


details:   /var/hg/gmp/rev/a9fe2d67e0be
changeset: 14952:a9fe2d67e0be
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon May 07 23:51:00 2012 +0200
description:
Revert ENABLE_UNTESTED_FUNCTIONS change.

details:   /var/hg/gmp/rev/a162f61e82d5
changeset: 14953:a162f61e82d5
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon May 07 23:51:57 2012 +0200
description:
Trivial merge.

diffstat:

 ChangeLog                  |    6 +-
 mini-gmp/mini-gmp.c        |  192 ++++++++------------------------------------
 mpn/minithres/gmp-mparam.h |    2 +-
 mpz/oddfac_1.c             |    2 +
 tune/tuneup.c              |    2 +-
 5 files changed, 43 insertions(+), 161 deletions(-)

diffs (truncated from 793 to 300 lines):

diff -r 9ff994ee2cc6 -r a162f61e82d5 ChangeLog
--- a/ChangeLog	Mon May 07 08:31:11 2012 +0200
+++ b/ChangeLog	Mon May 07 23:51:57 2012 +0200
@@ -3,11 +3,11 @@
 	* mpn/minithres/gmp-mparam.h: Updated TOOM6 and FAC_DSC.
 	* tests/mpn/toom-sqr-shared.h: Don't test if no range.
 
+	* mpz/oddfac_1.c: Add ASSERTs to warn about small threshold.
+	* tune/tuneup.c: Update minimal threshold for FAC_DSC.
+
 2012-05-06  Torbjorn Granlund  <tege at gmplib.org>
 
-	* mini-gmp/mini-gmp.c: Put untested functions under
-	ENABLE_UNTESTED_FUNCTIONS.
-
 	* mpn/arm/v6/sqr_basecase.asm: Simplify n=4 code.
 
 2012-05-05 Marco Bodrato <bodrato at mail.dm.unipi.it>
diff -r 9ff994ee2cc6 -r a162f61e82d5 mini-gmp/mini-gmp.c
--- a/mini-gmp/mini-gmp.c	Mon May 07 08:31:11 2012 +0200
+++ b/mini-gmp/mini-gmp.c	Mon May 07 23:51:57 2012 +0200
@@ -21,22 +21,17 @@
 You should have received a copy of the GNU Lesser General Public License
 along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.  */
 
-/* NOTE: All functions in this file which are not declared in mini-gmp.h are
-   internal, and are not intended to be compatible neither with GMP nor with
-   future versions of mini-gmp. */
+/* NOTE: All functions in this file which are not declared in
+   mini-gmp.h are internal, and are not intended to be compatible
+   neither with GMP nor with future versions of mini-gmp. */
 
 /* Much of the material copied from GMP files, including: gmp-impl.h,
    longlong.h, mpn/generic/add_n.c, mpn/generic/addmul_1.c,
-   mpn/generic/lshift.c, mpn/generic/mul_1.c, mpn/generic/mul_basecase.c,
-   mpn/generic/rshift.c, mpn/generic/sbpi1_div_qr.c, mpn/generic/sub_n.c,
+   mpn/generic/lshift.c, mpn/generic/mul_1.c,
+   mpn/generic/mul_basecase.c, mpn/generic/rshift.c,
+   mpn/generic/sbpi1_div_qr.c, mpn/generic/sub_n.c,
    mpn/generic/submul_1.c. */
 
-/* CAUTION: Many functions herein are not covered by the testsuite, or else
-   covered poorly, and are therefore not unlikely to have bugs or to be
-   miscompiled without detection.  To enable untested functions, define
-   ENABLE_UNTESTED_FUNCTIONS to 1.  Please contribute better testing of
-   mini-gmp!  */
-
 #include <assert.h>
 #include <ctype.h>
 #include <limits.h>
@@ -574,13 +569,11 @@
   return rp[un - 1];
 }
 
-#if ENABLE_UNTESTED_FUNCTIONS
 void
 mpn_mul_n (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t n)
 {
   mpn_mul (rp, ap, n, bp, n);
 }
-#endif
 
 void
 mpn_sqr (mp_ptr rp, mp_srcptr ap, mp_size_t n)
@@ -1187,7 +1180,6 @@
   return sn;
 }
 
-#if ENABLE_UNTESTED_FUNCTIONS
 size_t
 mpn_get_str (unsigned char *sp, int base, mp_ptr up, mp_size_t un)
 {
@@ -1207,9 +1199,7 @@
       return mpn_get_str_other (sp, base, &info, up, un);
     }
 }
-#endif
-
-#if ENABLE_UNTESTED_FUNCTIONS
+
 static mp_size_t
 mpn_set_str_bits (mp_ptr rp, const unsigned char *sp, size_t sn,
 		  unsigned bits)
@@ -1240,9 +1230,7 @@
   rn = mpn_normalized_size (rp, rn);
   return rn;
 }
-#endif
-
-#if ENABLE_UNTESTED_FUNCTIONS
+
 static mp_size_t
 mpn_set_str_other (mp_ptr rp, const unsigned char *sp, size_t sn,
 		   mp_limb_t b, const struct mpn_base_info *info)
@@ -1279,9 +1267,7 @@
 
   return rn;
 }
-#endif
-
-#if ENABLE_UNTESTED_FUNCTIONS
+
 mp_size_t
 mpn_set_str (mp_ptr rp, const unsigned char *sp, size_t sn, int base)
 {
@@ -1301,7 +1287,7 @@
       return mpn_set_str_other (rp, sp, sn, base, &info);
     }
 }
-#endif
+
 
 /* MPZ interface */
 void
@@ -1400,14 +1386,12 @@
     }
 }
 
-#if ENABLE_UNTESTED_FUNCTIONS
 void
 mpz_init_set_si (mpz_t r, signed long int x)
 {
   mpz_init (r);
   mpz_set_si (r, x);
 }
-#endif
 
 void
 mpz_init_set_ui (mpz_t r, unsigned long int x)
@@ -1423,7 +1407,6 @@
   mpz_set (r, x);
 }
 
-#if ENABLE_UNTESTED_FUNCTIONS
 int
 mpz_fits_slong_p (const mpz_t u)
 {
@@ -1438,9 +1421,7 @@
   else
     return 0;
 }
-#endif
-
-#if ENABLE_UNTESTED_FUNCTIONS
+
 int
 mpz_fits_ulong_p (const mpz_t u)
 {
@@ -1448,9 +1429,7 @@
 
   return us == 0 || us == 1;
 }
-#endif
-
-#if ENABLE_UNTESTED_FUNCTIONS
+
 long int
 mpz_get_si (const mpz_t u)
 {
@@ -1463,25 +1442,19 @@
   else
     return 0;
 }
-#endif
-
-#if ENABLE_UNTESTED_FUNCTIONS
+
 unsigned long int
 mpz_get_ui (const mpz_t u)
 {
   return u->_mp_size == 0 ? 0 : u->_mp_d[0];
 }
-#endif
-
-#if ENABLE_UNTESTED_FUNCTIONS
+
 size_t
 mpz_size (const mpz_t u)
 {
   return GMP_ABS (u->_mp_size);
 }
-#endif
-
-#if ENABLE_UNTESTED_FUNCTIONS
+
 mp_limb_t
 mpz_getlimbn (const mpz_t u, mp_size_t n)
 {
@@ -1490,10 +1463,8 @@
   else
     return 0;
 }
-#endif
 
 
-#if ENABLE_UNTESTED_FUNCTIONS
 /* Conversions and comparison to double. */
 void
 mpz_set_d (mpz_t r, double x)
@@ -1548,18 +1519,14 @@
 
   r->_mp_size = sign ? - rn : rn;
 }
-#endif
-
-#if ENABLE_UNTESTED_FUNCTIONS
+
 void
 mpz_init_set_d (mpz_t r, double x)
 {
   mpz_init (r);
   mpz_set_d (r, x);
 }
-#endif
-
-#if ENABLE_UNTESTED_FUNCTIONS
+
 double
 mpz_get_d (const mpz_t u)
 {
@@ -1581,9 +1548,7 @@
 
   return x;
 }
-#endif
-
-#if ENABLE_UNTESTED_FUNCTIONS
+
 int
 mpz_cmp_d (const mpz_t x, double d)
 {
@@ -1643,7 +1608,6 @@
   else
     return 0;
 }
-#endif
 
 
 /* MPN comparisons and the like. */
@@ -1857,7 +1821,6 @@
     r->_mp_size = mpz_abs_sub_ui (r, a, b);
 }
 
-#if ENABLE_UNTESTED_FUNCTIONS
 void
 mpz_ui_sub (mpz_t r, unsigned long a, const mpz_t b)
 {
@@ -1866,7 +1829,6 @@
   else
     r->_mp_size = -mpz_abs_sub_ui (r, b, a);
 }
-#endif
 
 static mp_size_t
 mpz_abs_add (mpz_t r, const mpz_t a, const mpz_t b)
@@ -1942,7 +1904,6 @@
 
 
 /* MPZ multiplication */
-#if ENABLE_UNTESTED_FUNCTIONS
 void
 mpz_mul_si (mpz_t r, const mpz_t u, long int v)
 {
@@ -1971,8 +1932,6 @@
   mpz_swap (r, t);
   mpz_clear (t);
 }
-#endif
-
 
 void
 mpz_mul_ui (mpz_t r, const mpz_t u, unsigned long int v)
@@ -2192,21 +2151,17 @@
     }
 }
 
-#if ENABLE_UNTESTED_FUNCTIONS
 void
 mpz_cdiv_qr (mpz_t q, mpz_t r, const mpz_t n, const mpz_t d)
 {
   mpz_div_qr (q, r, n, d, DIV_CEIL);
 }
-#endif
-
-#if ENABLE_UNTESTED_FUNCTIONS
+
 void
 mpz_fdiv_qr (mpz_t q, mpz_t r, const mpz_t n, const mpz_t d)
 {
   mpz_div_qr (q, r, n, d, DIV_FLOOR);
 }
-#endif
 
 void
 mpz_tdiv_qr (mpz_t q, mpz_t r, const mpz_t n, const mpz_t d)
@@ -2214,21 +2169,17 @@
   mpz_div_qr (q, r, n, d, DIV_TRUNC);
 }
 
-#if ENABLE_UNTESTED_FUNCTIONS


More information about the gmp-commit mailing list