/************************** ** SetupCPUEmFloatArrays ** *************************** ** Set up the arrays that will be used in the emulated ** floating-point tests. ** This is done by loading abase and bbase elements with ** random numbers. We use our long-to-floating point ** routine to set them up. ** NOTE: We really don't need the pointer to cbase...cbase ** is overwritten in the benchmark. */ void SetupCPUEmFloatArrays(InternalFPF *abase, InternalFPF *bbase, InternalFPF *cbase, ulong arraysize) { ulong i; InternalFPF locFPF1,locFPF2; /* ** Reset random number generator so things repeat. Inserted by Uwe F. Mayer. */ extern int32 randnum(int32 lngval); randnum((int32)13); for(i=0;i<arraysize;i++) {/* LongToInternalFPF(randwc(50000L),&locFPF1); */ Int32ToInternalFPF(randwc((int32)50000),&locFPF1); /* LongToInternalFPF(randwc(50000L)+1L,&locFPF2); */ Int32ToInternalFPF(randwc((int32)50000)+(int32)1,&locFPF2); DivideInternalFPF(&locFPF1,&locFPF2,abase+i); /* LongToInternalFPF(randwc(50000L)+1L,&locFPF2); */ Int32ToInternalFPF(randwc((int32)50000)+(int32)1,&locFPF2); DivideInternalFPF(&locFPF1,&locFPF2,bbase+i); } return; }
/************************** ** SetupCPUEmFloatArrays ** *************************** ** Set up the arrays that will be used in the emulated ** floating-point tests. ** This is done by loading abase and bbase elements with ** random numbers. We use our long-to-floating point ** routine to set them up. ** NOTE: We really don't need the pointer to cbase...cbase ** is overwritten in the benchmark. */ void SetupCPUEmFloatArrays(InternalFPF *abase, InternalFPF *bbase, InternalFPF *cbase, ulong arraysize) { ulong i; InternalFPF locFPF1,locFPF2; for(i=0;i<arraysize;i++) { LongToInternalFPF(randwc(50000L),&locFPF1); LongToInternalFPF(randwc(50000L)+1L,&locFPF2); DivideInternalFPF(&locFPF1,&locFPF2,abase+i); LongToInternalFPF(randwc(50000L)+1L,&locFPF2); DivideInternalFPF(&locFPF1,&locFPF2,bbase+i); } return; }