Skip to content

Conversation

sayantn
Copy link
Contributor

@sayantn sayantn commented Oct 9, 2025

successor to #146568, this refactors some implementations and ports the implementation of simd_fma and simd_relaxed_fmato rustc_const_eval

Also adds some remaining f16/f128 support in these intrinsics

r? @RalfJung

@rustbot
Copy link
Collaborator

rustbot commented Oct 9, 2025

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

The Miri subtree was changed

cc @rust-lang/miri

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

@rustbot rustbot added 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. labels Oct 9, 2025
@sayantn
Copy link
Contributor Author

sayantn commented Oct 9, 2025

In a similar fashion to #146568, I have not made the signatures const. If this gets merged quickly enough, I will just add these to #147521, otherwise new PR it is

@rust-log-analyzer

This comment has been minimized.

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.

Thanks! Here are some first comments.

All of the new intrinsics Miri supports with this will also need Miri tests.

View changes since this review

@RalfJung
Copy link
Member

RalfJung commented Oct 9, 2025

successor to #146568, this refactors some implementations and implements the following SIMD intrinsics in const-eval

Please update the PR description: This doesn't actually add anything in const-eval, it adds it to the interpreter and then only exposes this in Miri.

@sayantn sayantn changed the title Implement the remaining SIMD intrinsics in const-eval Port the remaining SIMD intrinsics to const-eval Oct 9, 2025
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.

Thanks!
Still missing tests for the new f16/f128 support.

View changes since this review

@rustbot rustbot 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 Oct 10, 2025
@sayantn
Copy link
Contributor Author

sayantn commented Oct 10, 2025

Do we really need f16/f128 tests? It's painful to add them because portable_simd doesn't implement SimdElement for f16 and f128, so we have to roll our own repr_simd types

@RalfJung
Copy link
Member

RalfJung commented Oct 10, 2025

Why do we add f16/f128 support if portable_simd can't even use it?

tests/pass/intrinsics/portable-simd.rs already declares two custom repr(simd) types. That only takes a few lines of code. Declaring two more shouldn't be so bad. We only need smoke tests, but I'd rather not have entirely dead codepaths here.

@sayantn
Copy link
Contributor Author

sayantn commented Oct 10, 2025

I am adding them mostly for completeness sake, but stdarch will need simd_fma with f16.

Declaring two more shouldn't be so bad.

Ok I will add 👍

@sayantn
Copy link
Contributor Author

sayantn commented Oct 10, 2025

@rustbot ready

added tests for f16 and f128 (just copied f32 and f64 tests)

@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 Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants