|
| 1 | +#!/usr/bin/env bash |
| 2 | +# |
| 3 | +# Copyright Christopher Kormanyos 2020 - 2025. |
| 4 | +# Distributed under the Boost Software License, |
| 5 | +# Version 1.0. (See accompanying file LICENSE_1_0.txt |
| 6 | +# or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 7 | +# |
| 8 | + |
| 9 | +if [[ "$1" != "" ]]; then |
| 10 | + STD="$1" |
| 11 | +else |
| 12 | + STD=c++14 |
| 13 | +fi |
| 14 | + |
| 15 | +GCC=rl78-unknown-elf-g++ |
| 16 | + |
| 17 | +wflags="-Wextra -Wpedantic -Wmain -Wundef -Wconversion -Wsign-conversion -Wunused-parameter -Wuninitialized -Wmissing-declarations -Wshadow -Wunreachable-code -Wswitch-default -Wswitch-enum -Wcast-align -Wmissing-include-dirs -Winit-self -Wfloat-equal -Wdouble-promotion" |
| 18 | + |
| 19 | +mkdir -p bin |
| 20 | + |
| 21 | +rm -f ./bin/*.* |
| 22 | + |
| 23 | +echo run benchmarks with $GCC and language standard $STD |
| 24 | +echo |
| 25 | + |
| 26 | +$GCC -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -mcpu=g13 -mmul=g13 -fno-inline-functions -ffreestanding -I./src/util/STL -I./src/mcal/rl78 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_COMPLEX -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_complex.cpp ./src/mcal/mcal_gcc_cxx_completion.cpp -nostdlib -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_complex.map -T ./target/micros/rl78/make/rl78.ld -o ./bin/app_benchmark_complex.elf |
| 27 | +$GCC -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -mcpu=g13 -mmul=g13 -fno-inline-functions -ffreestanding -I./src/util/STL -I./src/mcal/rl78 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_CRC -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_crc.cpp ./src/mcal/mcal_gcc_cxx_completion.cpp -nostdlib -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_crc.map -T ./target/micros/rl78/make/rl78.ld -o ./bin/app_benchmark_crc.elf |
| 28 | +$GCC -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -mcpu=g13 -mmul=g13 -fno-inline-functions -ffreestanding -I./src/util/STL -I./src/mcal/rl78 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_FAST_MATH -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_fast_math.cpp ./src/mcal/mcal_gcc_cxx_completion.cpp -nostdlib -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_fast_math.map -T ./target/micros/rl78/make/rl78.ld -o ./bin/app_benchmark_fast_math.elf |
| 29 | +$GCC -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -mcpu=g13 -mmul=g13 -fno-inline-functions -ffreestanding -I./src/util/STL -I./src/mcal/rl78 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_FILTER -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_filter.cpp ./src/mcal/mcal_gcc_cxx_completion.cpp -nostdlib -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_filter.map -T ./target/micros/rl78/make/rl78.ld -o ./bin/app_benchmark_filter.elf |
| 30 | +$GCC -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -mcpu=g13 -mmul=g13 -fno-inline-functions -ffreestanding -I./src/util/STL -I./src/mcal/rl78 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_FIXED_POINT -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_fixed_point.cpp ./src/mcal/mcal_gcc_cxx_completion.cpp -nostdlib -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_fixed_point.map -T ./target/micros/rl78/make/rl78.ld -o ./bin/app_benchmark_fixed_point.elf |
| 31 | +$GCC -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -mcpu=g13 -mmul=g13 -fno-inline-functions -ffreestanding -I./src/util/STL -I./src/mcal/rl78 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_FLOAT -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_float.cpp ./src/mcal/mcal_gcc_cxx_completion.cpp -nostdlib -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_float.map -T ./target/micros/rl78/make/rl78.ld -o ./bin/app_benchmark_float.elf |
| 32 | +$GCC -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -mcpu=g13 -mmul=g13 -fno-inline-functions -ffreestanding -I./src/util/STL -I./src/mcal/rl78 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_HASH -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_hash.cpp ./src/mcal/mcal_gcc_cxx_completion.cpp -nostdlib -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_hash.map -T ./target/micros/rl78/make/rl78.ld -o ./bin/app_benchmark_hash.elf |
| 33 | +$GCC -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -mcpu=g13 -mmul=g13 -fno-inline-functions -ffreestanding -I./src/util/STL -I./src/mcal/rl78 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_NONE -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_none.cpp ./src/mcal/mcal_gcc_cxx_completion.cpp -nostdlib -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_none.map -T ./target/micros/rl78/make/rl78.ld -o ./bin/app_benchmark_none.elf |
| 34 | +$GCC -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -mcpu=g13 -mmul=g13 -fno-inline-functions -ffreestanding -I./src/util/STL -I./src/mcal/rl78 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_PI_AGM -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_pi_agm.cpp ./src/mcal/mcal_gcc_cxx_completion.cpp -nostdlib -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_pi_agm.map -T ./target/micros/rl78/make/rl78.ld -o ./bin/app_benchmark_pi_agm.elf |
| 35 | +$GCC -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -mcpu=g13 -mmul=g13 -fno-inline-functions -ffreestanding -I./src/util/STL -I./src/mcal/rl78 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_PI_SPIGOT -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_pi_spigot.cpp ./src/mcal/mcal_gcc_cxx_completion.cpp -nostdlib -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_pi_spigot.map -T ./target/micros/rl78/make/rl78.ld -o ./bin/app_benchmark_pi_spigot.elf |
| 36 | +$GCC -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -mcpu=g13 -mmul=g13 -fno-inline-functions -ffreestanding -I./src/util/STL -I./src/mcal/rl78 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_PI_SPIGOT_SINGLE -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_pi_spigot_single.cpp ./src/mcal/mcal_gcc_cxx_completion.cpp -nostdlib -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_pi_spigot_single.map -T ./target/micros/rl78/make/rl78.ld -o ./bin/app_benchmark_pi_spigot_single.elf |
| 37 | +$GCC -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -mcpu=g13 -mmul=g13 -fno-inline-functions -ffreestanding -I./src/util/STL -I./src/mcal/rl78 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_SOFT_DOUBLE_H2F1 -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_soft_double_h2f1.cpp ./src/mcal/mcal_gcc_cxx_completion.cpp -nostdlib -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_soft_double_h2f1.map -T ./target/micros/rl78/make/rl78.ld -o ./bin/app_benchmark_soft_double_h2f1.elf |
| 38 | +$GCC -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -mcpu=g13 -mmul=g13 -fno-inline-functions -ffreestanding -I./src/util/STL -I./src/mcal/rl78 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_WIDE_DECIMAL -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_wide_decimal.cpp ./src/mcal/mcal_gcc_cxx_completion.cpp -nostdlib -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_wide_decimal.map -T ./target/micros/rl78/make/rl78.ld -o ./bin/app_benchmark_wide_decimal.elf |
| 39 | +$GCC -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -mcpu=g13 -mmul=g13 -fno-inline-functions -ffreestanding -I./src/util/STL -I./src/mcal/rl78 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_WIDE_INTEGER -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_wide_integer.cpp ./src/mcal/mcal_gcc_cxx_completion.cpp -nostdlib -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_wide_integer.map -T ./target/micros/rl78/make/rl78.ld -o ./bin/app_benchmark_wide_integer.elf |
| 40 | +$GCC -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -mcpu=g13 -mmul=g13 -fno-inline-functions -ffreestanding -I./src/util/STL -I./src/mcal/rl78 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_TRAPEZOID_INTEGRAL -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_trapezoid_integral.cpp ./src/mcal/mcal_gcc_cxx_completion.cpp -nostdlib -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_trapezoid_integral.map -T ./target/micros/rl78/make/rl78.ld -o ./bin/app_benchmark_trapezoid_integral.elf |
| 41 | +$GCC -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -Wzero-as-null-pointer-constant -mcpu=g13 -mmul=g13 -fno-inline-functions -ffreestanding -I./src/util/STL -I./src/mcal/rl78 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_HASH_SHA256 -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_hash_sha256.cpp ./src/mcal/mcal_gcc_cxx_completion.cpp -nostdlib -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_hash_sha256.map -T ./target/micros/rl78/make/rl78.ld -o ./bin/app_benchmark_hash_sha256.elf |
| 42 | + |
| 43 | +echo check existences of ELF-files and map-files |
| 44 | +echo |
| 45 | + |
| 46 | +ls -la ./bin/app_benchmark_complex.elf ./bin/app_benchmark_complex.map |
| 47 | +result_ls_complex=$? |
| 48 | + |
| 49 | +ls -la ./bin/app_benchmark_crc.elf ./bin/app_benchmark_crc.map |
| 50 | +result_ls_crc=$? |
| 51 | + |
| 52 | +ls -la ./bin/app_benchmark_fast_math.elf ./bin/app_benchmark_fast_math.map |
| 53 | +result_ls_fast_math=$? |
| 54 | + |
| 55 | +ls -la ./bin/app_benchmark_filter.elf ./bin/app_benchmark_filter.map |
| 56 | +result_ls_filter=$? |
| 57 | + |
| 58 | +ls -la ./bin/app_benchmark_fixed_point.elf ./bin/app_benchmark_fixed_point.map |
| 59 | +result_ls_fixed_point=$? |
| 60 | + |
| 61 | +ls -la ./bin/app_benchmark_float.elf ./bin/app_benchmark_float.map |
| 62 | +result_ls_float=$? |
| 63 | + |
| 64 | +ls -la ./bin/app_benchmark_hash.elf ./bin/app_benchmark_hash.map |
| 65 | +result_ls_hash=$? |
| 66 | + |
| 67 | +ls -la ./bin/app_benchmark_none.elf ./bin/app_benchmark_none.map |
| 68 | +result_ls_none=$? |
| 69 | + |
| 70 | +ls -la ./bin/app_benchmark_pi_agm.elf ./bin/app_benchmark_pi_agm.map |
| 71 | +result_ls_pi_agm=$? |
| 72 | + |
| 73 | +ls -la ./bin/app_benchmark_pi_spigot.elf ./bin/app_benchmark_pi_spigot.map |
| 74 | +result_ls_pi_spigot=$? |
| 75 | + |
| 76 | +ls -la ./bin/app_benchmark_pi_spigot_single.elf ./bin/app_benchmark_pi_spigot_single.map |
| 77 | +result_ls_pi_spigot_single=$? |
| 78 | + |
| 79 | +ls -la ./bin/app_benchmark_soft_double_h2f1.elf ./bin/app_benchmark_soft_double_h2f1.map |
| 80 | +result_ls_soft_double_h2f1=$? |
| 81 | + |
| 82 | +ls -la ./bin/app_benchmark_trapezoid_integral.elf ./bin/app_benchmark_trapezoid_integral.map |
| 83 | +result_ls_trapezoid_integral=$? |
| 84 | + |
| 85 | +ls -la ./bin/app_benchmark_wide_decimal.elf ./bin/app_benchmark_wide_decimal.map |
| 86 | +result_ls_wide_decimal=$? |
| 87 | + |
| 88 | +ls -la ./bin/app_benchmark_wide_integer.elf ./bin/app_benchmark_wide_integer.map |
| 89 | +result_ls_wide_integer=$? |
| 90 | + |
| 91 | +ls -la ./bin/app_benchmark_hash_sha256.elf ./bin/app_benchmark_hash_sha256.map |
| 92 | +result_ls_hash_sha256=$? |
| 93 | + |
| 94 | +echo "result_ls_complex : " "$result_ls_complex" |
| 95 | +echo "result_ls_crc : " "$result_ls_crc" |
| 96 | +echo "result_ls_fast_math : " "$result_ls_fast_math" |
| 97 | +echo "result_ls_filter : " "$result_ls_filter" |
| 98 | +echo "result_ls_fixed_point : " "$result_ls_fixed_point" |
| 99 | +echo "result_ls_float : " "$result_ls_float" |
| 100 | +echo "result_ls_hash : " "$result_ls_hash" |
| 101 | +echo "result_ls_none : " "$result_ls_none" |
| 102 | +echo "result_ls_pi_agm : " "$result_ls_pi_agm" |
| 103 | +echo "result_ls_pi_spigot : " "$result_ls_pi_spigot" |
| 104 | +echo "result_ls_pi_spigot_single : " "$result_ls_pi_spigot_single" |
| 105 | +echo "result_ls_soft_double_h2f1 : " "$result_ls_soft_double_h2f1" |
| 106 | +echo "result_ls_trapezoid_integral : " "$result_ls_trapezoid_integral" |
| 107 | +echo "result_ls_wide_decimal : " "$result_ls_wide_decimal" |
| 108 | +echo "result_ls_wide_integer : " "$result_ls_wide_integer" |
| 109 | +echo "result_ls_hash_sha256 : " "$result_ls_hash_sha256" |
| 110 | + |
| 111 | +echo verify result_total |
| 112 | +echo |
| 113 | + |
| 114 | +result_total=$((result_ls_complex+result_ls_crc+result_ls_fast_math+result_ls_filter+result_ls_fixed_point+result_ls_float+result_ls_hash+result_ls_none+result_ls_pi_agm+result_ls_pi_spigot+result_ls_pi_spigot_single+result_ls_soft_double_h2f1+result_ls_trapezoid_integral+result_ls_wide_decimal+result_ls_wide_integer+result_ls_hash_sha256)) |
| 115 | + |
| 116 | +echo "result_total : " "$result_total" |
| 117 | + |
| 118 | +exit $result_total |
0 commit comments