2
Copyright (C) 1996, 1998, 2000 Free Software Foundation, Inc.
4
This file is part of the GNU MP Library.
6
The GNU MP Library is free software; you can redistribute it and/or modify
7
it under the terms of the GNU Lesser General Public License as published by
8
the Free Software Foundation; either version 2.1 of the License, or (at your
9
option) any later version.
11
The GNU MP Library is distributed in the hope that it will be useful, but
12
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14
License for more details.
16
You should have received a copy of the GNU Lesser General Public License
17
along with the GNU MP Library; see the file COPYING.LIB. If not, write to
18
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
27
#if defined (USG) || defined (__SVR4) || defined (_UNICOS) || defined (__hpux) || (defined(__DECC) && defined(__VMS))
33
if (CLOCKS_PER_SEC < 100000)
34
return clock () * 1000 / CLOCKS_PER_SEC;
35
return clock () / (CLOCKS_PER_SEC / 1000);
38
#include <sys/types.h>
40
#include <sys/resource.h>
48
return rus.ru_utime.tv_sec * 1000 + rus.ru_utime.tv_usec / 1000;
55
#if defined (__m88k__)
57
#elif defined (__i386__)
58
#define CLOCK (16666667)
59
#elif defined (__m68k__)
61
#elif defined (_IBMR2)
63
#elif defined (__sparc__)
65
#elif defined (__sun__)
67
#elif defined (__mips)
69
#elif defined (__hppa__)
71
#elif defined (__alpha)
76
#error "Don't know CLOCK of your machine"
87
#define TIMES OPS/SIZE
90
#define OPS (SIZE*TIMES)
98
mp_limb_t dlimb, rlimb, plimb;
99
mp_size_t nsize, qsize, psize;
103
clock_mhz = CLOCK / 1000000;
104
printf("\r\nTest Times Are Based On A CPU Clock Speed Of %dMHz.\r\n\r\n",clock_mhz);
106
for (test = 0; ; test++)
109
nsize = random () % SIZE + 1;
114
mpn_random2 (nptr, nsize);
116
mpn_random2 (&dlimb, 1);
120
rlimb = mpn_divmod_1 (qptr, nptr, nsize, dlimb);
121
qsize = nsize - (qptr[nsize - 1] == 0);
129
plimb = mpn_mul_1 (pptr, qptr, qsize, dlimb);
131
plimb += mpn_add_1 (pptr, pptr, psize, rlimb);
134
pptr[psize++] = plimb;
137
if (nsize != psize || mpn_cmp (nptr, pptr, nsize) != 0)