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

mercurial at gmplib.org mercurial at gmplib.org
Wed Oct 14 18:34:51 UTC 2015


details:   /var/hg/gmp/rev/069813bba9be
changeset: 16861:069813bba9be
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Wed Oct 14 19:57:52 2015 +0200
description:
(tune_mu_bdiv): Start at measured BDIV_DC_ thresholds.

details:   /var/hg/gmp/rev/325d81590708
changeset: 16862:325d81590708
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Wed Oct 14 20:22:01 2015 +0200
description:
Simplify, add ASSERT.

details:   /var/hg/gmp/rev/0d5edd1e6454
changeset: 16863:0d5edd1e6454
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Wed Oct 14 20:23:09 2015 +0200
description:
Fix comment type and add a comment.

details:   /var/hg/gmp/rev/0306bfce2aa7
changeset: 16864:0306bfce2aa7
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Wed Oct 14 20:23:36 2015 +0200
description:
Add a copyright year.

details:   /var/hg/gmp/rev/412753f91e70
changeset: 16865:412753f91e70
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Wed Oct 14 20:24:54 2015 +0200
description:
Add 'compile' and 'test-driver'.

details:   /var/hg/gmp/rev/fc853aa17c93
changeset: 16866:fc853aa17c93
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Wed Oct 14 20:30:13 2015 +0200
description:
Move things before addmul_1 to reduce register pressure.

details:   /var/hg/gmp/rev/b6c063d715ba
changeset: 16867:b6c063d715ba
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Wed Oct 14 20:32:56 2015 +0200
description:
Fix a comment typo.

details:   /var/hg/gmp/rev/c1c6db98fadf
changeset: 16868:c1c6db98fadf
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Wed Oct 14 20:34:24 2015 +0200
description:
(main): Clear out a variable.

details:   /var/hg/gmp/rev/e0aa36a8ffe8
changeset: 16869:e0aa36a8ffe8
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Wed Oct 14 20:34:47 2015 +0200
description:
ChangeLog

diffstat:

 .hgignore                    |   2 ++
 ChangeLog                    |  14 ++++++++++++++
 acinclude.m4                 |   8 ++++++--
 config.guess                 |   2 +-
 demos/pexpr.c                |   4 +++-
 mpn/generic/mu_bdiv_q.c      |  10 ++++++----
 mpn/generic/mu_bdiv_qr.c     |  37 ++++++++++++++-----------------------
 mpn/generic/sqrlo_basecase.c |   6 +++---
 tune/tuneup.c                |   4 ++--
 9 files changed, 51 insertions(+), 36 deletions(-)

diffs (232 lines):

diff -r 15ed2cbb2b45 -r e0aa36a8ffe8 .hgignore
--- a/.hgignore	Wed Oct 14 19:47:08 2015 +0200
+++ b/.hgignore	Wed Oct 14 20:34:47 2015 +0200
@@ -23,6 +23,8 @@
 ^install-sh
 ^missing
 ^ylwrap
+^compile
+^test-driver
 
 ^gmp-mparam\.h
 
diff -r 15ed2cbb2b45 -r e0aa36a8ffe8 ChangeLog
--- a/ChangeLog	Wed Oct 14 19:47:08 2015 +0200
+++ b/ChangeLog	Wed Oct 14 20:34:47 2015 +0200
@@ -1,3 +1,17 @@
+2015-10-14  Torbjörn Granlund  <torbjorng at google.com>
+
+	* demos/pexpr.c (main): Clear out a variable.
+
+	* mpn/generic/sqrlo_basecase.c: Move things before addmul_1 to reduce
+	register pressure.
+
+	* .hgignore: Add 'compile' and 'test-driver'.
+
+	* mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Simplify, add ASSERT.
+	* mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Likewise.
+
+	* tune/tuneup.c (tune_mu_bdiv): Start at measured BDIV_DC_ thresholds.
+
 2015-10-13 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* mpf/clears.c, mpf/inits.c, mpq/clears.c, mpq/inits.c,
diff -r 15ed2cbb2b45 -r e0aa36a8ffe8 acinclude.m4
--- a/acinclude.m4	Wed Oct 14 19:47:08 2015 +0200
+++ b/acinclude.m4	Wed Oct 14 20:34:47 2015 +0200
@@ -1,7 +1,8 @@
 dnl  GMP specific autoconf macros
 
 
-dnl  Copyright 2000-2006, 2009, 2011, 2013, 2014 Free Software Foundation, Inc.
+dnl  Copyright 2000-2006, 2009, 2011, 2013, 2014, 2015 Free Software
+dnl  Foundation, Inc.
 dnl
 dnl  This file is part of the GNU MP Library.
 dnl
@@ -1663,8 +1664,11 @@
 
 
 dnl Checks whether the stack can be marked nonexecutable by passing an option
-dnl to the C-compiler when acting on .s files. Appends that option to ASFLAGS.
+dnl to the C-compiler when acting on .s files. Appends that option to ASMFLAGS.
 dnl This macro is adapted from one found in GLIBC-2.3.5.
+dnl FIXME: This test looks broken. It tests that a file with .note.GNU-stack...
+dnl can be compiled/assembled with -Wa,--noexecstack.  It does not determine
+dnl if that command-line option has any effect on general asm code.
 AC_DEFUN([CL_AS_NOEXECSTACK],[
 dnl AC_REQUIRE([AC_PROG_CC]) GMP uses something else
 AC_CACHE_CHECK([whether assembler supports --noexecstack option],
diff -r 15ed2cbb2b45 -r e0aa36a8ffe8 config.guess
--- a/config.guess	Wed Oct 14 19:47:08 2015 +0200
+++ b/config.guess	Wed Oct 14 20:34:47 2015 +0200
@@ -932,7 +932,7 @@
     /* If our cpuid-based CPU identification thinks this is a 32-bit CPU but
        cpuid claims AMD64 capabilities, then revert to the generic "x86_64".
        This is of course wrong, but it can happen in some virtualisers and
-       emulators, so this workaround allows for successful 64-bit builds.  */
+       emulators, and this workaround allows for successful 64-bit builds.  */
     modelstr = "x86_64";
   else if (cpu_avx && ! (cpuid_avx && cpuid_osxsave))
     /* For CPUs nominally capable of executing AVX, append "noavx" when not
diff -r 15ed2cbb2b45 -r e0aa36a8ffe8 demos/pexpr.c
--- a/demos/pexpr.c	Wed Oct 14 19:47:08 2015 +0200
+++ b/demos/pexpr.c	Wed Oct 14 20:34:47 2015 +0200
@@ -1,7 +1,7 @@
 /* Program for computing integer expressions using the GNU Multiple Precision
    Arithmetic Library.
 
-Copyright 1997, 1999-2002, 2005, 2008, 2012 Free Software Foundation, Inc.
+Copyright 1997, 1999-2002, 2005, 2008, 2012, 2015 Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
@@ -480,6 +480,8 @@
       free_expr (e);
     }
 
+  mpz_clear (r);
+
   exit (errcode);
 }
 
diff -r 15ed2cbb2b45 -r e0aa36a8ffe8 mpn/generic/mu_bdiv_q.c
--- a/mpn/generic/mu_bdiv_q.c	Wed Oct 14 19:47:08 2015 +0200
+++ b/mpn/generic/mu_bdiv_q.c	Wed Oct 14 20:34:47 2015 +0200
@@ -231,6 +231,8 @@
   mp_size_t qn, in, tn, itch_binvert, itch_out, itches;
   mp_size_t b;
 
+  ASSERT_ALWAYS (DC_BDIV_Q_THRESHOLD < MU_BDIV_Q_THRESHOLD);
+
   qn = nn;
 
   if (qn > dn)
@@ -247,9 +249,7 @@
 	  tn = mpn_mulmod_bnm1_next_size (dn);
 	  itch_out = mpn_mulmod_bnm1_itch (tn, dn, in);
 	}
-      itch_binvert = mpn_binvert_itch (in);
       itches = dn + tn + itch_out;
-      return in + MAX (itches, itch_binvert);
     }
   else
     {
@@ -264,8 +264,10 @@
 	  tn = mpn_mulmod_bnm1_next_size (qn);
 	  itch_out = mpn_mulmod_bnm1_itch (tn, qn, in);
 	}
-      itch_binvert = mpn_binvert_itch (in);
       itches = tn + itch_out;
-      return in + MAX (itches, itch_binvert);
     }
+
+  itch_binvert = mpn_binvert_itch (in);
+  return in + MAX (itches, itch_binvert);
 }
+
diff -r 15ed2cbb2b45 -r e0aa36a8ffe8 mpn/generic/mu_bdiv_qr.c
--- a/mpn/generic/mu_bdiv_qr.c	Wed Oct 14 19:47:08 2015 +0200
+++ b/mpn/generic/mu_bdiv_qr.c	Wed Oct 14 20:34:47 2015 +0200
@@ -249,40 +249,31 @@
   mp_size_t qn, in, tn, itch_binvert, itch_out, itches;
   mp_size_t b;
 
+  ASSERT_ALWAYS (DC_BDIV_Q_THRESHOLD < MU_BDIV_Q_THRESHOLD);
+
   qn = nn - dn;
 
   if (qn > dn)
     {
       b = (qn - 1) / dn + 1;	/* ceil(qn/dn), number of blocks */
       in = (qn - 1) / b + 1;	/* ceil(qn/b) = ceil(qn / ceil(qn/dn)) */
-      if (BELOW_THRESHOLD (in, MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD))
-	{
-	  tn = dn + in;
-	  itch_out = 0;
-	}
-      else
-	{
-	  tn = mpn_mulmod_bnm1_next_size (dn);
-	  itch_out = mpn_mulmod_bnm1_itch (tn, dn, in);
-	}
-      itch_binvert = mpn_binvert_itch (in);
-      itches = tn + itch_out;
-      return in + MAX (itches, itch_binvert);
     }
   else
     {
       in = qn - (qn >> 1);
-      if (BELOW_THRESHOLD (in, MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD))
-	{
-	  tn = dn + in;
-	  itch_out = 0;
-	}
-      else
-	{
-	  tn = mpn_mulmod_bnm1_next_size (dn);
-	  itch_out = mpn_mulmod_bnm1_itch (tn, dn, in);
-	}
     }
+
+  if (BELOW_THRESHOLD (in, MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD))
+    {
+      tn = dn + in;
+      itch_out = 0;
+    }
+  else
+    {
+      tn = mpn_mulmod_bnm1_next_size (dn);
+      itch_out = mpn_mulmod_bnm1_itch (tn, dn, in);
+    }
+
   itch_binvert = mpn_binvert_itch (in);
   itches = tn + itch_out;
   return in + MAX (itches, itch_binvert);
diff -r 15ed2cbb2b45 -r e0aa36a8ffe8 mpn/generic/sqrlo_basecase.c
--- a/mpn/generic/sqrlo_basecase.c	Wed Oct 14 19:47:08 2015 +0200
+++ b/mpn/generic/sqrlo_basecase.c	Wed Oct 14 20:34:47 2015 +0200
@@ -141,7 +141,7 @@
 #else
 	      hi += lo >> GMP_NAIL_BITS;
 	      rp[1] = hi & GMP_NUMB_MASK;
-	      rp[2] = (hi1 + ul1 * ul1 + (hi >> GMP_NUMB_BITS)) & GMP_NUMB_MASK;	      
+	      rp[2] = (hi1 + ul1 * ul1 + (hi >> GMP_NUMB_BITS)) & GMP_NUMB_MASK;
 #endif
 	    }
 #endif
@@ -161,11 +161,11 @@
       {
 	mp_limb_t cy;
 
-	cy = mpn_mul_1 (tp, up + 1, n - 1, ul) + ul * up[n];
+	cy = ul * up[n] + mpn_mul_1 (tp, up + 1, n - 1, ul);
 	for (i = 1; 2 * i + 1 < n; ++i)
 	  {
 	    ul = up[i];
-	    cy += mpn_addmul_1 (tp + 2 * i, up + i + 1, n - 2 * i - 1, ul) + ul * up[n - i];
+	    cy += ul * up[n - i] + mpn_addmul_1 (tp + 2 * i, up + i + 1, n - 2 * i - 1, ul);
 	  }
 	tp [n-1] = (cy + ((n & 1)?up[i] * up[i + 1]:0)) & GMP_NUMB_MASK;
       }
diff -r 15ed2cbb2b45 -r e0aa36a8ffe8 tune/tuneup.c
--- a/tune/tuneup.c	Wed Oct 14 19:47:08 2015 +0200
+++ b/tune/tuneup.c	Wed Oct 14 20:34:47 2015 +0200
@@ -1720,7 +1720,7 @@
     param.name = "MU_BDIV_QR_THRESHOLD";
     param.function = speed_mpn_dcpi1_bdiv_qr;
     param.function2 = speed_mpn_mu_bdiv_qr;
-    param.min_size = mul_toom22_threshold;
+    param.min_size = dc_bdiv_qr_threshold;
     param.max_size = 5000;
     param.step_factor = 0.02;
     one (&mu_bdiv_qr_threshold, &param);
@@ -1730,7 +1730,7 @@
     param.name = "MU_BDIV_Q_THRESHOLD";
     param.function = speed_mpn_dcpi1_bdiv_q;
     param.function2 = speed_mpn_mu_bdiv_q;
-    param.min_size = mul_toom22_threshold;
+    param.min_size = dc_bdiv_q_threshold;
     param.max_size = 5000;
     param.step_factor = 0.02;
     one (&mu_bdiv_q_threshold, &param);


More information about the gmp-commit mailing list