summaryrefslogtreecommitdiff
path: root/fpemulation.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2008-11-12 22:51:00 +0000
committerMatt Turner <mattst88@gmail.com>2008-11-12 22:51:00 +0000
commitb50243af303373a0af9185dd12d86b21990dde14 (patch)
tree75584551061a95fdea4076ace750ac0dd09d01b4 /fpemulation.c
parent8a639cb06e75d496a33f609b049dbf9e6145befc (diff)
-- 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
Diffstat (limited to 'fpemulation.c')
-rw-r--r--fpemulation.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/fpemulation.c b/fpemulation.c
index b9b6235..26ce951 100644
--- a/fpemulation.c
+++ b/fpemulation.c
@@ -1,9 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
-/*
-#include <string.h>
-#include <strings.h>
-#include <math.h>*/
+#include <stdint.h>
+#include <math.h>
+
#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;
}
}