diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2021-01-17 12:25:01 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-17 12:25:01 +0000 |
| commit | 801684620bd4e0bc12b98a071851e3d3064429e4 (patch) | |
| tree | da13b95b2c674428e79620e1eaad4aec53b5e9f7 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | 7e2425ab73b40f042975a0911a976220bf62d083 (diff) | |
| parent | 3e16e9211ef7eff4d421f384140e729df1120372 (diff) | |
| download | rust-801684620bd4e0bc12b98a071851e3d3064429e4.tar.gz rust-801684620bd4e0bc12b98a071851e3d3064429e4.zip | |
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`.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
