From 4f4a74e76d0b7dfea9904cbb43a8905cf80768c6 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Sat, 14 Feb 2009 21:16:30 +0000 Subject: More Cleanups, found using icc git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@92 0d43b9a7-5ab2-4d7b-af9d-f64450cef757 --- cleanbench.c | 15 +-------------- cleanbench.h | 17 +++++++++++++++++ emfloat.c | 2 +- hardware.c | 4 +++- huffman.c | 6 ++---- linear.c | 8 ++++---- neural.c | 39 --------------------------------------- randnum.c | 2 ++ 8 files changed, 30 insertions(+), 63 deletions(-) diff --git a/cleanbench.c b/cleanbench.c index 703e787..0b97ad0 100644 --- a/cleanbench.c +++ b/cleanbench.c @@ -10,19 +10,6 @@ #include "cleanbench.h" #include "randnum.h" -double DoNumSort(void); -double DoStringSort(void); -double DoBitops(void); -double DoEmFloat(void); -double DoFourier(void); -double DoAssign(void); -double DoIDEA(void); -double DoHuffman(void); -double DoNNET(void); -double DoLU(void); - -void hardware(void); - static bool bench_with_confidence(int benchmark, double* average, double* std_dev, int* runs); static bool calc_confidence(double scores[], int runs, double* c_half_interval, double* average, double* std_dev); @@ -100,7 +87,7 @@ main() double average; /* Average of benchmark results */ double std_dev; /* Standard deviation of benchmark results */ int runs; /* # of runs */ - int benchmark = 0; + int benchmark = FOURIER; puts( "TEST : Iterations/sec. : Old Index : New Index\n" " : : Pentium 90 : AMD K6/233\n" diff --git a/cleanbench.h b/cleanbench.h index 7bf2833..13b0db2 100644 --- a/cleanbench.h +++ b/cleanbench.h @@ -1,2 +1,19 @@ #define MINIMUM_TICKS 60 #define MINIMUM_SECONDS 5 /* Minimum number of seconds to run each test */ + +double DoNumSort(void); +double DoStringSort(void); +double DoBitops(void); +double DoEmFloat(void); +double DoFourier(void); +double DoAssign(void); +double DoIDEA(void); +double DoHuffman(void); +double DoNNET(void); +double DoLU(void); + +void hardware(void); + +int randnum(int val); +int randwc(int num); +int abs_randwc(int num); diff --git a/emfloat.c b/emfloat.c index 4a68fe2..4d9754d 100644 --- a/emfloat.c +++ b/emfloat.c @@ -180,7 +180,7 @@ uint32_t accum; /* Accumulator */ accum=(uint32_t)b; accum-=(uint32_t)c; accum-=(uint32_t)*borrow; -*borrow=(uint32_t)((accum & 0x00010000) ? 1 : 0); /* New borrow */ +*borrow=(accum & 0x00010000) ? 1 : 0; /* New borrow */ *a=(uint16_t)(accum & 0xFFFF); return; } diff --git a/hardware.c b/hardware.c index dc29355..de2ad68 100644 --- a/hardware.c +++ b/hardware.c @@ -4,6 +4,8 @@ #include +#include "cleanbench.h" + #define BUF_SIZ 1024 /****************** @@ -69,7 +71,7 @@ static void readProcCpuInfo (char *model, char *cache) { break; } snprintf(model, BUF_SIZ, format, info->hardware_platform, info->architecture, info->frequency); - snprintf(cache, BUF_SIZ, "%d KB", info->cache); + snprintf(cache, BUF_SIZ, "%u KB", info->cache); proccpuinfo_free(info); } diff --git a/huffman.c b/huffman.c index a1141a8..596de6c 100644 --- a/huffman.c +++ b/huffman.c @@ -42,7 +42,6 @@ typedef struct { } huff_node; static huff_node *hufftree; /* The huffman tree */ -static long plaintextlen; /* Length of plaintext */ static void create_text_line(char *dt,long nchars); static void create_text_block(char *tb, unsigned long tblen, @@ -103,7 +102,6 @@ DoHuffman(void) randnum((int32_t)13); create_text_block(plaintext,ARRAY_SIZE-1,(unsigned short)500); plaintext[ARRAY_SIZE-1L]='\0'; - plaintextlen=ARRAY_SIZE; /* ** See if we need to perform self adjustment loop. @@ -282,7 +280,7 @@ for(j=0;j big) big=fabs(a[i][j]); /* Bail out on singular matrix */ - if(big==(double)0.0) return(0); + if(big == 0.0) return 0; LUtempvv[i]=1.0/big; } @@ -337,7 +337,7 @@ for(j=0;j +#include "cleanbench.h" + /**************************** ** RANDOM NUMBER GENERATOR ** ***************************** -- cgit v1.2.3