From 10e698ace1542d5351935fcb5216af5514a4f7b0 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Thu, 13 Nov 2008 22:36:25 +0000 Subject: -- Replace LINUX define with standard __linux__ -- Remove more useless prototypes from useless nbench1.h git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@18 0d43b9a7-5ab2-4d7b-af9d-f64450cef757 --- Makefile | 162 +++++++------------------------------------------------------- nbench0.c | 4 +- nbench1.h | 11 ----- sysspec.c | 10 ++-- sysspec.h | 2 +- 5 files changed, 25 insertions(+), 164 deletions(-) diff --git a/Makefile b/Makefile index 0bfa36a..e73cb87 100644 --- a/Makefile +++ b/Makefile @@ -1,193 +1,65 @@ -# Makefile for nbench, December 11, 1997, Uwe F. Mayer -# Updated February 18, 2003 - default: nbench -########################################################################## -# If you are using gcc-2.7.2.3 or earlier: -# The optimizer of gcc has a bug and in general you should not specify -# -funroll-loops together with -O (or -O2, -O3, etc.) -# This bug is supposed to be fixed with release 2.8 of gcc. -# -# This bug does NOT seem to have an effect on the correct compilation -# of this benchmark suite on my Linux box. However, it leads to -# the dreaded "internal compiler error" message on our alpha -# running DEC Unix 4.0b. The Linux-binary that was used to obtain -# the baseline results was nevertheless compiled with -# CFLAGS = -s -static -Wall -O3 -fomit-frame-pointer -funroll-loops -# -# You should leave -static in the CFLAGS so that your sysinfo can be -# compiled into the executable. - ICC=icc GCC=gcc - -# generic options for gcc -#CFLAGS=-O3 -mcpu=ev67 -mieee -funroll-loops -ftree-vectorize -fprefetch-loop-arrays -pipe -static -msmall-data -msmall-text -#CFLAGS=-O3 -mcpu=ev67 -mieee -pipe -msmall-data -msmall-text -funroll-loops -ftree-vectorize -static GCCFLAGS=-O3 -march=k8 -msse3 -ftree-vectorize -funroll-loops -pipe -static -#GCCFLAGS=-fast -unroll 0 -inline speed ICCFLAGS=-O2 -ip -xP -gcc -static LINKFLAGS= -# if your gcc lets you do it, then try this one -#CFLAGS = -s -static -Wall -O3 -fomit-frame-pointer -funroll-loops - -# for gcc on an older Pentium type processor you can try the following -#CFLAGS = -s -static -O3 -fomit-frame-pointer -Wall -m486 \ -# -fforce-addr -fforce-mem -falign-loops=2 -falign-functions=2 \ -# -falign-jumps=2 -funroll-loops - -# for a newer gcc on a newer Pentium type processor you can try the following -#CFLAGS = -s -static -O3 -fomit-frame-pointer -Wall -march=i686 \ -# -fforce-addr -fforce-mem -falign-loops=2 -falign-functions=2 \ -# -falign-jumps=2 -funroll-loops - -# for a newer gcc on an Athlon XP type processor you can try the following -#CFLAGS = -s -static -O3 -fomit-frame-pointer -Wall -march=athlon-xp \ -# -fforce-addr -fforce-mem -falign-loops=2 -falign-functions=2 \ -# -falign-jumps=2 -funroll-loops - -# For debugging using gcc -#CFLAGS = -g -O3 -Wall -DDEBUG - -########################################################################## -# For Linux machines with more than one binary format. -# The default binaries, depends on your system whether it's elf or aout. -MACHINE= -# a.out code for linux on an elf machine -#MACHINE= -bi486-linuxaout -# elf code for linux on an a.out machine -#MACHINE= -bi486-linuxelf -# if you want a different compiler version and different binaries, for example -#MACHINE= -V2.7.2 -bi486-linuxaout - -########################################################################## -# Read the file README.nonlinux if you are not using Linux - -# for DEC Unix using cc you can try -#CC = cc -#CFLAGS = -O3 -#LINKFLAGS = -s -non_shared - -# for SunOS using cc -#CC = cc -#CFLAGS = -O3 -s - -# for DEC Ultrix using cc -#CC = cc -#CFLAGS = -O2 -#LINKFLAGS = -s - -# for a Mac with OsX and the Darwin environment -#CC = cc -#CFLAGS = -O3 -DOSX - -# For debugging using cc -#CC = cc -#CFLAGS = -g -DDEBUG - -########################################################################## -# If your system does not understand the system command "uname -s -r" -# then comment this out - -# NO_UNAME= -DNO_UNAME - -########################################################################## -# For any Unix flavor you need -DLINUX -# You also need -DLINUX to get the new indices - -DEFINES=$(NO_UNAME) -DLINUX - -########################################################################## -# For LINUX-like systems with gcc sysinfoc.c: Makefile - ./sysinfo.sh $(GCC) $(DEFINES) $(GCCFLAGS) + ./sysinfo.sh $(GCC) $(GCCFLAGS) sysinfo.c: Makefile - ./sysinfo.sh $(GCC) $(DEFINES) $(GCCFLAGS) - -########################################################################## -# For non-LINUX systems -# Edit the files sysinfo.c and sysinfoc.c to include your system information -# and take sysinfo.c and sysinfoc.c out of the dependencies for nbench0.o + ./sysinfo.sh $(GCC) $(GCCFLAGS) hardware.o: hardware.c hardware.h Makefile - $(GCC) $(DEFINES) $(GCCFLAGS) -c hardware.c + $(GCC) $(GCCFLAGS) -c hardware.c nbench0.o: nbench0.h nbench0.c nmglobal.h hardware.h Makefile sysinfo.c sysinfoc.c - $(GCC) $(DEFINES) $(GCCFLAGS) -c nbench0.c -# Segfault before first test + $(GCC) $(GCCFLAGS) -c nbench0.c emfloat.o: emfloat.h emfloat.c nmglobal.h Makefile - $(GCC) $(DEFINES) $(GCCFLAGS) -c emfloat.c + $(GCC) $(GCCFLAGS) -c emfloat.c randnum.o: randnum.c Makefile - $(GCC) $(DEFINES) $(GCCFLAGS) -c randnum.c + $(GCC) $(GCCFLAGS) -c randnum.c numsort.o: numsort.c - $(GCC) $(DEFINES) $(GCCFLAGS) -c numsort.c -# gcc - 2.95 -# ccc - 5.08 + $(GCC) $(GCCFLAGS) -c numsort.c stringsort.o: stringsort.c - $(GCC) $(DEFINES) $(GCCFLAGS) -c stringsort.c -# gcc - 6.77 -# ccc - 7.24 + $(GCC) $(GCCFLAGS) -c stringsort.c bitfield.o: bitfield.c - $(GCC) $(DEFINES) $(GCCFLAGS) -c bitfield.c -# gcc - 4.93, 4.90, 4.93, 4.93 -# ccc - 4.79, 4.85, 4.81, + $(GCC) $(GCCFLAGS) -c bitfield.c fpemulation.o: fpemulation.c - $(GCC) $(DEFINES) $(GCCFLAGS) -c fpemulation.c -# gcc - 13.90 -# ccc - 13.90 + $(GCC) $(GCCFLAGS) -c fpemulation.c fourier.o: fourier.c - $(GCC) $(DEFINES) $(GCCFLAGS) -c fourier.c -# gcc - 15.96 -# ccc - 19.30 + $(GCC) $(GCCFLAGS) -c fourier.c assignment.o: assignment.c - $(GCC) $(DEFINES) $(GCCFLAGS) -c assignment.c -# gcc - 16.51 -# ccc - 7.98 + $(GCC) $(GCCFLAGS) -c assignment.c idea.o: idea.c - $(GCC) $(DEFINES) $(GCCFLAGS) -c idea.c -# gcc - 8.79 -# ccc - 9.10 + $(GCC) $(GCCFLAGS) -c idea.c huffman.o: huffman.c - $(GCC) $(DEFINES) $(GCCFLAGS) -c huffman.c -# $(GCC) $(DEFINES) -O1 -host -unroll 0 -inline speed -c huffman.c -g3 -# $(GCC) $(DEFINES) $(GCCFLAGS) -c huffman.c -g3 -# gcc - 6.94 -# ccc - segfault -# ccc -O1 -host - 5.14 -# ccc -O2 -host - segfault -# ccc -O1 -host -unroll 0 -inline speed - 5.95 + $(GCC) $(GCCFLAGS) -c huffman.c neural.o: neural.c - $(GCC) $(DEFINES) $(GCCFLAGS) -c neural.c -# gcc - 12.00 -# ccc - 14.20 + $(GCC) $(GCCFLAGS) -c neural.c linear.o: linear.c - $(GCC) $(DEFINES) $(GCCFLAGS) -c linear.c -# gcc - 16.38 -# ccc - 23.29 + $(GCC) $(GCCFLAGS) -c linear.c sysspec.o: sysspec.h sysspec.c nmglobal.h Makefile - $(GCC) $(DEFINES) $(GCCFLAGS) -c sysspec.c + $(GCC) $(GCCFLAGS) -c sysspec.c nbench: emfloat.o randnum.o nbench0.o numsort.o sysspec.o hardware.o stringsort.o bitfield.o fpemulation.o fourier.o assignment.o idea.o huffman.o neural.o linear.o $(GCC) emfloat.o randnum.o nbench0.o numsort.o sysspec.o hardware.o stringsort.o bitfield.o fpemulation.o fourier.o assignment.o idea.o huffman.o neural.o linear.o -o nbench -lm -########################################################################## - clean: - /bin/rm -f *.o nbench sysinfo.c sysinfoc.c diff --git a/nbench0.c b/nbench0.c index 0990baf..c60fb80 100644 --- a/nbench0.c +++ b/nbench0.c @@ -159,7 +159,7 @@ if(global_allstats) sizeof(uint16_t), sizeof(uint32_t), sizeof(int32_t)); -#ifdef LINUX /* FIXME: do this a better way */ +#ifdef __linux__ #include "sysinfo.c" #else printf("**%s\n",sysname); @@ -237,7 +237,7 @@ if(global_custrun==0) printf("FLOATING-POINT INDEX: %.3f\n", pow(fpindex,(double).33333)); puts("Baseline (MSDOS*) : Pentium* 90, 256 KB L2-cache, Watcom* compiler 10.0"); -#ifdef LINUX +#ifdef __linux__ puts("==============================LINUX DATA BELOW==============================="); hardware(write_to_file, global_ofile); #include "sysinfoc.c" diff --git a/nbench1.h b/nbench1.h index 2537698..4cc8465 100644 --- a/nbench1.h +++ b/nbench1.h @@ -22,12 +22,6 @@ ** from the use of this code or the results obtained from using ** this code. */ -#include - -/* -** DEFINES -*/ -/* #define DEBUG */ /* ** EXTERNALS @@ -45,11 +39,6 @@ extern HuffStruct global_huffstruct; extern NNetStruct global_nnetstruct; extern LUStruct global_lustruct; -/* External PROTOTYPES */ -extern int32_t randwc(int32_t num); -extern uint32_t abs_randwc(uint32_t num); -extern int32_t randnum(int32_t lngval); - extern unsigned long StartStopwatch(); extern unsigned long StopStopwatch(unsigned long startticks); extern unsigned long TicksToSecs(unsigned long tickamount); diff --git a/sysspec.c b/sysspec.c index 402294d..f4b5bf1 100644 --- a/sysspec.c +++ b/sysspec.c @@ -140,7 +140,7 @@ close(fhandle); return; #endif -#ifdef LINUX +#ifdef __linux__ FILE *fhandle; /* File handle used internally */ fhandle=fopen(filename,"w"); @@ -189,7 +189,7 @@ return(fhandle); #endif -#ifdef LINUX +#ifdef __linux__ FILE *bmOpenFile(char *fname, /* File name */ int *errorcode) /* Error code returned */ @@ -227,7 +227,7 @@ close(fhandle); return; } #endif -#ifdef LINUX +#ifdef __linux__ void CloseFile(FILE *fhandle, /* File handle */ int *errorcode) /* Returned error code */ { @@ -283,7 +283,7 @@ if(readcode==-1) return; } #endif -#ifdef LINUX +#ifdef __linux__ void readfile(FILE *fhandle, /* File handle */ unsigned long offset, /* Offset into file */ unsigned long nbytes, /* # of bytes to read */ @@ -368,7 +368,7 @@ return; } #endif -#ifdef LINUX +#ifdef __linux__ void writefile(FILE *fhandle, /* File handle */ unsigned long offset, /* Offset into file */ diff --git a/sysspec.h b/sysspec.h index 2b70321..8647495 100644 --- a/sysspec.h +++ b/sysspec.h @@ -97,7 +97,7 @@ int RemoveMemArray(unsigned long adj_addr,unsigned long *true_addr); void CreateFile(char *filename, int *errorcode); -#ifdef LINUX +#ifdef __linux__ FILE *bmOpenFile(char *fname, int *errorcode); -- cgit v1.2.3