[Gmp-commit] /home/hgfiles/gmp: Support for toom42_mul and redc_n in speed.

mercurial at gmplib.org mercurial at gmplib.org
Tue Dec 1 13:45:45 CET 2009


details:   /home/hgfiles/gmp/rev/cac1b60a3004
changeset: 12944:cac1b60a3004
user:      Niels M?ller <nisse at lysator.liu.se>
date:      Tue Dec 01 12:46:28 2009 +0100
description:
Support for toom42_mul and redc_n in speed.

diffstat:

 ChangeLog     |  8 ++++++++
 gmp-impl.h    |  1 +
 tune/common.c |  5 +++++
 tune/speed.c  |  2 ++
 tune/speed.h  |  7 +++++++
 5 files changed, 23 insertions(+), 0 deletions(-)

diffs (84 lines):

diff -r 3ef05c6953ac -r cac1b60a3004 ChangeLog
--- a/ChangeLog	Mon Nov 30 17:18:36 2009 +0100
+++ b/ChangeLog	Tue Dec 01 12:46:28 2009 +0100
@@ -1,3 +1,11 @@
+2009-12-01  Niels Möller  <nisse at lysator.liu.se>
+
+	* tune/speed.c (routine): Added mpn_toom42_mul and mpn_redc_n.
+	* tune/speed.h (SPEED_ROUTINE_MPN_TOOM42_MUL): New macro.
+	(speed_mpn_toom42_mul): Declare function.
+	* tune/common.c (speed_mpn_toom42_mul): New function.
+	* gmp-impl.h (MPN_TOOM42_MUL_MINSIZE): New constant.
+
 2009-11-30  Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* mpn/generic/fib2_ui.c: Use mpn_rsblsh2_n.
diff -r 3ef05c6953ac -r cac1b60a3004 gmp-impl.h
--- a/gmp-impl.h	Mon Nov 30 17:18:36 2009 +0100
+++ b/gmp-impl.h	Tue Dec 01 12:46:28 2009 +0100
@@ -1036,6 +1036,7 @@
 #define MPN_TOOM4_SQR_MINSIZE    30
 
 #define MPN_TOOM32_MUL_MINSIZE   10
+#define MPN_TOOM42_MUL_MINSIZE   10
 
 #define   mpn_sqr_diagonal __MPN(sqr_diagonal)
 __GMP_DECLSPEC void      mpn_sqr_diagonal __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t));
diff -r 3ef05c6953ac -r cac1b60a3004 tune/common.c
--- a/tune/common.c	Mon Nov 30 17:18:36 2009 +0100
+++ b/tune/common.c	Tue Dec 01 12:46:28 2009 +0100
@@ -962,6 +962,11 @@
 {
   SPEED_ROUTINE_MPN_TOOM32_MUL (mpn_toom32_mul);
 }
+double
+speed_mpn_toom42_mul (struct speed_params *s)
+{
+  SPEED_ROUTINE_MPN_TOOM42_MUL (mpn_toom42_mul);
+}
 
 double
 speed_mpn_mul_fft_full (struct speed_params *s)
diff -r 3ef05c6953ac -r cac1b60a3004 tune/speed.c
--- a/tune/speed.c	Mon Nov 30 17:18:36 2009 +0100
+++ b/tune/speed.c	Tue Dec 01 12:46:28 2009 +0100
@@ -298,6 +298,7 @@
   { "mpn_toom33_mul",    speed_mpn_toom33_mul       },
   { "mpn_toom44_mul",    speed_mpn_toom44_mul       },
   { "mpn_toom32_mul",    speed_mpn_toom32_mul       },
+  { "mpn_toom42_mul",    speed_mpn_toom42_mul       },
   { "mpn_mul_fft_full",      speed_mpn_mul_fft_full      },
   { "mpn_mul_fft_full_sqr",  speed_mpn_mul_fft_full_sqr  },
 
@@ -333,6 +334,7 @@
 
   { "mpz_mod",           speed_mpz_mod              },
   { "mpn_redc_1",        speed_mpn_redc_1           },
+  { "mpn_redc_n",        speed_mpn_redc_2           },
 
   { "MPN_COPY",          speed_MPN_COPY             },
   { "MPN_COPY_INCR",     speed_MPN_COPY_INCR        },
diff -r 3ef05c6953ac -r cac1b60a3004 tune/speed.h
--- a/tune/speed.h	Mon Nov 30 17:18:36 2009 +0100
+++ b/tune/speed.h	Tue Dec 01 12:46:28 2009 +0100
@@ -266,6 +266,7 @@
 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_toom32_mul __GMP_PROTO ((struct speed_params *s));
+double speed_mpn_toom42_mul __GMP_PROTO ((struct speed_params *s));
 double speed_mpn_mulmod_bnm1 __GMP_PROTO ((struct speed_params *s));
 double speed_mpn_udiv_qrnnd __GMP_PROTO ((struct speed_params *s));
 double speed_mpn_udiv_qrnnd_r __GMP_PROTO ((struct speed_params *s));
@@ -1068,6 +1069,12 @@
      mpn_toom32_mul_itch (s->size, 2*s->size/3),			\
      MPN_TOOM32_MUL_MINSIZE)
 
+#define SPEED_ROUTINE_MPN_TOOM42_MUL(function)				\
+  SPEED_ROUTINE_MPN_MUL_N_TSPACE					\
+    (function (wp, s->xp, s->size, s->yp, s->size/2, tspace),		\
+     mpn_toom42_mul_itch (s->size, s->size/2),			\
+     MPN_TOOM42_MUL_MINSIZE)
+
 #define SPEED_ROUTINE_MPN_SQR_CALL(call)				\
   {									\
     mp_ptr    wp;							\


More information about the gmp-commit mailing list