diff options
author | Matt Turner <mattst88@gmail.com> | 2008-11-15 03:17:35 +0000 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2008-11-15 03:17:35 +0000 |
commit | 04741fb6181f8cc1ebc6f527d8d22840d019eb7b (patch) | |
tree | 793fb68beeb2309d424c9cd20b9f54f6a9dee166 /fpemulation.c | |
parent | c0a8896d9a90e59429b6fecadc397ead42974f59 (diff) |
-- Remove structs completely
-- results is now a static variable in each benchmark
-- added get*Score routines
-- finally got rid of nmglobal.h completely
-- removed more useless stuff
git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@53 0d43b9a7-5ab2-4d7b-af9d-f64450cef757
Diffstat (limited to 'fpemulation.c')
-rw-r--r-- | fpemulation.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/fpemulation.c b/fpemulation.c index b0c5459..3536d77 100644 --- a/fpemulation.c +++ b/fpemulation.c @@ -6,7 +6,7 @@ #include <limits.h> #include <time.h> -#include "nmglobal.h" +#include "cleanbench.h" #include "randnum.h" #include "emfloat.h" @@ -24,12 +24,14 @@ */ #define LOOP_MAX 500000L -#define ARRAY_SIZE 3000L +#define ARRAY_SIZE 3000 static clock_t DoEmFloatIteration(InternalFPF *abase, InternalFPF *bbase, InternalFPF *cbase, unsigned long loops); static void SetupCPUEmFloatArrays(InternalFPF *abase, InternalFPF *bbase); +static double results; + /************** ** DoEmFloat ** *************** @@ -40,7 +42,6 @@ void DoEmFloat(void) { const char* context = "CPU:Floating Emulation"; - EmFloatStruct* locemfloatstruct = &global_emfloatstruct; InternalFPF* abase = NULL; InternalFPF* bbase = NULL; InternalFPF* cbase = NULL; @@ -117,7 +118,7 @@ DoEmFloat(void) free(bbase); free(cbase); - locemfloatstruct->results = (double)(iterations * loops * CLOCKS_PER_SEC) / (double)total_time; + results = (double)(iterations * loops * CLOCKS_PER_SEC) / (double)total_time; } /*********************** @@ -205,3 +206,9 @@ SetupCPUEmFloatArrays(InternalFPF *abase, InternalFPF *bbase) DivideInternalFPF(&locFPF1,&locFPF2,bbase+i); } } + +inline double +getEmFloatScore(void) +{ + return results; +} |