On Friday, 28 February 2020 at 10:11:23 UTC, Bruce Carneal wrote:
On Friday, 28 February 2020 at 06:50:55 UTC, 9il wrote:
bsr can be done in one/two CPU operation, quite quick. But
core.bitop.bsr wouldn't be inlined. Instead, mir-core
(mir.bitop: ctlz) or LDC intrinsics llvm_ctlz can be used for
to get code with inlining.
That's surprising. I just got ldc to inline core.bitop.bsr on
run.dlang.io using ldc -O3 -mcpu=native.
These tiny core.bitop wrappers around LLVM intrinsics are always
inlined (`pragma(inline, true)`), i.e., you don't even need -O.