Skip to content

cg_llvm: scalable vectors with simd_cast and simd_select#155106

Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
davidtwco:scalable-vector-more-simd-intrinsics
Apr 13, 2026
Merged

cg_llvm: scalable vectors with simd_cast and simd_select#155106
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
davidtwco:scalable-vector-more-simd-intrinsics

Conversation

@davidtwco
Copy link
Copy Markdown
Member

Previously sve_cast's implementation was abstracted to power both sve_cast and simd_cast which supported scalable and non-scalable vectors respectively. In anticipation of having to do this for another simd_* intrinsic, sve_cast is removed and simd_cast is changed to accept both scalable and non-scalable intrinsics, an approach that will scale better to the other intrinsics.

Building on the previous change, support scalable vectors with simd_select. Previous patches already landed the necessary changes in the implementation of this intrinsic, but didn't allow scalable vector arguments to be passed in.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 10, 2026

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 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. labels Apr 10, 2026
@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Apr 10, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 10, 2026

r? @dingxiangfei2009

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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 11 candidates

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

Previously `sve_cast`'s implementation was abstracted to power both
`sve_cast` and `simd_cast` which supported scalable and non-scalable
vectors respectively. In anticipation of having to do this for another
`simd_*` intrinsic, `sve_cast` is removed and `simd_cast` is changed to
accept both scalable and non-scalable intrinsics, an approach that will
scale better to the other intrinsics.
Building on the previous change, support scalable vectors with
`simd_select`. Previous patches already landed the necessary changes in
the implementation of this intrinsic, but didn't allow scalable vector
arguments to be passed in.
@davidtwco davidtwco force-pushed the scalable-vector-more-simd-intrinsics branch from 0c89d6d to 62ffc89 Compare April 13, 2026 11:25
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 13, 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.

@Amanieu
Copy link
Copy Markdown
Member

Amanieu commented Apr 13, 2026

LGTM. I particularly like this since simd_cast is now also usable for RVV in the future.

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 13, 2026

📌 Commit 62ffc89 has been approved by Amanieu

It is now in the queue for this repository.

@rust-bors rust-bors bot 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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 13, 2026
rust-bors bot pushed a commit that referenced this pull request Apr 13, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #155227 (`rust-analyzer` subtree update)
 - #153335 (Add #![unstable_removed(..)] attribute to track removed features)
 - #154932 (Handle RTN projections in assoc type restriction diagnostics)
 - #155096 (delegation: support proper interaction of user-specified args and impl Traits)
 - #155106 (cg_llvm: scalable vectors with `simd_cast` and `simd_select`)
 - #155140 (add regression test for OpenOptionsExt downstream compat)
 - #155182 (Make the expansion of guard metavars begin guard non-terminals)
 - #155226 (delegation: revert execution of hir_crate_items before delayed lowering)
 - #153997 (Use closures more consistently in `dep_graph.rs`.)
 - #155003 (update thin-vec)
@rust-bors rust-bors bot merged commit 83a57ca into rust-lang:main Apr 13, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 13, 2026
rust-timer added a commit that referenced this pull request Apr 13, 2026
Rollup merge of #155106 - davidtwco:scalable-vector-more-simd-intrinsics, r=Amanieu

cg_llvm: scalable vectors with `simd_cast` and `simd_select`

Previously `sve_cast`'s implementation was abstracted to power both `sve_cast` and `simd_cast` which supported scalable and non-scalable vectors respectively. In anticipation of having to do this for another `simd_*` intrinsic, `sve_cast` is removed and `simd_cast` is changed to accept both scalable and non-scalable intrinsics, an approach that will scale better to the other intrinsics.

Building on the previous change, support scalable vectors with `simd_select`. Previous patches already landed the necessary changes in the implementation of this intrinsic, but didn't allow scalable vector arguments to be passed in.
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Apr 13, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#155227 (`rust-analyzer` subtree update)
 - rust-lang/rust#153335 (Add #![unstable_removed(..)] attribute to track removed features)
 - rust-lang/rust#154932 (Handle RTN projections in assoc type restriction diagnostics)
 - rust-lang/rust#155096 (delegation: support proper interaction of user-specified args and impl Traits)
 - rust-lang/rust#155106 (cg_llvm: scalable vectors with `simd_cast` and `simd_select`)
 - rust-lang/rust#155140 (add regression test for OpenOptionsExt downstream compat)
 - rust-lang/rust#155182 (Make the expansion of guard metavars begin guard non-terminals)
 - rust-lang/rust#155226 (delegation: revert execution of hir_crate_items before delayed lowering)
 - rust-lang/rust#153997 (Use closures more consistently in `dep_graph.rs`.)
 - rust-lang/rust#155003 (update thin-vec)
@davidtwco davidtwco deleted the scalable-vector-more-simd-intrinsics branch April 13, 2026 23:23
github-actions bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Apr 16, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#155227 (`rust-analyzer` subtree update)
 - rust-lang/rust#153335 (Add #![unstable_removed(..)] attribute to track removed features)
 - rust-lang/rust#154932 (Handle RTN projections in assoc type restriction diagnostics)
 - rust-lang/rust#155096 (delegation: support proper interaction of user-specified args and impl Traits)
 - rust-lang/rust#155106 (cg_llvm: scalable vectors with `simd_cast` and `simd_select`)
 - rust-lang/rust#155140 (add regression test for OpenOptionsExt downstream compat)
 - rust-lang/rust#155182 (Make the expansion of guard metavars begin guard non-terminals)
 - rust-lang/rust#155226 (delegation: revert execution of hir_crate_items before delayed lowering)
 - rust-lang/rust#153997 (Use closures more consistently in `dep_graph.rs`.)
 - rust-lang/rust#155003 (update thin-vec)
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.

5 participants