[Gmp-commit] /home/hgfiles/gmp: Speed support for both mpn_toom8h_mul and mpn...

mercurial at gmplib.org mercurial at gmplib.org
Wed Dec 23 19:27:33 CET 2009


details:   /home/hgfiles/gmp/rev/540128332d6f
changeset: 13206:540128332d6f
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Wed Dec 23 19:27:26 2009 +0100
description:
Speed support for both mpn_toom8h_mul and mpn_toom8_sqr.

diffstat:

 ChangeLog            |   3 +++
 tests/mpn/t-toom8h.c |   1 +
 tune/common.c        |  10 ++++++++++
 tune/speed.c         |   2 ++
 tune/speed.h         |  13 +++++++++++++
 5 files changed, 29 insertions(+), 0 deletions(-)

diffs (107 lines):

diff -r 98f18622767c -r 540128332d6f ChangeLog
--- a/ChangeLog	Wed Dec 23 18:41:05 2009 +0100
+++ b/ChangeLog	Wed Dec 23 19:27:26 2009 +0100
@@ -1,5 +1,8 @@
 2009-12-23  Marco Bodrato <bodrato at mail.dm.unipi.it>
 
+	* tune/common.c, tune/speed.c, tune/speed.h: Support for measuring
+	mpn_toom8h_mul and mpn_toom8_sqr speed.
+
 	* mpn/generic/toom_eval_pm2exp.c: Fix ASSERTs.
 
 	* mpn/generic/toom8h_mul.c: New file.
diff -r 98f18622767c -r 540128332d6f tests/mpn/t-toom8h.c
--- a/tests/mpn/t-toom8h.c	Wed Dec 23 18:41:05 2009 +0100
+++ b/tests/mpn/t-toom8h.c	Wed Dec 23 19:27:26 2009 +0100
@@ -4,6 +4,7 @@
 /* Smaller sizes not supported; may lead to recursive calls to
    toom{22,33,44,6h}_mul with invalid input size. */
 #define MIN_AN MUL_TOOM8H_THRESHOLD
+
 #if GMP_NUMB_BITS <= 10*3
 #define MIN_BN(an) (MAX ((an*6)/10, 86) )
 #else
diff -r 98f18622767c -r 540128332d6f tune/common.c
--- a/tune/common.c	Wed Dec 23 18:41:05 2009 +0100
+++ b/tune/common.c	Wed Dec 23 19:27:26 2009 +0100
@@ -1014,6 +1014,11 @@
   SPEED_ROUTINE_MPN_TOOM6_SQR (mpn_toom6_sqr);
 }
 double
+speed_mpn_toom8_sqr (struct speed_params *s)
+{
+  SPEED_ROUTINE_MPN_TOOM8_SQR (mpn_toom8_sqr);
+}
+double
 speed_mpn_toom22_mul (struct speed_params *s)
 {
   SPEED_ROUTINE_MPN_TOOM22_MUL_N (mpn_toom22_mul);
@@ -1033,6 +1038,11 @@
 {
   SPEED_ROUTINE_MPN_TOOM6H_MUL_N (mpn_toom6h_mul);
 }
+double
+speed_mpn_toom8h_mul (struct speed_params *s)
+{
+  SPEED_ROUTINE_MPN_TOOM8H_MUL_N (mpn_toom8h_mul);
+}
 
 double
 speed_mpn_toom32_mul (struct speed_params *s)
diff -r 98f18622767c -r 540128332d6f tune/speed.c
--- a/tune/speed.c	Wed Dec 23 18:41:05 2009 +0100
+++ b/tune/speed.c	Wed Dec 23 19:27:26 2009 +0100
@@ -295,10 +295,12 @@
   { "mpn_toom3_sqr",     speed_mpn_toom3_sqr        },
   { "mpn_toom4_sqr",     speed_mpn_toom4_sqr        },
   { "mpn_toom6_sqr",     speed_mpn_toom6_sqr        },
+  { "mpn_toom8_sqr",     speed_mpn_toom8_sqr        },
   { "mpn_toom22_mul",    speed_mpn_toom22_mul       },
   { "mpn_toom33_mul",    speed_mpn_toom33_mul       },
   { "mpn_toom44_mul",    speed_mpn_toom44_mul       },
   { "mpn_toom6h_mul",    speed_mpn_toom6h_mul       },
+  { "mpn_toom8h_mul",    speed_mpn_toom8h_mul       },
   { "mpn_toom32_mul",    speed_mpn_toom32_mul       },
   { "mpn_toom42_mul",    speed_mpn_toom42_mul       },
   { "mpn_nussbaumer_mul",    speed_mpn_nussbaumer_mul    },
diff -r 98f18622767c -r 540128332d6f tune/speed.h
--- a/tune/speed.h	Wed Dec 23 18:41:05 2009 +0100
+++ b/tune/speed.h	Wed Dec 23 19:27:26 2009 +0100
@@ -277,10 +277,12 @@
 double speed_mpn_toom3_sqr __GMP_PROTO ((struct speed_params *s));
 double speed_mpn_toom4_sqr __GMP_PROTO ((struct speed_params *s));
 double speed_mpn_toom6_sqr __GMP_PROTO ((struct speed_params *s));
+double speed_mpn_toom8_sqr __GMP_PROTO ((struct speed_params *s));
 double speed_mpn_toom22_mul __GMP_PROTO ((struct speed_params *s));
 double speed_mpn_toom33_mul __GMP_PROTO ((struct speed_params *s));
 double speed_mpn_toom44_mul __GMP_PROTO ((struct speed_params *s));
 double speed_mpn_toom6h_mul __GMP_PROTO ((struct speed_params *s));
+double speed_mpn_toom8h_mul __GMP_PROTO ((struct speed_params *s));
 double speed_mpn_toom32_mul __GMP_PROTO ((struct speed_params *s));
 double speed_mpn_toom42_mul __GMP_PROTO ((struct speed_params *s));
 double speed_mpn_toom63_mul __GMP_PROTO ((struct speed_params *s));
@@ -1130,6 +1132,12 @@
      mpn_toom6h_mul_itch (s->size, s->size),				\
      MPN_TOOM6H_MUL_MINSIZE)
 
+#define SPEED_ROUTINE_MPN_TOOM8H_MUL_N(function)			\
+  SPEED_ROUTINE_MPN_MUL_N_TSPACE					\
+    (function (wp, s->xp, s->size, s->yp, s->size, tspace),		\
+     mpn_toom8h_mul_itch (s->size, s->size),				\
+     MPN_TOOM8H_MUL_MINSIZE)
+
 #define SPEED_ROUTINE_MPN_TOOM32_MUL(function)				\
   SPEED_ROUTINE_MPN_MUL_N_TSPACE					\
     (function (wp, s->xp, s->size, s->yp, 2*s->size/3, tspace),		\
@@ -1267,6 +1275,11 @@
 				mpn_toom6_sqr_itch (s->size),		\
 				MPN_TOOM6_SQR_MINSIZE)
 
+#define SPEED_ROUTINE_MPN_TOOM8_SQR(function)				\
+  SPEED_ROUTINE_MPN_SQR_TSPACE (function (wp, s->xp, s->size, tspace),	\
+				mpn_toom8_sqr_itch (s->size),		\
+				MPN_TOOM8_SQR_MINSIZE)
+
 #define SPEED_ROUTINE_MPN_MOD_CALL(call)				\
   {									\
     unsigned   i;							\


More information about the gmp-commit mailing list