Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#94517 - aDotInTheVoid:inline_wrapping_next_po…
…wer_two, r=yaahc Mark `uint::wrapping_next_power_of_two` as `#[inline]` This brings it in line with `next_power_of_two` and `checked_next_power_of_two` https://godbolt.org/z/Tr18GnqKj <details> <summary> Output as of `rustc 1.61.0-nightly (4ce3749 2022-02-28)` </summary> ```asm example::npot: lea eax, [rdi - 1] movzx eax, al lzcnt ecx, eax add ecx, -24 mov al, -1 shr al, cl inc al cmp dil, 2 movzx ecx, al mov eax, 1 cmovae eax, ecx ret example::cnpot: lea eax, [rdi - 1] movzx eax, al lzcnt ecx, eax add ecx, -24 mov al, -1 shr al, cl xor ecx, ecx cmp dil, 2 movzx edx, al cmovb edx, ecx inc dl setne al ret example::wrapping_next_power_of_two: jmp qword ptr [rip + _ZN4core3num20_$LT$impl$u20$u8$GT$26wrapping_next_power_of_two17hd879a85055735264E@GOTPCREL] ``` </details>
- Loading branch information