Skip to content

Conversation

sayantn
Copy link
Contributor

@sayantn sayantn commented Oct 9, 2025

successor to #146568, this PR actually makes the SIMD intrinsics const, and modifies the tests to test the const-eval implementations

r? @tgross35 ig (although feel free to reassign, this is not anything targeted really)

Enable const-testing for the ported SIMD intrinsics
@rustbot
Copy link
Collaborator

rustbot commented Oct 9, 2025

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

The Miri subtree was changed

cc @rust-lang/miri

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

@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 9, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 9, 2025

tgross35 is currently at their maximum review capacity.
They may take a while to respond.

@RalfJung
Copy link
Member

RalfJung commented Oct 9, 2025

Cc @Amanieu

let r: f32 = simd_reduce_mul_unordered(x);
assert_eq!(r, -24_f32);
let x = f32x4::from_array([1., -2., 3., 4.]);
let r: f32 = simd_reduce_add_ordered(x, 0.);
Copy link
Member

Choose a reason for hiding this comment

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

I know this wasn't there originally, but maybe we should add a test that requires being added in the proper order to return the right result? something like 1.0e20f32 + 1.0 - 1.0e20 - 1.0 == -1.0

Copy link
Member

@programmerjake programmerjake left a comment

Choose a reason for hiding this comment

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

other than that idea for a new test, lgtm

View changes since this review

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. 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