Skip to content

Commit a663f13

Browse files
committed
Add benchmarks for f128 division
1 parent 6bf0410 commit a663f13

File tree

2 files changed

+31
-5
lines changed

2 files changed

+31
-5
lines changed

testcrate/benches/float_div.rs

+27-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
#![cfg_attr(f128_enabled, feature(f128))]
2+
13
use compiler_builtins::float::div;
2-
use criterion::{criterion_group, criterion_main, Criterion};
4+
use criterion::{criterion_main, Criterion};
35
use testcrate::float_bench;
46

57
float_bench! {
@@ -64,5 +66,28 @@ float_bench! {
6466
],
6567
}
6668

67-
criterion_group!(float_div, div_f32, div_f64);
69+
#[cfg(f128_enabled)]
70+
float_bench! {
71+
name: div_f128,
72+
sig: (a: f128, b: f128) -> f128,
73+
crate_fn: div::__divtf3,
74+
crate_fn_ppc: div::__divkf3,
75+
sys_fn: __divtf3,
76+
sys_fn_ppc: __divkf3,
77+
sys_available: not(feature = "no-sys-f128"),
78+
asm: []
79+
}
80+
81+
pub fn float_div() {
82+
let mut criterion = Criterion::default().configure_from_args();
83+
84+
div_f32(&mut criterion);
85+
div_f64(&mut criterion);
86+
87+
#[cfg(f128_enabled)]
88+
{
89+
div_f128(&mut criterion);
90+
}
91+
}
92+
6893
criterion_main!(float_div);

testcrate/src/bench.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ pub fn skip_sys_checks(test_name: &str) -> bool {
3030

3131
// FIXME(f16_f128): system symbols have incorrect results
3232
// <https://github.com/rust-lang/compiler-builtins/issues/617#issuecomment-2125914639>
33-
const X86_NO_SSE_SKIPPED: &[&str] =
34-
&["add_f128", "sub_f128", "mul_f128", "powi_f32", "powi_f64"];
33+
const X86_NO_SSE_SKIPPED: &[&str] = &[
34+
"add_f128", "sub_f128", "mul_f128", "div_f128", "powi_f32", "powi_f64",
35+
];
3536

3637
// FIXME(f16_f128): Wide multiply carry bug in `compiler-rt`, re-enable when nightly no longer
3738
// uses `compiler-rt` version.
3839
// <https://github.com/llvm/llvm-project/issues/91840>
39-
const AARCH64_SKIPPED: &[&str] = &["mul_f128"];
40+
const AARCH64_SKIPPED: &[&str] = &["mul_f128", "div_f128"];
4041

4142
// FIXME(llvm): system symbols have incorrect results on Windows
4243
// <https://github.com/rust-lang/compiler-builtins/issues/617#issuecomment-2121359807>

0 commit comments

Comments
 (0)