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

mercurial at gmplib.org mercurial at gmplib.org
Sat Dec 15 16:30:35 CET 2012


details:   /var/hg/gmp/rev/78f259ea7b8f
changeset: 15186:78f259ea7b8f
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Dec 15 16:23:06 2012 +0100
description:
tests/mpn/toom-sqr-shared.h: skip initializations when the test is skipped.

details:   /var/hg/gmp/rev/54f55df7eb75
changeset: 15187:54f55df7eb75
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Dec 15 16:24:08 2012 +0100
description:
Indent.

details:   /var/hg/gmp/rev/b7ecf0241930
changeset: 15188:b7ecf0241930
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Dec 15 16:27:32 2012 +0100
description:
Changelog

details:   /var/hg/gmp/rev/5eb73e909274
changeset: 15189:5eb73e909274
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Dec 15 16:28:11 2012 +0100
description:
Retune

diffstat:

 ChangeLog                        |    4 +
 mpn/x86_64/coreisbr/gmp-mparam.h |    4 +-
 tests/mpn/toom-sqr-shared.h      |  122 +++++++++++++++++++-------------------
 3 files changed, 68 insertions(+), 62 deletions(-)

diffs (161 lines):

diff -r 6d69b7a3afe5 -r 5eb73e909274 ChangeLog
--- a/ChangeLog	Sat Dec 15 13:28:10 2012 +0100
+++ b/ChangeLog	Sat Dec 15 16:28:11 2012 +0100
@@ -1,3 +1,7 @@
+2012-12-06 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* tests/mpn/toom-sqr-shared.h: Skip ALLOCs if the test is skipped.
+
 2012-12-13  Torbjorn Granlund  <tege at gmplib.org>
 
 	* Version 5.1.0 released.
diff -r 6d69b7a3afe5 -r 5eb73e909274 mpn/x86_64/coreisbr/gmp-mparam.h
--- a/mpn/x86_64/coreisbr/gmp-mparam.h	Sat Dec 15 13:28:10 2012 +0100
+++ b/mpn/x86_64/coreisbr/gmp-mparam.h	Sat Dec 15 16:28:11 2012 +0100
@@ -208,5 +208,5 @@
 #define SET_STR_DC_THRESHOLD              1204
 #define SET_STR_PRECOMPUTE_THRESHOLD      2251
 
-#define FAC_DSC_THRESHOLD                  732
-#define FAC_ODD_THRESHOLD                   44
+#define FAC_DSC_THRESHOLD                  800
+#define FAC_ODD_THRESHOLD                   28
diff -r 6d69b7a3afe5 -r 5eb73e909274 tests/mpn/toom-sqr-shared.h
--- a/tests/mpn/toom-sqr-shared.h	Sat Dec 15 13:28:10 2012 +0100
+++ b/tests/mpn/toom-sqr-shared.h	Sat Dec 15 16:28:11 2012 +0100
@@ -54,73 +54,75 @@
     }
 
   tests_start ();
-  rands = RANDS;
 
-  ap = TMP_ALLOC_LIMBS (MAX_AN);
-  refp = TMP_ALLOC_LIMBS (MAX_AN * 2);
-  pp = 1 + TMP_ALLOC_LIMBS (MAX_AN * 2 + 2);
-  scratch
-    = 1+TMP_ALLOC_LIMBS (mpn_toomN_sqr_itch (MAX_AN) + 2);
+  if (MAX_AN > MIN_AN) {
+    rands = RANDS;
 
-  if (MAX_AN > MIN_AN)
-  for (test = 0; test < count; test++)
-    {
-      unsigned size_min;
-      unsigned size_range;
-      mp_size_t an;
-      mp_size_t itch;
-      mp_limb_t p_before, p_after, s_before, s_after;
+    ap = TMP_ALLOC_LIMBS (MAX_AN);
+    refp = TMP_ALLOC_LIMBS (MAX_AN * 2);
+    pp = 1 + TMP_ALLOC_LIMBS (MAX_AN * 2 + 2);
+    scratch
+      = 1+TMP_ALLOC_LIMBS (mpn_toomN_sqr_itch (MAX_AN) + 2);
 
-      an = MIN_AN
-	+ gmp_urandomm_ui (rands, MAX_AN - MIN_AN);
+    for (test = 0; test < count; test++)
+      {
+	unsigned size_min;
+	unsigned size_range;
+	mp_size_t an;
+	mp_size_t itch;
+	mp_limb_t p_before, p_after, s_before, s_after;
 
-      mpn_random2 (ap, an);
-      mpn_random2 (pp-1, an * 2 + 2);
-      p_before = pp[-1];
-      p_after = pp[an * 2];
+	an = MIN_AN
+	  + gmp_urandomm_ui (rands, MAX_AN - MIN_AN);
 
-      itch = mpn_toomN_sqr_itch (an);
-      ASSERT_ALWAYS (itch <= mpn_toomN_sqr_itch (MAX_AN));
-      mpn_random2 (scratch-1, itch+2);
-      s_before = scratch[-1];
-      s_after = scratch[itch];
+	mpn_random2 (ap, an);
+	mpn_random2 (pp-1, an * 2 + 2);
+	p_before = pp[-1];
+	p_after = pp[an * 2];
 
-      mpn_toomN_sqr (pp, ap, an, scratch);
-      refmpn_mul (refp, ap, an, ap, an);
-      if (pp[-1] != p_before || pp[an * 2] != p_after
-	  || scratch[-1] != s_before || scratch[itch] != s_after
-	  || mpn_cmp (refp, pp, an * 2) != 0)
-	{
-	  printf ("ERROR in test %d, an = %d\n",
-		  test, (int) an);
-	  if (pp[-1] != p_before)
-	    {
-	      printf ("before pp:"); mpn_dump (pp -1, 1);
-	      printf ("keep:   "); mpn_dump (&p_before, 1);
-	    }
-	  if (pp[an * 2] != p_after)
-	    {
-	      printf ("after pp:"); mpn_dump (pp + an * 2, 1);
-	      printf ("keep:   "); mpn_dump (&p_after, 1);
-	    }
-	  if (scratch[-1] != s_before)
-	    {
-	      printf ("before scratch:"); mpn_dump (scratch-1, 1);
-	      printf ("keep:   "); mpn_dump (&s_before, 1);
-	    }
-	  if (scratch[itch] != s_after)
-	    {
-	      printf ("after scratch:"); mpn_dump (scratch + itch, 1);
-	      printf ("keep:   "); mpn_dump (&s_after, 1);
-	    }
-	  mpn_dump (ap, an);
-	  mpn_dump (pp, an * 2);
-	  mpn_dump (refp, an * 2);
+	itch = mpn_toomN_sqr_itch (an);
+	ASSERT_ALWAYS (itch <= mpn_toomN_sqr_itch (MAX_AN));
+	mpn_random2 (scratch-1, itch+2);
+	s_before = scratch[-1];
+	s_after = scratch[itch];
 
-	  abort();
-	}
-    }
-  TMP_FREE;
+	mpn_toomN_sqr (pp, ap, an, scratch);
+	refmpn_mul (refp, ap, an, ap, an);
+	if (pp[-1] != p_before || pp[an * 2] != p_after
+	    || scratch[-1] != s_before || scratch[itch] != s_after
+	    || mpn_cmp (refp, pp, an * 2) != 0)
+	  {
+	    printf ("ERROR in test %d, an = %d\n",
+		    test, (int) an);
+	    if (pp[-1] != p_before)
+	      {
+		printf ("before pp:"); mpn_dump (pp -1, 1);
+		printf ("keep:   "); mpn_dump (&p_before, 1);
+	      }
+	    if (pp[an * 2] != p_after)
+	      {
+		printf ("after pp:"); mpn_dump (pp + an * 2, 1);
+		printf ("keep:   "); mpn_dump (&p_after, 1);
+	      }
+	    if (scratch[-1] != s_before)
+	      {
+		printf ("before scratch:"); mpn_dump (scratch-1, 1);
+		printf ("keep:   "); mpn_dump (&s_before, 1);
+	      }
+	    if (scratch[itch] != s_after)
+	      {
+		printf ("after scratch:"); mpn_dump (scratch + itch, 1);
+		printf ("keep:   "); mpn_dump (&s_after, 1);
+	      }
+	    mpn_dump (ap, an);
+	    mpn_dump (pp, an * 2);
+	    mpn_dump (refp, an * 2);
+
+	    abort();
+	  }
+      }
+    TMP_FREE;
+  }
 
   tests_end ();
   return 0;


More information about the gmp-commit mailing list