Strange counter-performance in an alternative `decimalLength9` function

9il ilyayaroshenko at gmail.com
Fri Feb 28 06:50:55 UTC 2020


On Wednesday, 26 February 2020 at 00:50:35 UTC, Basile B. wrote:
> So after reading the translation of RYU I was interested too 
> see if the decimalLength() function can be written to be 
> faster, as it cascades up to 8 CMP.
>
> [...]

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.


More information about the Digitalmars-d-learn mailing list