[Gmp-commit] /var/hg/gmp-5.0: Merging various changes from mainline repo.

mercurial at gmplib.org mercurial at gmplib.org
Tue Jan 17 11:17:47 CET 2012


details:   /var/hg/gmp-5.0/rev/3a9ad2babb85
changeset: 13494:3a9ad2babb85
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Jan 17 11:17:41 2012 +0100
description:
Merging various changes from mainline repo.

diffstat:

 ChangeLog              |   49 +++++++++++++++
 mp_get_fns.c           |    2 +-
 mp_set_fns.c           |    2 +-
 mpf/cmp.c              |    2 +-
 mpf/cmp_si.c           |    2 +-
 mpf/cmp_ui.c           |    2 +-
 mpf/fits_s.h           |    2 +-
 mpf/fits_u.h           |    2 +-
 mpf/get_dfl_prec.c     |    2 +-
 mpf/get_prc.c          |    2 +-
 mpf/get_si.c           |    2 +-
 mpf/get_ui.c           |    2 +-
 mpf/int_p.c            |    2 +-
 mpf/set_dfl_prec.c     |    2 +-
 mpf/set_prc_raw.c      |    2 +-
 mpf/size.c             |    2 +-
 mpf/swap.c             |    2 +-
 mpn/generic/powm_sec.c |   17 +---
 mpq/equal.c            |    2 +-
 mpq/swap.c             |    2 +-
 mpz/cmp.c              |    2 +-
 mpz/cmp_si.c           |    2 +-
 mpz/cmp_ui.c           |    2 +-
 mpz/cmpabs.c           |    2 +-
 mpz/cmpabs_ui.c        |    2 +-
 mpz/cong_2exp.c        |    2 +-
 mpz/divis_2exp.c       |    2 +-
 mpz/fits_s.h           |    2 +-
 mpz/get_si.c           |    2 +-
 mpz/hamdist.c          |  151 ++++++++++++++++++++++++------------------------
 mpz/scan0.c            |    2 +-
 mpz/scan1.c            |    2 +-
 mpz/sizeinbase.c       |    2 +-
 mpz/swap.c             |    2 +-
 mpz/tstbit.c           |    2 +-
 35 files changed, 162 insertions(+), 119 deletions(-)

diffs (truncated from 754 to 300 lines):

diff -r 2b7b8ada8a20 -r 3a9ad2babb85 ChangeLog
--- a/ChangeLog	Mon Jan 16 13:47:56 2012 +0100
+++ b/ChangeLog	Tue Jan 17 11:17:41 2012 +0100
@@ -1,3 +1,7 @@
+2011-12-30  Torbjorn Granlund  <tege at gmplib.org>
+
+	* mpz/hamdist.c: Fix typo in a return statement.
+
 2011-12-07  Torbjorn Granlund  <tege at gmplib.org>
 
 	* configure.in: Fix typo making HAVE_NATIVE_mpn_X fail for fat
@@ -24,6 +28,15 @@
 	* configure.in: Split x86 CPUs into more subtypes for more accurate
 	passing of gcc flags.
 
+2011-11-15  Torbjorn Granlund  <tege at gmplib.org>
+
+	* mpn/generic/powm_sec.c (mpn_local_sqr): Remove forgotten TMP_* calls.
+	(redcify): Likewise.
+	(mpn_powm_sec): Likewise.
+
+	* mpn/generic/powm_sec.c (mpn_powm_sec): Use mpn_tabselect also in
+	initialisation.
+
 2011-10-04  Torbjorn Granlund  <tege at gmplib.org>
 
 	* doc/gmp.texi (Custom Allocation): Rephrase a paragraph.
@@ -164,6 +177,42 @@
 	* mpn/x86_64/atom/aors_n.asm: Don't rely on ZF after 'bt' insn.
 	Use 64-bit 'test' to support operands of 2^32 limbs and more.
 
+2010-11-10  Torbjorn Granlund  <tege at gmplib.org>
+
+	* mp_get_fns.c: Add a __GMP_NOTHROW for coherency with prototype.
+	* mp_set_fns.c: Likewise.
+	* mpf/cmp.c: Likewise.
+	* mpf/cmp_si.c: Likewise.
+	* mpf/cmp_ui.c: Likewise.
+	* mpf/fits_s.h: Likewise.
+	* mpf/fits_u.h: Likewise.
+	* mpf/get_dfl_prec.c: Likewise.
+	* mpf/get_prc.c: Likewise.
+	* mpf/get_si.c: Likewise.
+	* mpf/get_ui.c: Likewise.
+	* mpf/int_p.c: Likewise.
+	* mpf/set_dfl_prec.c: Likewise.
+	* mpf/set_prc_raw.c: Likewise.
+	* mpf/size.c: Likewise.
+	* mpf/swap.c: Likewise.
+	* mpq/equal.c: Likewise.
+	* mpq/swap.c: Likewise.
+	* mpz/cmp.c: Likewise.
+	* mpz/cmp_si.c: Likewise.
+	* mpz/cmp_ui.c: Likewise.
+	* mpz/cmpabs.c: Likewise.
+	* mpz/cmpabs_ui.c: Likewise.
+	* mpz/cong_2exp.c: Likewise.
+	* mpz/divis_2exp.c: Likewise.
+	* mpz/fits_s.h: Likewise.
+	* mpz/get_si.c: Likewise.
+	* mpz/hamdist.c: Likewise.
+	* mpz/scan0.c: Likewise.
+	* mpz/scan1.c: Likewise.
+	* mpz/sizeinbase.c: Likewise.
+	* mpz/swap.c: Likewise.
+	* mpz/tstbit.c: Likewise.
+
 2010-11-09  Torbjorn Granlund  <tege at gmplib.org>
 
 	* configure.in (AC_INIT): Amend bug reporting address with manual
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mp_get_fns.c
--- a/mp_get_fns.c	Mon Jan 16 13:47:56 2012 +0100
+++ b/mp_get_fns.c	Tue Jan 17 11:17:41 2012 +0100
@@ -24,7 +24,7 @@
 void
 mp_get_memory_functions (void *(**alloc_func) (size_t),
 			 void *(**realloc_func) (void *, size_t, size_t),
-			 void (**free_func) (void *, size_t))
+			 void (**free_func) (void *, size_t)) __GMP_NOTHROW
 {
   if (alloc_func != NULL)
     *alloc_func = __gmp_allocate_func;
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mp_set_fns.c
--- a/mp_set_fns.c	Mon Jan 16 13:47:56 2012 +0100
+++ b/mp_set_fns.c	Tue Jan 17 11:17:41 2012 +0100
@@ -24,7 +24,7 @@
 void
 mp_set_memory_functions (void *(*alloc_func) (size_t),
 			 void *(*realloc_func) (void *, size_t, size_t),
-			 void (*free_func) (void *, size_t))
+			 void (*free_func) (void *, size_t)) __GMP_NOTHROW
 {
   if (alloc_func == 0)
     alloc_func = __gmp_default_allocate;
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mpf/cmp.c
--- a/mpf/cmp.c	Mon Jan 16 13:47:56 2012 +0100
+++ b/mpf/cmp.c	Tue Jan 17 11:17:41 2012 +0100
@@ -21,7 +21,7 @@
 #include "gmp-impl.h"
 
 int
-mpf_cmp (mpf_srcptr u, mpf_srcptr v)
+mpf_cmp (mpf_srcptr u, mpf_srcptr v) __GMP_NOTHROW
 {
   mp_srcptr up, vp;
   mp_size_t usize, vsize;
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mpf/cmp_si.c
--- a/mpf/cmp_si.c	Mon Jan 16 13:47:56 2012 +0100
+++ b/mpf/cmp_si.c	Tue Jan 17 11:17:41 2012 +0100
@@ -22,7 +22,7 @@
 #include "gmp-impl.h"
 
 int
-mpf_cmp_si (mpf_srcptr u, long int vval)
+mpf_cmp_si (mpf_srcptr u, long int vval) __GMP_NOTHROW
 {
   mp_srcptr up;
   mp_size_t usize;
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mpf/cmp_ui.c
--- a/mpf/cmp_ui.c	Mon Jan 16 13:47:56 2012 +0100
+++ b/mpf/cmp_ui.c	Tue Jan 17 11:17:41 2012 +0100
@@ -21,7 +21,7 @@
 #include "gmp-impl.h"
 
 int
-mpf_cmp_ui (mpf_srcptr u, unsigned long int vval)
+mpf_cmp_ui (mpf_srcptr u, unsigned long int vval) __GMP_NOTHROW
 {
   mp_srcptr up;
   mp_size_t usize;
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mpf/fits_s.h
--- a/mpf/fits_s.h	Mon Jan 16 13:47:56 2012 +0100
+++ b/mpf/fits_s.h	Tue Jan 17 11:17:41 2012 +0100
@@ -24,7 +24,7 @@
 /* Notice this is equivalent to mpz_set_f + mpz_fits_s*_p.  */
 
 int
-FUNCTION (mpf_srcptr f)
+FUNCTION (mpf_srcptr f) __GMP_NOTHROW
 {
   mp_size_t  fs, fn;
   mp_srcptr  fp;
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mpf/fits_u.h
--- a/mpf/fits_u.h	Mon Jan 16 13:47:56 2012 +0100
+++ b/mpf/fits_u.h	Tue Jan 17 11:17:41 2012 +0100
@@ -24,7 +24,7 @@
 /* Notice this is equivalent to mpz_set_f + mpz_fits_u*_p.  */
 
 int
-FUNCTION (mpf_srcptr f)
+FUNCTION (mpf_srcptr f) __GMP_NOTHROW
 {
   mp_size_t  fn;
   mp_srcptr  fp;
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mpf/get_dfl_prec.c
--- a/mpf/get_dfl_prec.c	Mon Jan 16 13:47:56 2012 +0100
+++ b/mpf/get_dfl_prec.c	Tue Jan 17 11:17:41 2012 +0100
@@ -22,7 +22,7 @@
 
 
 mp_bitcnt_t
-mpf_get_default_prec (void)
+mpf_get_default_prec (void) __GMP_NOTHROW
 {
   return __GMPF_PREC_TO_BITS (__gmp_default_fp_limb_precision);
 }
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mpf/get_prc.c
--- a/mpf/get_prc.c	Mon Jan 16 13:47:56 2012 +0100
+++ b/mpf/get_prc.c	Tue Jan 17 11:17:41 2012 +0100
@@ -21,7 +21,7 @@
 #include "gmp-impl.h"
 
 mp_bitcnt_t
-mpf_get_prec (mpf_srcptr x)
+mpf_get_prec (mpf_srcptr x) __GMP_NOTHROW
 {
   return __GMPF_PREC_TO_BITS (x->_mp_prec);
 }
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mpf/get_si.c
--- a/mpf/get_si.c	Mon Jan 16 13:47:56 2012 +0100
+++ b/mpf/get_si.c	Tue Jan 17 11:17:41 2012 +0100
@@ -40,7 +40,7 @@
    -0x80000000 instead of the desired 0.  */
 
 long
-mpf_get_si (mpf_srcptr f)
+mpf_get_si (mpf_srcptr f) __GMP_NOTHROW
 {
   mp_exp_t exp;
   mp_size_t size, abs_size;
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mpf/get_ui.c
--- a/mpf/get_ui.c	Mon Jan 16 13:47:56 2012 +0100
+++ b/mpf/get_ui.c	Tue Jan 17 11:17:41 2012 +0100
@@ -61,7 +61,7 @@
    tested first we ensure MP_EXP_T_MIN doesn't reach exp>1.  */
 
 unsigned long
-mpf_get_ui (mpf_srcptr f)
+mpf_get_ui (mpf_srcptr f) __GMP_NOTHROW
 {
   mp_size_t size;
   mp_exp_t exp;
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mpf/int_p.c
--- a/mpf/int_p.c	Mon Jan 16 13:47:56 2012 +0100
+++ b/mpf/int_p.c	Tue Jan 17 11:17:41 2012 +0100
@@ -23,7 +23,7 @@
 
 
 int
-mpf_integer_p (mpf_srcptr f)
+mpf_integer_p (mpf_srcptr f) __GMP_NOTHROW
 {
   mp_srcptr ptr;
   mp_exp_t exp;
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mpf/set_dfl_prec.c
--- a/mpf/set_dfl_prec.c	Mon Jan 16 13:47:56 2012 +0100
+++ b/mpf/set_dfl_prec.c	Tue Jan 17 11:17:41 2012 +0100
@@ -23,7 +23,7 @@
 mp_size_t __gmp_default_fp_limb_precision = __GMPF_BITS_TO_PREC (53);
 
 void
-mpf_set_default_prec (mp_bitcnt_t prec_in_bits)
+mpf_set_default_prec (mp_bitcnt_t prec_in_bits) __GMP_NOTHROW
 {
   __gmp_default_fp_limb_precision = __GMPF_BITS_TO_PREC (prec_in_bits);
 }
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mpf/set_prc_raw.c
--- a/mpf/set_prc_raw.c	Mon Jan 16 13:47:56 2012 +0100
+++ b/mpf/set_prc_raw.c	Tue Jan 17 11:17:41 2012 +0100
@@ -23,7 +23,7 @@
 #include "gmp-impl.h"
 
 void
-mpf_set_prec_raw (mpf_ptr x, mp_bitcnt_t prec_in_bits)
+mpf_set_prec_raw (mpf_ptr x, mp_bitcnt_t prec_in_bits) __GMP_NOTHROW
 {
   x->_mp_prec = __GMPF_BITS_TO_PREC (prec_in_bits);
 }
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mpf/size.c
--- a/mpf/size.c	Mon Jan 16 13:47:56 2012 +0100
+++ b/mpf/size.c	Tue Jan 17 11:17:41 2012 +0100
@@ -22,7 +22,7 @@
 #include "gmp-impl.h"
 
 size_t
-mpf_size (mpf_srcptr f)
+mpf_size (mpf_srcptr f) __GMP_NOTHROW
 {
   return __GMP_ABS (f->_mp_size);
 }
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mpf/swap.c
--- a/mpf/swap.c	Mon Jan 16 13:47:56 2012 +0100
+++ b/mpf/swap.c	Tue Jan 17 11:17:41 2012 +0100
@@ -21,7 +21,7 @@
 #include "gmp-impl.h"
 
 void
-mpf_swap (mpf_ptr u, mpf_ptr v)
+mpf_swap (mpf_ptr u, mpf_ptr v) __GMP_NOTHROW
 {
   mp_ptr up, vp;
   mp_size_t usize, vsize;
diff -r 2b7b8ada8a20 -r 3a9ad2babb85 mpn/generic/powm_sec.c
--- a/mpn/generic/powm_sec.c	Mon Jan 16 13:47:56 2012 +0100
+++ b/mpn/generic/powm_sec.c	Tue Jan 17 11:17:41 2012 +0100
@@ -7,7 +7,7 @@
    SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES.  IN FACT, IT IS ALMOST
    GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
 
-Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
+Copyright 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -125,8 +125,6 @@
   if (n > 1)
     {
       mp_limb_t cy;
-      TMP_DECL;
-      TMP_MARK;
 
       cy = mpn_mul_1 (tp, up + 1, n - 1, up[0]);
       tp[n - 1] = cy;
@@ -148,8 +146,6 @@
 #endif
 	rp[2 * n - 1] += cy;
       }
-
-      TMP_FREE;
     }
 }
 #endif
@@ -196,15 +192,12 @@
 redcify (mp_ptr rp, mp_srcptr up, mp_size_t un, mp_srcptr mp, mp_size_t n, mp_ptr tp)
 {
   mp_ptr qp;
-  TMP_DECL;
-  TMP_MARK;
 
   qp = tp + un + n;


More information about the gmp-commit mailing list