rust/library/core
Mara Bos 801684620b
Rollup merge of #81107 - scottmcm:nonzero-is_power_of_two, r=kennytm
Add NonZeroUn::is_power_of_two

This saves instructions on both new and old machines <https://rust.godbolt.org/z/4fjTMz>
- On the default x64 target (with no fancy instructions available) it saves a few instructions by not needing to also check for zero.
- On newer targets (with BMI1) it uses `BLSR` for super-short assembly.

This can be used for things like checks against alignments stored in `NonZeroUsize`.
2021-01-17 12:25:01 +00:00
..
benches Remove redundant 'static from library crates 2020-10-18 17:25:51 +02:00
src Rollup merge of #81107 - scottmcm:nonzero-is_power_of_two, r=kennytm 2021-01-17 12:25:01 +00:00
tests Rollup merge of #80670 - the8472:fix-zip-trusted-random-access-composition, r=m-ou-se 2021-01-16 17:29:51 +00:00
Cargo.toml