From b50243af303373a0af9185dd12d86b21990dde14 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 12 Nov 2008 22:51:00 +0000 Subject: -- More cleanups for numsort.c and fpemulation.c -- Begin cleaning bitfield.c git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@12 0d43b9a7-5ab2-4d7b-af9d-f64450cef757 --- fpemulation.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'fpemulation.c') diff --git a/fpemulation.c b/fpemulation.c index b9b6235..26ce951 100644 --- a/fpemulation.c +++ b/fpemulation.c @@ -1,9 +1,8 @@ #include #include -/* -#include -#include -#include */ +#include +#include + #include "nmglobal.h" #include "nbench1.h" @@ -18,7 +17,9 @@ ** Perform the floating-point emulation routines portion of the ** CPU benchmark. Returns the operations per second. */ -void DoEmFloat(void) { +void +DoEmFloat(void) +{ /* Error context string pointer */ const char *errorcontext = "CPU:Floating Emulation"; /* Local structure */ @@ -56,21 +57,19 @@ void DoEmFloat(void) { SetupCPUEmFloatArrays(abase, bbase, cbase, locemfloatstruct->arraysize); /* FIXME: ugly */ - /* - ** See if we need to do self-adjusting code. - */ - if( locemfloatstruct->adjust == 0 ) { - locemfloatstruct->loops=0; + /* See if we need to do self-adjusting code.*/ + if (locemfloatstruct->adjust == 0) { + locemfloatstruct->loops = 0; /* ** Do an iteration of the tests. If the elapsed time is ** less than minimum, increase the loop count and try ** again. */ - for ( loops = 1; loops < CPUEMFLOATLOOPMAX; loops += loops ) { + for (loops = 1; loops < CPUEMFLOATLOOPMAX; loops += loops) { tickcount = DoEmFloatIteration(abase, bbase, cbase, /* FIXME: ugly */ locemfloatstruct->arraysize, loops); - if ( tickcount > global_min_ticks ) { + if (tickcount > global_min_ticks) { locemfloatstruct->loops = loops; break; } @@ -80,7 +79,7 @@ void DoEmFloat(void) { /* ** Verify that selft adjustment code worked. */ - if ( locemfloatstruct->loops == 0 ) { + if (locemfloatstruct->loops == 0) { puts("CPU:EMFPU -- CMPUEMFLOATLOOPMAX limit hit"); free(abase); free(bbase); @@ -100,7 +99,7 @@ void DoEmFloat(void) { accumtime += DoEmFloatIteration(abase, bbase, cbase, /* FIXME: ugly */ locemfloatstruct->arraysize, locemfloatstruct->loops); iterations += 1.0; - } while ( TicksToSecs(accumtime) < locemfloatstruct->request_secs ); + } while (TicksToSecs(accumtime) < locemfloatstruct->request_secs); /* ** Clean up, calculate results, and go home. @@ -112,7 +111,7 @@ void DoEmFloat(void) { locemfloatstruct->emflops = (iterations * (double)locemfloatstruct->loops) / (double)TicksToFracSecs(accumtime); - if ( locemfloatstruct->adjust == 0 ) { + if (locemfloatstruct->adjust == 0) { locemfloatstruct->adjust = 1; } } -- cgit v1.2.3