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

mercurial at gmplib.org mercurial at gmplib.org
Sat May 5 17:36:47 CEST 2012


details:   /var/hg/gmp/rev/5b62c0d1f43b
changeset: 14940:5b62c0d1f43b
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat May 05 17:18:57 2012 +0200
description:
mpn/generic/invert.c: Mark a branch UNLIKELY.

details:   /var/hg/gmp/rev/3fa2daeb339e
changeset: 14941:3fa2daeb339e
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat May 05 17:21:22 2012 +0200
description:
tune/tuneup.c (tune_fac_u): Update DSC_THRESHOLD minimum.

details:   /var/hg/gmp/rev/14befdcbc953
changeset: 14942:14befdcbc953
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat May 05 17:27:58 2012 +0200
description:
gmp-impl.h (FAC_???_THRESHOLD): Update default values.

details:   /var/hg/gmp/rev/0ff9ec48c13d
changeset: 14943:0ff9ec48c13d
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat May 05 17:36:33 2012 +0200
description:
gmp-impl.h (ABOVE_THRESHOLD): New definition with __builtin_constant_p.

diffstat:

 ChangeLog            |   7 +++++++
 gmp-impl.h           |  11 +++++++++--
 mpn/generic/invert.c |   4 ++--
 tune/tuneup.c        |   2 +-
 4 files changed, 19 insertions(+), 5 deletions(-)

diffs (82 lines):

diff -r df6a9af003fe -r 0ff9ec48c13d ChangeLog
--- a/ChangeLog	Fri May 04 23:09:27 2012 +0200
+++ b/ChangeLog	Sat May 05 17:36:33 2012 +0200
@@ -1,3 +1,10 @@
+2012-05-05 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* mpn/generic/invert.c: Mark a branch UNLIKELY.
+	* tune/tuneup.c (tune_fac_u): Update DSC_THRESHOLD minimum.
+	* gmp-impl.h (FAC_???_THRESHOLD): Update default values.
+	(ABOVE_THRESHOLD): New definition with __builtin_constant_p.
+
 2012-05-04  Torbjorn Granlund  <tege at gmplib.org>
 
 	* tune/tuneup.c: Measure POWM_SEC_TABLE after the REDC thresholds.
diff -r df6a9af003fe -r 0ff9ec48c13d gmp-impl.h
--- a/gmp-impl.h	Fri May 04 23:09:27 2012 +0200
+++ b/gmp-impl.h	Sat May 05 17:36:33 2012 +0200
@@ -1256,10 +1256,17 @@
    be compile-time constants, so the compiler should be able to eliminate
    the code for the unwanted algorithm.  */
 
+#if ! defined (__GNUC__) || __GNUC__ < 2
 #define ABOVE_THRESHOLD(size,thresh)					\
   ((thresh) == 0							\
    || ((thresh) != MP_SIZE_T_MAX					\
        && (size) >= (thresh)))
+#else
+#define ABOVE_THRESHOLD(size,thresh)					\
+  ((__builtin_constant_p (thresh) && (thresh) == 0)			\
+   || (!(__builtin_constant_p (thresh) && (thresh) == MP_SIZE_T_MAX)	\
+       && (size) >= (thresh)))
+#endif
 #define BELOW_THRESHOLD(size,thresh)  (! ABOVE_THRESHOLD (size, thresh))
 
 #define MPN_TOOM22_MUL_MINSIZE    4
@@ -2214,11 +2221,11 @@
 #endif
 
 #ifndef FAC_ODD_THRESHOLD
-#define FAC_ODD_THRESHOLD   100
+#define FAC_ODD_THRESHOLD    35
 #endif
 
 #ifndef FAC_DSC_THRESHOLD
-#define FAC_DSC_THRESHOLD   300
+#define FAC_DSC_THRESHOLD   400
 #endif
 
 /* Return non-zero if xp,xsize and yp,ysize overlap.
diff -r df6a9af003fe -r 0ff9ec48c13d mpn/generic/invert.c
--- a/mpn/generic/invert.c	Fri May 04 23:09:27 2012 +0200
+++ b/mpn/generic/invert.c	Sat May 05 17:36:33 2012 +0200
@@ -6,7 +6,7 @@
    SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES.  IN FACT, IT IS ALMOST
    GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
 
-Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+Copyright (C) 2007, 2009, 2010, 2012 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -67,7 +67,7 @@
       ASSERT ( mpn_invert_itch (n) >= mpn_invertappr_itch (n) );
       e = mpn_ni_invertappr (ip, dp, n, scratch);
 
-      if (e) { /* Assume the error can only be "0" (no error) or "1". */
+      if (UNLIKELY (e)) { /* Assume the error can only be "0" (no error) or "1". */
 	/* Code to detect and correct the "off by one" approximation. */
 	mpn_mul_n (scratch, ip, dp, n);
 	ASSERT_NOCARRY (mpn_add_n (scratch + n, scratch + n, dp, n));
diff -r df6a9af003fe -r 0ff9ec48c13d tune/tuneup.c
--- a/tune/tuneup.c	Fri May 04 23:09:27 2012 +0200
+++ b/tune/tuneup.c	Sat May 05 17:36:33 2012 +0200
@@ -2642,7 +2642,7 @@
   param.function = speed_mpz_fac_ui_tune;
 
   param.name = "FAC_DSC_THRESHOLD";
-  param.min_size = 25;
+  param.min_size = 26;
   param.max_size = FAC_DSC_THRESHOLD_LIMIT;
   one (&fac_dsc_threshold, &param);
 


More information about the gmp-commit mailing list