Show: bitintr - Portable bitwise manipulation intrinsics


bitintr is the first library that I have publish to It offers bitwise manipulation intrinsics for platform specific instructions. It works on stable, but when its compiled with a nightly compiler it uses compiler hooks for some of the intrinsics.

Any feedback and contributions are welcome! :slight_smile:

I am using it in my bitwise crate, which provides high-level bitwise manipulation algorithms that work on words and sequences (I hope I can publish a first version of bitwise soon).


It’s always nice if you could characterize your crate in terms of any others with similar functionality out there? Totally different? Similar to X, but different goal/requirement? Etc.

And nice addition to the ecosystem. Thanks :slight_smile:


The main difference is that it actually uses unstable compiler hooks on nightly (automatically) for some of the intrinsics (AFAIK no other library does that yet) while providing a software fallback if the target doesn’t support the instruction (AFAIK no other library does this either).

The rest of the differences are not really that important. It provides ~95% of the advanced bit manipulation intrinsics on x86 (which are a lot) and the most important advanced bit manipulation intrinsics on ARM (AFAIK no other library covers as many instructions as this one).

Production-wise I use it in my other library (bitwise) and both are in the 2-3rd iteration API-wise. As I finish bitwise the API of bitintr might changem, but right now I am at least confident enough to showcase the library and ask for external feedback on the design. It is still in 0.1.z state so… time will tell. It solves a single problem, and I hope it solves it well.