mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-22 20:47:48 +00:00

This adds comparisons among the compiler-builtins function, system functions if available, and optionally handwritten assembly. These also help us identify inconsistencies between this crate and system functions, which may otherwise go unnoticed if intrinsics get lowered to inline operations rather than library calls.
25 lines
530 B
Rust
25 lines
530 B
Rust
use compiler_builtins::float::pow;
|
|
use criterion::{criterion_group, criterion_main, Criterion};
|
|
use testcrate::float_bench;
|
|
|
|
float_bench! {
|
|
name: powi_f32,
|
|
sig: (a: f32, b: i32) -> f32,
|
|
crate_fn: pow::__powisf2,
|
|
sys_fn: __powisf2,
|
|
sys_available: all(),
|
|
asm: [],
|
|
}
|
|
|
|
float_bench! {
|
|
name: powi_f64,
|
|
sig: (a: f64, b: i32) -> f64,
|
|
crate_fn: pow::__powidf2,
|
|
sys_fn: __powidf2,
|
|
sys_available: all(),
|
|
asm: [],
|
|
}
|
|
|
|
criterion_group!(float_add, powi_f32, powi_f64);
|
|
criterion_main!(float_add);
|