1+ #![ cfg_attr( f128_enabled, feature( f128) ) ]
2+
13use compiler_builtins:: float:: pow;
2- use criterion:: { criterion_group , criterion_main, Criterion } ;
4+ use criterion:: { criterion_main, Criterion } ;
35use testcrate:: float_bench;
46
57float_bench ! {
@@ -20,5 +22,28 @@ float_bench! {
2022 asm: [ ] ,
2123}
2224
23- criterion_group ! ( float_add, powi_f32, powi_f64) ;
24- criterion_main ! ( float_add) ;
25+ // FIXME(f16_f128): can be changed to only `f128_enabled` once `__multf3` and `__divtf3` are
26+ // distributed by nightly.
27+ #[ cfg( all( f128_enabled, not( feature = "no-sys-f128" ) ) ) ]
28+ float_bench ! {
29+ name: powi_f128,
30+ sig: ( a: f128, b: i32 ) -> f128,
31+ crate_fn: pow:: __powitf2,
32+ crate_fn_ppc: pow:: __powikf2,
33+ sys_fn: __powitf2,
34+ sys_fn_ppc: __powikf2,
35+ sys_available: not( feature = "no-sys-f128" ) ,
36+ asm: [ ]
37+ }
38+
39+ pub fn float_pow ( ) {
40+ let mut criterion = Criterion :: default ( ) . configure_from_args ( ) ;
41+
42+ powi_f32 ( & mut criterion) ;
43+ powi_f64 ( & mut criterion) ;
44+
45+ #[ cfg( all( f128_enabled, not( feature = "no-sys-f128" ) ) ) ]
46+ powi_f128 ( & mut criterion) ;
47+ }
48+
49+ criterion_main ! ( float_pow) ;
0 commit comments