3 ** Global definitions for native mode benchmarks.
6 ** BYTE's Native Mode Benchmarks
7 ** Rick Grehan, BYTE Magazine
10 ** Revision: 3/95;10/95
11 ** 10/95 - Added memory array & alignment -- RG
14 ** The source, executable, and documentation files that comprise
15 ** the BYTEmark benchmarks are made available on an "as is" basis.
16 ** This means that we at BYTE Magazine have made every reasonable
17 ** effort to verify that the there are no errors in the source and
18 ** executable code. We cannot, however, guarantee that the programs
19 ** are error-free. Consequently, McGraw-HIll and BYTE Magazine make
20 ** no claims in regard to the fitness of the source code, executable
21 ** code, and documentation of the BYTEmark.
22 ** Furthermore, BYTE Magazine, McGraw-Hill, and all employees
23 ** of McGraw-Hill cannot be held responsible for any damages resulting
24 ** from the use of this code or the results obtained from using
28 /* is this a 64 bit architecture? If so, this will define LONG64 */
38 ** You must define ONLY ONE of the following identifiers
39 ** to specify the mechanism for allocating memory:
46 ** Define MALLOCMEM to use the standard malloc() call for
47 ** memory. This is the default for most systems.
52 ** Define DOS16MEM if you're running in the old 16-bit segmented
53 ** model. This enables some fruity memory management routines
54 ** required for that model. NOT defining this assumes that
55 ** you're running in an environment that allows malloc() to
56 ** get > 64K chunks of memory.
58 /* #define DOS16MEM */
60 /* Define MACMEM to use the Mac's GetPtr call to allocate
61 ** memory (instead of malloc()).
67 ** You must define ONLY ONE of the following identifiers to pick
68 ** the timing routine used.
76 ** Define CLOCKWCPS if you are using the clock() routine and the
77 ** constant used as the divisor to determine seconds is
78 ** CLOCKS_PER_SEC. This is the default in most cases.
83 ** Define CLOCKWCT if you are using the clock() routine and the
84 ** constant used as the divisor to determine seconds is CLK_TCK
86 /* #define CLOCKWCT */
89 ** Define MACTIMEMGR to use the Mac Time manager routines.
90 ** You'll need to be running at least system 6.0.3 or
91 ** better...extended time manager is recommended (system 7 or
94 /* #define MACTIMEMGR */
97 ** Define WIN31TIMER to user the timing routines in TOOLHELP.DLL.
98 ** Gets accuracy down to the millisecond.
100 /* #define WIN31TIMER */
102 /* +++ MISCELLANEOUS +++ */
105 ** Define DOS16 if you'll be compiling under DOS in 16-bit
106 ** (non DOS-extended) mode. This will enable proper definitions
107 ** for the far*** typedefs
112 ** Define MAC if you're compiling on a Macintosh. This
113 ** does a number of things:
115 ** Incorporates code to mimic the command line via either
116 ** the console library (Symantec/Think) or the SIOUX
117 ** library (Code Warrior).
122 ** Define LONG64 if your compiler emits 64-bit longs.
123 ** This is typically true of Alpha compilers on Unix
124 ** systems...though, who knows, this may change in the
125 ** future. I MOVED THIS DEFINTION INTO THE FILE pointer.h. DO NOT
126 ** DEFINE IT HERE. IT WILL AUTOMATICALLY BE DEFINED IF NECESSARY.
127 ** Uwe F. Mayer, Dec 15, 1996, Nov 15, 1997
132 ** Define MACCWPROF if you are profiling on the Mac using
133 ** Code Warrior. This enables code that turns off the
134 ** profiler in an evern of an error exit.
136 /* #define MACCWPROF */
145 #define ERROR_MEMORY 1
146 #define ERROR_MEMARRAY_FULL 2
147 #define ERROR_MEMARRAY_NFOUND 3
148 #define ERROR_FILECREATE 10
149 #define ERROR_FILEREAD 11
150 #define ERROR_FILEWRITE 12
151 #define ERROR_FILEOPEN 13
152 #define ERROR_FILESEEK 14
157 ** This sets the default number of minimum ticks.
158 ** It can, of course, be overridden by the input
160 ** This ultimately gets loaded into the variable
161 ** global_min_ticks, which specifies the minimum
162 ** number of ticks that must take place between
163 ** a StartStopwatch() and StopStopwatch() call.
164 ** The idea is to reduce error buildup.
166 #define MINIMUM_TICKS 60
171 ** Minimum number of seconds to run each test.
173 #define MINIMUM_SECONDS 5
178 ** This is the maximum positive long.
181 #define MAXPOSLONG 0x7FFFFFFFFFFFFFFFL
183 #define MAXPOSLONG 0x7FFFFFFFL
195 ** Memory array size. Used in SYSSPEC for keeping track
196 ** of re-aligned memory.
198 #define MEM_ARRAY_SIZE 20
203 #define ulong unsigned long
204 #define uchar unsigned char
205 #define uint unsigned int
206 #define ushort unsigned short
208 typedef unsigned char uchar;
209 typedef unsigned int uint;
210 typedef unsigned short ushort;
211 typedef unsigned long ulong;
214 ** The 'farxxx' typedefs were added in deference to DOS, which
215 ** requires far pointers to handle some of the bigger
216 ** memory structures. Other systems will simply
217 ** map 'farxxx' to 'xxx'
220 typedef void huge farvoid;
221 typedef double huge fardouble;
222 typedef long huge farlong;
223 typedef unsigned long huge farulong;
224 typedef char huge farchar;
225 typedef unsigned char huge faruchar;
229 typedef void farvoid;
230 typedef double fardouble;
231 typedef long farlong;
232 typedef unsigned long farulong;
233 typedef char farchar;
234 typedef unsigned char faruchar;
239 ** The following typedefs are used when element size
240 ** is critical. You'll have to alter these for
241 ** your specifical platform/compiler.
243 typedef unsigned char u8; /* Unsigned 8-bits */
244 typedef unsigned short u16; /* Unsigned 16 bits */
246 typedef unsigned int u32; /* Unsigned 32 bits */
247 typedef int int32; /* Signed 32 bit integer */
249 typedef unsigned long u32; /* Unsigned 32 bits */
250 typedef long int32; /* Signed 32 bit integer */
261 ** The following constant, NUMNUMARRAYS (no, it is not a
262 ** Peter Sellers joke) is the maximum number of arrays
263 ** that can be built by the numeric sorting benchmark
264 ** before it gives up. This maximum is dependent on the
265 ** amount of memory in the system.
267 /*#define NUMNUMARRAYS 1000*/
268 #define NUMNUMARRAYS 10000
271 ** The following constant NUMARRAYSIZE determines the
272 ** default # of elements in each numeric array. Ordinarily
273 ** this is something you shouldn't fool with, though as
274 ** with most of the constants here, it is adjustable.
276 #define NUMARRAYSIZE 8111L
283 int adjust; /* Set adjust code */
284 ulong request_secs; /* # of seconds requested */
285 double sortspersec; /* # of sort iterations per sec */
286 ushort numarrays; /* # of arrays */
287 ulong arraysize; /* # of elements in array */
293 ** Note: The string sort benchmark uses the same structure to
294 ** communicate parameters as does the numeric sort benchmark.
295 ** (i.e., SortStruct...see above.
302 ** The following constant STRINGARRAYSIZE determines
303 ** the default # of bytes allocated to each string array.
304 ** Though the actual size can be pre-set from the command
305 ** file, this constant should be left unchanged.
307 #define STRINGARRAYSIZE 8111L
309 /************************
310 ** BITFIELD OPERATIONS **
311 *************************
319 ** Following field sets the size of the bitfield array (in longs).
322 #define BITFARRAYSIZE 16384L
324 #define BITFARRAYSIZE 32768L
331 int adjust; /* Set adjust code */
332 ulong request_secs; /* # of seconds requested */
333 double bitopspersec; /* # of bitfield ops per sec */
334 ulong bitoparraysize; /* Total # of bitfield ops */
335 ulong bitfieldarraysize; /* Bit field array size */
338 /****************************
339 ** EMULATED FLOATING POINT **
340 ****************************/
344 #define INTERNAL_FPF_PRECISION 4
347 ** The following constant is the maximum number of loops
348 ** of the emulated floating point test that the system
349 ** will allow before flagging an error. This is not a
350 ** critical constant, and can be altered if your system is
351 ** a real barn-burner.
353 /*#define CPUEMFLOATLOOPMAX 50000L*/
354 #define CPUEMFLOATLOOPMAX 500000L
359 #define EMFARRAYSIZE 3000L
365 int adjust; /* Set adjust code */
366 ulong request_secs; /* # of seconds requested */
367 ulong arraysize; /* Size of array */
368 ulong loops; /* Loops per iterations */
369 double emflops; /* Results */
372 /*************************
373 ** FOURIER COEFFICIENTS **
374 *************************/
380 int adjust; /* Set adjust code */
381 ulong request_secs; /* # of requested seconds */
382 ulong arraysize; /* Size of coeff. arrays */
383 double fflops; /* Results */
386 /*************************
387 ** ASSIGNMENT ALGORITHM **
388 *************************/
394 int adjust; /* Set adjust code */
395 ulong request_secs; /* Requested # of seconds */
396 ulong numarrays; /* # of arrays */
397 double iterspersec; /* Results */
400 /********************
401 ** IDEA ENCRYPTION **
402 ********************/
407 /* Following constant defines the max number of loops the
408 ** system will attempt. Keeps things from going off into the
410 /*#define MAXIDEALOOPS 50000L*/
411 #define MAXIDEALOOPS 500000L
414 ** Following constant sets the size of the arrays.
415 ** NOTE: For the IDEA algorithm to work properly, this
416 ** number MUST be some multiple of 8.
418 #define IDEAARRAYSIZE 4000L
424 int adjust; /* Set adjust code */
425 ulong request_secs; /* Requested # of seconds */
426 ulong arraysize; /* Size of array */
427 ulong loops; /* # of times to convert */
428 double iterspersec; /* Results */
432 /************************
433 ** HUFFMAN COMPRESSION **
434 ************************/
442 ** This constant specifies the maximum number of Huffman
443 ** compression loops the system will try for. This keeps
444 ** the test from going off into the weeds. This is not
445 ** a critical constant, and can be increased if your
446 ** system is a real barn-burner.
448 /*#define MAXHUFFLOOPS 50000L*/
449 #define MAXHUFFLOOPS 500000L
452 ** Following constant sets the size of the arrays to
453 ** be compressed/uncompressed.
455 #define HUFFARRAYSIZE 5000L
462 int adjust; /* Set adjust code */
463 ulong request_secs; /* Requested # of seconds */
464 ulong arraysize; /* Size of array */
465 ulong loops; /* # of times to compress/decompress */
466 double iterspersec; /* Results */
469 /********************************
470 ** BACK PROPAGATION NEURAL NET **
471 ********************************/
476 ** This constant sets the max number of loops through the neural
477 ** net that the system will attempt before giving up. This
478 ** is not a critical constant. You can alter it if your system
479 ** has sufficient horsepower.
481 /*#define MAXNNETLOOPS 50000L*/
482 #define MAXNNETLOOPS 500000L
488 int adjust; /* Set adjust code */
489 ulong request_secs; /* Requested # of seconds */
490 ulong loops; /* # of times to learn */
491 double iterspersec; /* Results */
494 /***********************
495 ** LU DECOMPOSITION **
496 ** (Linear Equations) **
497 ***********************/
502 ** This sets the upper limit on the number of arrays
503 ** that the benchmark will attempt to build before
504 ** flagging an error. It is not a critical constant, and
505 ** may be increased if your system has the horsepower.
507 /*#define MAXLUARRAYS 1000*/
508 #define MAXLUARRAYS 10000
514 int adjust; /* Set adjust code */
515 ulong request_secs; /* Requested # of seconds */
516 ulong numarrays; /* # of arrays */
517 double iterspersec; /* Results */