Skip to content

Conversation

sayantn
Copy link
Contributor

@sayantn sayantn commented Aug 20, 2025

Tracking issue: #145686
ACP: rust-lang/libs-team#642

This implements funnel shifts on primitive integer types. Implements this for cg_llvm, with a fallback impl for everything else

Thanks @folkertdev for the fixes and tests

cc @rust-lang/libs-api

@rustbot
Copy link
Collaborator

rustbot commented Aug 20, 2025

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 20, 2025

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

@rust-log-analyzer

This comment has been minimized.

@tgross35
Copy link
Contributor

I see there is a tracking issue, but not an ACP for this. Could you create one? It's an issue template at https://github.com/rust-lang/libs-team/issues.

@rustbot
Copy link
Collaborator

rustbot commented Aug 22, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-log-analyzer

This comment has been minimized.

@sayantn sayantn force-pushed the integer-funnel-shift branch from b91850b to 400a29d Compare August 22, 2025 16:30
@rust-log-analyzer

This comment has been minimized.

@sayantn sayantn force-pushed the integer-funnel-shift branch from 400a29d to 23601d2 Compare August 22, 2025 16:37
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Aug 24, 2025

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

@rust-log-analyzer

This comment has been minimized.

@tgross35 tgross35 added S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 27, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@sayantn sayantn force-pushed the integer-funnel-shift branch from 5f4c412 to 63fde15 Compare August 28, 2025 01:39
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few tiny requests from me then I think this looks good, as long as @RalfJung doesn't have anything else.

Per usual, please squash. You can also (optionally) drop the CABs from the commit messages assuming they come from the GH suggestion, as typically review feedback is given without need for authorship attribution - bit misleading that GH adds these automatically for what are usually typo fixes (unless @folkertdev authored more of this patch then I'm realizing 🙂)

View changes since this review

@tgross35 tgross35 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 3, 2025
@sayantn
Copy link
Contributor Author

sayantn commented Sep 3, 2025

@folkertdev did author a significant part of the patches, including the tests and (although removed now) gcc, clif and const-eval implementations. Also, is a squash really needed, I believe the current commit structure is helpful for reviewers as it clearly separates the different objectives (libs impl, cg_llvm and tests)

@tgross35
Copy link
Contributor

tgross35 commented Sep 3, 2025

@folkertdev did author a significant part of the patches, including the tests and (although removed now) gcc, clif and const-eval implementations.

I didn't have this context, makes sense 👍 thanks for including in that case

Also, is a squash really needed, I believe the current commit structure is helpful for reviewers as it clearly separates the different objectives (libs impl, cg_llvm and tests)

If it's not a big number of tests then it's always good to have them in the same commit as whatever enables / fixes them, so you can look at a single point in history and see "x changed and produced y visible results" (tests are already separated enough by file/directory). So ideally I'd suggest reordering from current commits 1,2,3 to 2,squash(1,3), which also avoids the fact that adding library support before compiler support just crashes (using the pedantic repo's litmus test of what happens if git bisect happens to drop you between two commits and try to run tests - yes, not super relevant for our repo because bisect has --first-parent).

But we don't have strict history requirements, so I ofc won't insist on that. At a minimum though, please update the commit message "Add tests" to at least specify what tests; that's never the most insightful message to see in the log :)

@sayantn
Copy link
Contributor Author

sayantn commented Sep 3, 2025

Makes sense, I'd just squash the commits (lazy lol)

 - Add a fallback implementation for the intrinsics
 - Add LLVM backend support for funnel shifts

Co-Authored-By: folkertdev <[email protected]>
@sayantn sayantn force-pushed the integer-funnel-shift branch from c1260ef to 62b4347 Compare September 3, 2025 08:44
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! r=me after CI passes

View changes since this review

@sayantn
Copy link
Contributor Author

sayantn commented Sep 4, 2025

@bors r=tgross35

@bors
Copy link
Collaborator

bors commented Sep 4, 2025

📌 Commit 62b4347 has been approved by tgross35

It is now in the queue for this repository.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 4, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 4, 2025
…ross35

Implement Integer funnel shifts

Tracking issue: rust-lang#145686
ACP: rust-lang/libs-team#642

This implements funnel shifts on primitive integer types. Implements this for cg_llvm, with a fallback impl for everything else

Thanks ``@folkertdev`` for the fixes and tests

cc ``@rust-lang/libs-api``
bors added a commit that referenced this pull request Sep 4, 2025
Rollup of 5 pull requests

Successful merges:

 - #145682 (Promote aarch64-pc-windows-msvc to Tier 1)
 - #145690 (Implement Integer funnel shifts)
 - #146119 (compiletest: Implement an experimental `--new-output-capture` mode)
 - #146168 (Update bootstrap's dependencies to remove winapi and old windows-sys)
 - #146182 (Don't require next-solver `ProbeRef` to be `Copy`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 00d5dc5 into rust-lang:master Sep 4, 2025
10 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Sep 4, 2025
rust-timer added a commit that referenced this pull request Sep 4, 2025
Rollup merge of #145690 - sayantn:integer-funnel-shift, r=tgross35

Implement Integer funnel shifts

Tracking issue: #145686
ACP: rust-lang/libs-team#642

This implements funnel shifts on primitive integer types. Implements this for cg_llvm, with a fallback impl for everything else

Thanks `@folkertdev` for the fixes and tests

cc `@rust-lang/libs-api`
@bors
Copy link
Collaborator

bors commented Sep 4, 2025

⌛ Testing commit 62b4347 with merge 45b9d13...

@tgross35
Copy link
Contributor

tgross35 commented Sep 4, 2025

@bors r-
Why does it keep doing that...

@sayantn sayantn deleted the integer-funnel-shift branch September 4, 2025 20:46
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Sep 5, 2025
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#145682 (Promote aarch64-pc-windows-msvc to Tier 1)
 - rust-lang/rust#145690 (Implement Integer funnel shifts)
 - rust-lang/rust#146119 (compiletest: Implement an experimental `--new-output-capture` mode)
 - rust-lang/rust#146168 (Update bootstrap's dependencies to remove winapi and old windows-sys)
 - rust-lang/rust#146182 (Don't require next-solver `ProbeRef` to be `Copy`)

r? `@ghost`
`@rustbot` modify labels: rollup
@Zalathar
Copy link
Contributor

Zalathar commented Sep 5, 2025

Bors, please, it's already merged.

@bors r- retry

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 5, 2025
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Sep 9, 2025
…ross35

Implement Integer funnel shifts

Tracking issue: rust-lang#145686
ACP: rust-lang/libs-team#642

This implements funnel shifts on primitive integer types. Implements this for cg_llvm, with a fallback impl for everything else

Thanks `@folkertdev` for the fixes and tests

cc `@rust-lang/libs-api`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. 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.