~ubuntu-branches/ubuntu/intrepid/ecl/intrepid

« back to all changes in this revision

Viewing changes to src/gmp/tune/speed-ext.c

  • Committer: Bazaar Package Importer
  • Author(s): Peter Van Eynde
  • Date: 2007-04-09 11:51:51 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070409115151-ql8cr0kalzx1jmla
Tags: 0.9i-20070324-2
Upload to unstable. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* An example of extending the speed program to measure routines not in GMP. */
 
1
/* An example of extending the speed program to measure routines not in GMP.
2
2
 
3
 
/*
4
 
Copyright 1999, 2000 Free Software Foundation, Inc.
 
3
Copyright 1999, 2000, 2002, 2003, 2005 Free Software Foundation, Inc.
5
4
 
6
5
This file is part of the GNU MP Library.
7
6
 
17
16
 
18
17
You should have received a copy of the GNU Lesser General Public License
19
18
along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
20
 
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
21
 
MA 02111-1307, USA.
22
 
*/
 
19
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
20
MA 02110-1301, USA. */
23
21
 
24
22
 
25
23
/* The extension here is three versions of an mpn arithmetic mean.  These
60
58
   not using libtool) to get common.o and other objects needed by speed.c.  */
61
59
 
62
60
 
63
 
#define SPEED_EXTRA_PROTOS                              \
64
 
  double speed_mean_calls (struct speed_params *s);     \
65
 
  double speed_mean_open  (struct speed_params *s);     \
66
 
  double speed_mean_open2 (struct speed_params *s);
 
61
#define SPEED_EXTRA_PROTOS                                              \
 
62
  double speed_mean_calls __GMP_PROTO ((struct speed_params *s));       \
 
63
  double speed_mean_open  __GMP_PROTO ((struct speed_params *s));       \
 
64
  double speed_mean_open2 __GMP_PROTO ((struct speed_params *s));
67
65
 
68
66
#define SPEED_EXTRA_ROUTINES            \
69
67
  { "mean_calls",  speed_mean_calls  }, \
184
182
    unsigned  i;                                        \
185
183
    mp_ptr    wp;                                       \
186
184
    double    t;                                        \
187
 
    TMP_DECL (marker);                                  \
 
185
    TMP_DECL;                                  \
188
186
                                                        \
189
187
    SPEED_RESTRICT_COND (s->size >= 1);                 \
190
188
                                                        \
191
 
    TMP_MARK (marker);                                  \
192
 
    wp = SPEED_TMP_ALLOC_LIMBS (s->size, s->align_wp);  \
 
189
    TMP_MARK;                                  \
 
190
    SPEED_TMP_ALLOC_LIMBS (wp, s->size, s->align_wp);   \
193
191
                                                        \
194
192
    speed_operand_src (s, s->xp, s->size);              \
195
193
    speed_operand_src (s, s->yp, s->size);              \
203
201
    while (--i != 0);                                   \
204
202
    t = speed_endtime ();                               \
205
203
                                                        \
206
 
    TMP_FREE (marker);                                  \
 
204
    TMP_FREE;                                  \
207
205
    return t;                                           \
208
206
  }
209
207