[Gmp-commit] /var/hg/gmp: Add speed measurement for mpn_tabselect.

mercurial at gmplib.org mercurial at gmplib.org
Thu Nov 17 21:24:52 CET 2011


details:   /var/hg/gmp/rev/d16bf0344fd8
changeset: 14454:d16bf0344fd8
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu Nov 17 21:24:47 2011 +0100
description:
Add speed measurement for mpn_tabselect.

diffstat:

 ChangeLog     |   9 +++++++++
 tune/common.c |   5 +++++
 tune/speed.c  |   3 ++-
 tune/speed.h  |  10 ++++++++--
 4 files changed, 24 insertions(+), 3 deletions(-)

diffs (91 lines):

diff -r 7a0708b54a49 -r d16bf0344fd8 ChangeLog
--- a/ChangeLog	Thu Nov 17 15:18:45 2011 +0100
+++ b/ChangeLog	Thu Nov 17 21:24:47 2011 +0100
@@ -1,3 +1,12 @@
+2011-11-17  Torbjorn Granlund  <tege at gmplib.org>
+
+	* tune/speed.c (routine): Add mpn_tabselect.
+	* tune/common.c (speed_mpn_tabselect): New function.
+	* tune/speed.h (SPEED_ROUTINE_MPN_COPY_CALL): New macro, made from
+	old SPEED_ROUTINE_MPN_COPY.
+	(SPEED_ROUTINE_MPN_COPY): Just invoke SPEED_ROUTINE_MPN_COPY_CALL.
+	(SPEED_ROUTINE_MPN_TABSELECT): New macro.
+
 2011-11-17  Niels Möller  <nisse at lysator.liu.se>
 
 	* tune/tuneup.c (tune_hgcd_appr): Increase stop_since_change.
diff -r 7a0708b54a49 -r d16bf0344fd8 tune/common.c
--- a/tune/common.c	Thu Nov 17 15:18:45 2011 +0100
+++ b/tune/common.c	Thu Nov 17 21:24:47 2011 +0100
@@ -461,6 +461,11 @@
 {
   SPEED_ROUTINE_MPN_COPY (mpn_com);
 }
+double
+speed_mpn_tabselect (struct speed_params *s)
+{
+  SPEED_ROUTINE_MPN_TABSELECT (mpn_tabselect);
+}
 
 
 double
diff -r 7a0708b54a49 -r d16bf0344fd8 tune/speed.c
--- a/tune/speed.c	Thu Nov 17 15:18:45 2011 +0100
+++ b/tune/speed.c	Thu Nov 17 21:24:47 2011 +0100
@@ -283,7 +283,7 @@
   { "mpn_hgcd_reduce",   speed_mpn_hgcd_reduce      },
   { "mpn_hgcd_reduce_1", speed_mpn_hgcd_reduce_1    },
   { "mpn_hgcd_reduce_2", speed_mpn_hgcd_reduce_2    },
-  
+
   { "mpn_gcd_1",         speed_mpn_gcd_1,  FLAG_R_OPTIONAL },
   { "mpn_gcd_1N",        speed_mpn_gcd_1N, FLAG_R_OPTIONAL },
 
@@ -412,6 +412,7 @@
 #if HAVE_NATIVE_mpn_copyd
   { "mpn_copyd",         speed_mpn_copyd            },
 #endif
+  { "mpn_tabselect",     speed_mpn_tabselect, FLAG_R_OPTIONAL },
 #if HAVE_NATIVE_mpn_addlsh1_n
   { "mpn_addlsh1_n",     speed_mpn_addlsh1_n, FLAG_R_OPTIONAL },
 #endif
diff -r 7a0708b54a49 -r d16bf0344fd8 tune/speed.h
--- a/tune/speed.h	Thu Nov 17 15:18:45 2011 +0100
+++ b/tune/speed.h	Thu Nov 17 21:24:47 2011 +0100
@@ -175,6 +175,7 @@
 double speed_MPN_COPY __GMP_PROTO ((struct speed_params *s));
 double speed_MPN_COPY_DECR __GMP_PROTO ((struct speed_params *s));
 double speed_MPN_COPY_INCR __GMP_PROTO ((struct speed_params *s));
+double speed_mpn_tabselect __GMP_PROTO ((struct speed_params *s));
 double speed_mpn_divexact_1 __GMP_PROTO ((struct speed_params *s));
 double speed_mpn_divexact_by3 __GMP_PROTO ((struct speed_params *s));
 double speed_mpn_bdiv_q_1 __GMP_PROTO ((struct speed_params *));
@@ -613,7 +614,7 @@
 #define SPEED_RESTRICT_COND(cond)   if (!(cond)) return -1.0;
 
 /* For mpn_copy or similar. */
-#define SPEED_ROUTINE_MPN_COPY(function)				\
+#define SPEED_ROUTINE_MPN_COPY_CALL(call)				\
   {									\
     mp_ptr    wp;							\
     unsigned  i;							\
@@ -632,13 +633,18 @@
     speed_starttime ();							\
     i = s->reps;							\
     do									\
-      function (wp, s->xp, s->size);					\
+      call;								\
     while (--i != 0);							\
     t = speed_endtime ();						\
 									\
     TMP_FREE;								\
     return t;								\
   }
+#define SPEED_ROUTINE_MPN_COPY(function)				\
+  SPEED_ROUTINE_MPN_COPY_CALL (function (wp, s->xp, s->size))
+
+#define SPEED_ROUTINE_MPN_TABSELECT(function)				\
+  SPEED_ROUTINE_MPN_COPY_CALL (function (wp, s->xp, s->size, 1, s->r))
 
 #define SPEED_ROUTINE_MPN_COPYC(function)				\
   {									\


More information about the gmp-commit mailing list