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)

@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
Contributor Author

Choose a reason for hiding this comment

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

that seems like a nice idea, but I really don't want to add new tests in this PR - this is pretty big by itself anyway

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

@sayantn sayantn force-pushed the simd-const-intrinsics branch from 8c71ce0 to 48324c2 Compare November 3, 2025 22:06
@rustbot

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Nov 5, 2025

☔ The latest upstream changes (presumably #148507) made this pull request unmergeable. Please resolve the merge conflicts.

@sayantn sayantn force-pushed the simd-const-intrinsics branch from 48324c2 to 76ddb6f Compare November 5, 2025 21:00
@rustbot

This comment has been minimized.

@sayantn sayantn force-pushed the simd-const-intrinsics branch from 76ddb6f to d1b2151 Compare November 10, 2025 11:14
@rustbot
Copy link
Collaborator

rustbot commented Nov 10, 2025

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.

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
  PR_CI_JOB: 1
  SKIP_SUBMODULES: src/gcc
  IMAGE: tidy
##[endgroup]
error: PRs changing the `nightly` channel should be sent to the `master` branch!
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"
echo "disk usage:"
df -h
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}

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.

8 participants