Skip to content

Add benchmarks for floating point math #618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ set -eux

target="${1:-}"

if [ -z "${1:-}" ]; then
export RUST_BACKTRACE="${RUST_BACKTRACE:-full}"

if [ -z "$target" ]; then
host_target=$(rustc -vV | awk '/^host/ { print $2 }')
echo "Defaulted to host target $host_target"
target="$host_target"
Expand All @@ -30,6 +32,8 @@ else
$run --features no-asm --release
$run --features no-f16-f128
$run --features no-f16-f128 --release
$run --benches
$run --benches --release
fi

if [ "${TEST_VERBATIM:-}" = "1" ]; then
Expand Down
48 changes: 47 additions & 1 deletion testcrate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ path = ".."
default-features = false
features = ["public-test-deps"]

[dev-dependencies]
criterion = { version = "0.5.1", default-features = false, features = ["cargo_bench_support"] }
paste = "1.0.15"

[target.'cfg(all(target_arch = "arm", not(any(target_env = "gnu", target_env = "musl")), target_os = "linux"))'.dev-dependencies]
test = { git = "https://github.com/japaric/utest" }
utest-cortex-m-qemu = { default-features = false, git = "https://github.com/japaric/utest" }
Expand All @@ -34,6 +38,48 @@ no-f16-f128 = ["compiler_builtins/no-f16-f128"]
mem = ["compiler_builtins/mem"]
mangled-names = ["compiler_builtins/mangled-names"]
# Skip tests that rely on f128 symbols being available on the system
no-sys-f128 = ["no-sys-f128-int-convert"]
no-sys-f128 = ["no-sys-f128-int-convert", "no-sys-f16-f128-convert"]
# Some platforms have some f128 functions but everything except integer conversions
no-sys-f128-int-convert = []
no-sys-f16-f128-convert = []
# Skip tests that rely on f16 symbols being available on the system
no-sys-f16 = []

# Enable report generation without bringing in more dependencies by default
benchmarking-reports = ["criterion/plotters", "criterion/html_reports"]

[[bench]]
name = "float_add"
harness = false

[[bench]]
name = "float_sub"
harness = false

[[bench]]
name = "float_mul"
harness = false

[[bench]]
name = "float_div"
harness = false

[[bench]]
name = "float_cmp"
harness = false

[[bench]]
name = "float_conv"
harness = false

[[bench]]
name = "float_extend"
harness = false

[[bench]]
name = "float_trunc"
harness = false

[[bench]]
name = "float_pow"
harness = false
Loading