Skip to content

Conversation

@sayantn
Copy link
Contributor

@sayantn sayantn commented Dec 4, 2025

recently most SIMD intrinsics were made available in const contexts in #147521. This PR makes the indirectly stable to use in const contexts.

cc @RalfJung @rust-lang/lang @rust-lang/wg-const-eval

@rustbot
Copy link
Collaborator

rustbot commented Dec 4, 2025

⚠️ #[rustc_intrinsic_const_stable_indirect] controls whether intrinsics can be exposed to stable const
code; adding it needs t-lang approval.

cc @rust-lang/wg-const-eval

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 platform-builtins intrinsics. Make sure the
LLVM backend as well as portable-simd gets adapted for the changes.

cc @antoyo, @GuillaumeGomez, @bjorn3, @calebzulawski, @programmerjake

@rustbot rustbot added 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. labels Dec 4, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 4, 2025

r? @joboet

rustbot has assigned @joboet.
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

@RalfJung
Copy link
Member

RalfJung commented Dec 4, 2025

So you plan to soon const-stabilize functions using these intrinsics?

@sayantn
Copy link
Contributor Author

sayantn commented Dec 4, 2025

I won't say soon (it would require t-libs-api approval), but yes the plan is eventually to stabilize them

@traviscross traviscross added the I-lang-radar Items that are on lang's radar and will need eventual work or consideration. label Dec 5, 2025
@RalfJung
Copy link
Member

RalfJung commented Dec 5, 2025

Usually we do the t-lang FCP for const intrinsics as part of that stabilization, not preemptively.

Copy link
Member

@RalfJung RalfJung left a comment

Choose a reason for hiding this comment

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

For some of these I am not sure they are ready for stabilization.

Also, please give an overview of the test coverage we have for these being invoked from const-eval.

View changes since this review

@joboet
Copy link
Member

joboet commented Dec 5, 2025

r? @RalfJung
I'm really not sure who normally handles these PRs, feel free to reassign as necessary.

@rustbot rustbot assigned RalfJung and unassigned joboet Dec 5, 2025
@traviscross traviscross added T-lang Relevant to the language team needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. labels Dec 5, 2025
@RalfJung
Copy link
Member

@rustbot author
based on the comments above

I would propose to remove all controversial cases, then we can proceed to FCP.

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 20, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 20, 2025
@sayantn
Copy link
Contributor Author

sayantn commented Jan 3, 2026

Apologize for the delay. @RalfJung do the above-mentioned caveats also apply to simd_fmax and simd_fmin?

@RalfJung
Copy link
Member

RalfJung commented Jan 4, 2026

Yeah, they do.

@sayantn sayantn force-pushed the const-stable-indirect branch from 9a84c00 to a87092b Compare January 5, 2026 14:07
@rustbot
Copy link
Collaborator

rustbot commented Jan 5, 2026

This PR was rebased onto a different main 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.

@sayantn
Copy link
Contributor Author

sayantn commented Jan 5, 2026

@rustbot ready

I have removed the attributes from simd_reduce_{min,max}, simd_f{max,min} and simd_relaxed_fma.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 5, 2026
@RalfJung RalfJung added the I-lang-nominated Nominated for discussion during a lang team meeting. label Jan 5, 2026
@RalfJung
Copy link
Member

RalfJung commented Jan 5, 2026

I have nominated this for t-lang discussion. It'd be good to update the PR description to give the required context to team members visiting this during triage: which new capabilities are exposed to const code here, and what does the test coverage look like?

@traviscross traviscross added the P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang label Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I-lang-nominated Nominated for discussion during a lang team meeting. I-lang-radar Items that are on lang's radar and will need eventual work or consideration. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-lang Relevant to the language team 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.

5 participants