Merge pull request #235 from libtom/tune-fixes Tune fixes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
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]);