[Pre-RFC]: leading_ones_trailing_ones

These do have intrinsics, for example https://doc.rust-lang.org/std/intrinsics/fn.ctlz_nonzero.html, introduced in

I'd love to find a good way to expose them, since last I checked LLVM is unable to simplify ctlz(x, false) to ctlz(x, true) when it knows x != 0.

They could always be exposed as an _unchecked method, but it feels like there's something better to find. I was pondering putting them on NonZero*, for example, but those have no such methods yet, so I'm not sure that's right...

2 Likes