diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-11-06 00:30:33 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-11-06 00:30:33 +0100 |
commit | 99aa9319c8d02751484eb24057116545481c1742 (patch) | |
tree | 428d95fe1bef2284902e4f895703d8d47cd3eddd /src | |
parent | remove gcov flags (diff) | |
download | libkeccak-99aa9319c8d02751484eb24057116545481c1742.tar.gz libkeccak-99aa9319c8d02751484eb24057116545481c1742.tar.bz2 libkeccak-99aa9319c8d02751484eb24057116545481c1742.tar.xz |
m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/benchmark-flags | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/benchmark-flags b/src/benchmark-flags index de54d42..9c8c4ba 100755 --- a/src/benchmark-flags +++ b/src/benchmark-flags @@ -19,7 +19,9 @@ set -e export LD_LIBRARY_PATH=bin -TRIES=10 +if [ "${TRIES}" = "" ]; then + TRIES=10 +fi # List all flags that affect the object files list_test_flags () @@ -36,6 +38,8 @@ base_flags='-march=native -O0' test_flags=" $(echo $(list_test_flags)) " pass=1 +exec 4>.benchmark.so.far + while true; do exec 3>.benchmarks @@ -55,20 +59,26 @@ while true; do ! grep ^error .benchmarks >/dev/null 2>/dev/null - good_flag="$(sort < .benchmarks | cut -d ' ' -f 2 | sed 1q)" - if [ "${good_flag}" = zzz ]; then + good_flag="$(sort -n < .benchmarks | cut -d ' ' -f 2 | sed 1q)" + if [ "${good_flag}" = zzz ] || [ $pass = 2 ]; then if [ $pass = 1 ]; then pass=2 base_flags="$(echo "${base_flags}" | sed -e 's/ -O0//')" test_flags="-O0 -O1 -O2 -O3 -Ofast -Os" else + if [ ! "${good_flag}" = zzz ]; then + base_flags="${base_flags} ${good_flag}" + echo "${good_flag}" >&4 + fi echo echo echo "Good flags:" echo "${base_flags}" + exec 4<&- exit 0 fi else + echo "${good_flag}" >&4 base_flags="${base_flags} ${good_flag}" test_flags="$(echo "${test_flags}" | sed -e "s/ ${good_flag} / /")" fi |