On Saturday, 29 December 2018 at 15:15:48 UTC, Iain Buclaw wrote:
On Fri, 28 Dec 2018 at 20:50, 9il via Digitalmars-d-announce
<[email protected]> wrote:
ldexp and frexp are base building blocks for a lot of math
functions.
Here is a small benchmark that compares Mir, C and Phobos
implementations:
https://github.com/libmir/mir-core/blob/master/bench_ldexp_frexp.d
Mir ldexp is 2.5 (5.5 - dmd) times faster for double and float.
You could double the speed of ldexp if you actually used the
checkedint compiler intrinsics rather than implementing it
yourself.
Using libm's ldexp() is also likely going to be 2-5x slower
than using
the implementation you've written for mir.ldexp(). For one,
your
version will be inlined!
Mir has support for LLVM checkedint intrinsics. GDC checkedint
intrinsics are not yet integrated in Mir.
https://github.com/libmir/mir-core/blob/master/source/mir/checkedint.d