Commit f4d8b463f82bdcab38542d6f016c6939af9aac7e

Steffen Jaeckel 2019-05-07T16:33:44

Merge pull request #235 from libtom/tune-fixes Tune fixes

diff --git a/.gitignore b/.gitignore
index 6f24fa7..2063bae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,83 +1,87 @@
-# suppress compiler/linker output
-*.[oa]
-*.l[oa]
-*.obj
-*.gcda
-*.gcno
-*.gcov
-*.lib
-[Dd]ebug/
-[Rr]elease/
-/MSVC_*
-.libs/
-.coveralls.yml
-coverage*/
-coverage.info
-pre_gen/*
-
-# suppress output of build process and *nix/windows test executables
-timing
-timing.exe
-test
-test.exe
-mtest
-mtest.exe
-
-# ignore eclipse project files
-.cproject
-.project
-
-# special MS Visual Studio section
-# ignore non-compressed browse file (holds information for ClassView, IntelliSense and WizardBar)
-*.ncb
-# ignore user specific settings
-*.user
-*.suo
-*.userosscache
-*.sln.docstates
-*.userprefs
-# cache/options directory
-.vs/
-# Backup & report files from converting an old project file to a newer Visual Studio version
-_UpgradeReport_Files/
-Backup*/
-UpgradeLog*.XML
-UpgradeLog*.htm
-# Visual Studio 6 build log + workspace options file
-*.plg
-*.opt
-# visual studio profiler
-*.psess
-*.vsp
-*.vspx
-*.sap
-
-# ignore mpi.c generated by make
-mpi.c
-
-# ignore stuff generated by "make manual" and "make poster"
-*.aux
-*.dvi
-*.idx
-*.lof
-*.log
-*.out
-*.toc
-*.ilg
-*.ind
-*.pdf
-*.out
-tommath.tex
-libtommath.pc
-
-# ignore files generated by testme.sh
-gcc_errors_*.txt
-test_*.txt
-
-.#*
-*~
-*.bak
-*.orig
-*.asc
-*.tar.xz
-*.zip
+# suppress compiler/linker output
+*.[oa]
+*.l[oa]
+*.obj
+*.gcda
+*.gcno
+*.gcov
+*.lib
+[Dd]ebug/
+[Rr]elease/
+/MSVC_*
+.libs/
+.coveralls.yml
+coverage*/
+coverage.info
+pre_gen/*
+
+# suppress output of build process and *nix/windows test executables
+timing
+timing.exe
+test
+test.exe
+mtest
+mtest.exe
+
+# ignore eclipse project files
+.cproject
+.project
+
+# special MS Visual Studio section
+# ignore non-compressed browse file (holds information for ClassView, IntelliSense and WizardBar)
+*.ncb
+# ignore user specific settings
+*.user
+*.suo
+*.userosscache
+*.sln.docstates
+*.userprefs
+# cache/options directory
+.vs/
+# Backup & report files from converting an old project file to a newer Visual Studio version
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+# Visual Studio 6 build log + workspace options file
+*.plg
+*.opt
+# visual studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# ignore mpi.c generated by make
+mpi.c
+
+# ignore file generated by make tune
+tuning_list
+etc/tune
+
+# ignore stuff generated by "make manual" and "make poster"
+*.aux
+*.dvi
+*.idx
+*.lof
+*.log
+*.out
+*.toc
+*.ilg
+*.ind
+*.pdf
+*.out
+tommath.tex
+libtommath.pc
+
+# ignore files generated by testme.sh
+gcc_errors_*.txt
+test_*.txt
+
+.#*
+*~
+*.bak
+*.orig
+*.asc
+*.tar.xz
+*.zip
diff --git a/etc/.gitignore b/etc/.gitignore
deleted file mode 100644
index ff02786..0000000
--- a/etc/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-tune
diff --git a/etc/makefile b/etc/makefile
index 04a97fa..ce9cf06 100644
--- a/etc/makefile
+++ b/etc/makefile
@@ -12,15 +12,13 @@ pprime: pprime.o
 
 # portable [well requires clock()] tuning app
 tune: tune.o
-	# The actual benchmark program
 	$(CC) $(CFLAGS) tune.o $(LIBNAME) -o tune
-	# a small script to run it
-	/bin/sh tune_it.sh
+	./tune_it.sh
 
 test_standalone: tune.o
 	# The benchmark program works as a testtool, too
 	$(CC) $(CFLAGS) tune.o $(LIBNAME) -o test
-        
+
 # spits out mersenne primes
 mersenne: mersenne.o
 	$(CC) $(CFLAGS) mersenne.o $(LIBNAME) -o mersenne
@@ -28,7 +26,7 @@ mersenne: mersenne.o
 # finds DR safe primes for the given config
 drprime: drprime.o
 	$(CC) $(CFLAGS) drprime.o $(LIBNAME) -o drprime
-	
+
 # finds 2k safe primes for the given config
 2kprime: 2kprime.o
 	$(CC) $(CFLAGS) 2kprime.o $(LIBNAME) -o 2kprime
@@ -36,7 +34,7 @@ drprime: drprime.o
 mont: mont.o
 	$(CC) $(CFLAGS) mont.o $(LIBNAME) -o mont
 
-        
+
 clean:
 	rm -f *.log *.o *.obj *.exe pprime tune mersenne drprime mont 2kprime pprime.dat \
         tuning_list multiplying squaring test *.da *.dyn *.dpi *~
diff --git a/etc/makefile.icc b/etc/makefile.icc
index fc1512f..9217f7b 100644
--- a/etc/makefile.icc
+++ b/etc/makefile.icc
@@ -8,7 +8,7 @@ CFLAGS += -I../
 # -ax?   specifies make code specifically for ? but compatible with IA-32
 # -x?    specifies compile solely for ? [not specifically IA-32 compatible]
 #
-# where ? is 
+# where ? is
 #   K - PIII
 #   W - first P4 [Williamette]
 #   N - P4 Northwood
@@ -29,16 +29,14 @@ pprime: pprime.o
 	$(CC) pprime.o $(LIBNAME) -o pprime
 
 tune: tune.o
-	# The actual benchmark program
 	$(CC) $(CFLAGS) tune.o $(LIBNAME) -o tune
-	# a small script to run it
-	/bin/sh tune_it.sh
-	
+	./tune_it.sh
+
 # same app but using RDTSC for higher precision [requires 80586+], coff based gcc installs [e.g. ming, cygwin, djgpp]
 tune86: tune.c
 	nasm -f coff timer.asm
 	$(CC) -DX86_TIMER $(CFLAGS) tune.c timer.o  $(LIBNAME) -o tune86
-	
+
 # for cygwin
 tune86c: tune.c
 	nasm -f gnuwin32 timer.asm
@@ -48,7 +46,7 @@ tune86c: tune.c
 tune86l: tune.c
 	nasm -f elf -DUSE_ELF timer.asm
 	$(CC) -DX86_TIMER $(CFLAGS) tune.c timer.o $(LIBNAME) -o tune86l
-        
+
 # spits out mersenne primes
 mersenne: mersenne.o
 	$(CC) mersenne.o $(LIBNAME) -o mersenne
@@ -56,7 +54,7 @@ mersenne: mersenne.o
 # fines DR safe primes for the given config
 drprime: drprime.o
 	$(CC) drprime.o $(LIBNAME) -o drprime
-	
+
 # fines 2k safe primes for the given config
 2kprime: 2kprime.o
 	$(CC) 2kprime.o $(LIBNAME) -o 2kprime
@@ -64,6 +62,6 @@ drprime: drprime.o
 mont: mont.o
 	$(CC) mont.o $(LIBNAME) -o mont
 
-        
+
 clean:
 	rm -f *.log *.o *.obj *.exe pprime tune mersenne drprime tune86 tune86l mont 2kprime pprime.dat *.il tuning_list
diff --git a/etc/tune.c b/etc/tune.c
index 9038c78..0b1a6c7 100644
--- a/etc/tune.c
+++ b/etc/tune.c
@@ -495,6 +495,7 @@ int main(int argc, char **argv)
             i++;
             str = endptr + 1;
             TOOM_SQR_CUTOFF = (int)val;
+            break;
          case 'h':
          default:
             s_usage(argv[0]);