Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark uint::wrapping_next_power_of_two as #[inline] #94517

Merged
merged 1 commit into from
Mar 24, 2022

Conversation

aDotInTheVoid
Copy link
Member

This brings it in line with next_power_of_two and checked_next_power_of_two

https://godbolt.org/z/Tr18GnqKj

Output as of `rustc 1.61.0-nightly (4ce3749 2022-02-28)`
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]

This brings it in line with `next_power_of_two` and
`checked_next_power_of_two`
@rust-highfive
Copy link
Collaborator

r? @yaahc

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 2, 2022
@yaahc yaahc added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Mar 18, 2022
@yaahc
Copy link
Member

yaahc commented Mar 18, 2022

Pretty sure this will be fine but I do wanna do a quick check to see if this impacts perf anywhere

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 18, 2022
@bors
Copy link
Contributor

bors commented Mar 18, 2022

⌛ Trying commit 3f04c85 with merge 85382c1fc220067f45716e68535acb80754162c9...

@bors
Copy link
Contributor

bors commented Mar 18, 2022

☀️ Try build successful - checks-actions
Build commit: 85382c1fc220067f45716e68535acb80754162c9 (85382c1fc220067f45716e68535acb80754162c9)

@rust-timer
Copy link
Collaborator

Queued 85382c1fc220067f45716e68535acb80754162c9 with parent 1bfe40d, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (85382c1fc220067f45716e68535acb80754162c9): comparison url.

Summary: This benchmark run did not return any relevant results. 2 results were found to be statistically significant but too small to be relevant.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 18, 2022
@yaahc
Copy link
Member

yaahc commented Mar 18, 2022

alright, that's pretty much what I expected to see.

Thank you for the PR!

@bors r+

@bors
Copy link
Contributor

bors commented Mar 18, 2022

📌 Commit 3f04c85 has been approved by yaahc

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 18, 2022
@bors
Copy link
Contributor

bors commented Mar 19, 2022

⌛ Testing commit 3f04c85 with merge a3293c1e2ab78d18cb6fe64ae12901938c18ce8b...

@bors
Copy link
Contributor

bors commented Mar 19, 2022

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 19, 2022
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@yaahc
Copy link
Member

yaahc commented Mar 21, 2022

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 21, 2022
@bors
Copy link
Contributor

bors commented Mar 21, 2022

⌛ Testing commit 3f04c85 with merge 1a2ba5044a62efff3fc319edb16197110b6b6bb8...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-12 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Mar 21, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 21, 2022
@yaahc
Copy link
Member

yaahc commented Mar 21, 2022

uuuuh, not sure what's going on with that test failure...

@bors
Copy link
Contributor

bors commented Mar 24, 2022

⌛ Testing commit 3f04c85 with merge 4b133a7...

@bors
Copy link
Contributor

bors commented Mar 24, 2022

☀️ Test successful - checks-actions
Approved by: yaahc
Pushing 4b133a7 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 24, 2022
@bors bors merged commit 4b133a7 into rust-lang:master Mar 24, 2022
@rustbot rustbot added this to the 1.61.0 milestone Mar 24, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4b133a7): comparison url.

Summary: This benchmark run did not return any relevant results.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants