diff options
| author | bors <bors@rust-lang.org> | 2022-03-24 17:32:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-03-24 17:32:40 +0000 |
| commit | 4b133a7e27c32e822e9ff774e4436f184f5a9752 (patch) | |
| tree | a1840d8dc09218b26dac2024fb29eccc583596c2 /compiler/rustc_codegen_gcc/example/std_example.rs | |
| parent | 8d8135f003b35c3e109d013b2bed9ee9496da615 (diff) | |
| parent | 3f04c85e249dbefddc6f45e35146b119b2274ac0 (diff) | |
| download | rust-4b133a7e27c32e822e9ff774e4436f184f5a9752.tar.gz rust-4b133a7e27c32e822e9ff774e4436f184f5a9752.zip | |
Auto merge of #94517 - aDotInTheVoid:inline_wrapping_next_power_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 (4ce374923 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>
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/std_example.rs')
0 files changed, 0 insertions, 0 deletions
