/********************************************************************* * * File Name: bench11.h * * Functional Description: The header file bench11.h defines * macros common to the various subroutines in the bench11 * multiple precision arithmetic benchmark. * *********************************************************************/ /* CVS info */ /* $Date: 2005/01/10 21:05:27 $ */ /* $Revision: 1.2 $ */ /* $RCSfile: bench11.h,v $ */ /* $Name: rel_5 $ */ /* Define various structures for each machine */ #if defined _CRAYX1 # include "crayx1.h" #elif defined _CRAYMPP # include "craympp.h" #elif defined _CRAY1 # include "cray1.h" #elif defined __alpha # include "decalpha.h" #elif defined __hp # include "hp.h" #endif #ifndef SW_LEADZ # define leadz _leadz # ifndef CRAY # include # endif #endif #include #include /********************************************************************* * Define the header for MP integers N * N(MPALLOC) = number of words allocated for limbs of N * N(MPSIZE) = number of words actually used * N(MPPTR) = GMP's pointer to the data, here the next word in the array * N(MPDATA) = the first word of data, lowest-order limb of N ********************************************************************** * on DEC alpha GMP's header uses int = 32 bits for alloc, size * so they must share word 0 and we don't use MPSIZE *********************************************************************/ #ifdef GMP # if INT32 # define MPHL 2 # define MPALLOC 0 # define MPPTR 1 # define MPDATA 2 # define GMP32 1 # else /* not INT32 */ # define MPHL 3 # define MPALLOC 0 # define MPSIZE 1 # define MPPTR 2 # define MPDATA 3 # define GMP32 0 # endif /* not INT32 */ #else /* not GMP, no MPPTR */ # define MPHL 2 # define MPALLOC 0 # define MPSIZE 1 # define MPDATA 2 # define GMP32 0 #endif /* not GMP */ static mplong BitMask32 = 0xFFFFFFFFL; #if (BITSPERWORD < 64) static mplong BitMask = (1L << BITSPERWORD) - 1; #endif #ifdef _MPUTIL // how to make calls from C to Fortram mputil // Cray but not X1 # if defined (_CRAY1) || (_CRAYMPP) #define mputil MPUTIL #define mpread MPREAD #define mpwrite MPWRITE #define mpfromstring MPFROMSTRING #define mpadd MPADD #define mpmult MPMULT #define mpmod MPMOD # else // CrayX1 or other vendors #define mputil mputil_ #define mpread mpread_ #define mpwrite mpwrite_ #define mpfromstring mpfromstring_ #define mpadd mpadd_ #define mpmult mpmult_ #define mpmod mpmod_ # endif #endif /* Maximum values for various parameters */ /********************************************************************* * The size of the largest matrix accepted by the program *********************************************************************/ #define maxmatsize 1024 /********************************************************************* * The size of the largest local submatrix on each PE *********************************************************************/ #define maxsubmatsize 512 /********************************************************************* * The size (number of limbs or digit words) plus MPHL = header-length * of the largest multiple precision number accepted by the program * 32 / 64 BITSPERWORD * Up to 128 bits (M3: 128) - 8 / 4 limbs * Up to 544/576 bits (M8: 514) - 17 / 9 limbs * Up to 1024 bits (M10: 999) - 32 / 16 limbs *********************************************************************/ #define maxbitsize 1024 /********************************************************************* * The size (number of limbs or digit words) plus MPHL = header-length * of the largest multiple precision number accepted by the program *********************************************************************/ #define maxwds ( (maxbitsize+BITSPERWORD-1)/BITSPERWORD ) #define maxnumsize (maxwds + MPHL) /* GMP may need extra words to read max modulus */ #define maxmodsize (maxnumsize + MPHL) /********************************************************************* * The number of decimal digits in the largest multiple * precision number accepted by the program -- used by MPUTIL only *********************************************************************/ #define MAXDECIMALDIG 342