Skip to content

x86: on targets that requires SSE, use those registers for ABI - #161583

Open
RalfJung wants to merge 1 commit into
rust-lang:mainfrom
RalfJung:x86-sse-abi
Open

x86: on targets that requires SSE, use those registers for ABI#161583
RalfJung wants to merge 1 commit into
rust-lang:mainfrom
RalfJung:x86-sse-abi

Conversation

@RalfJung

@RalfJung RalfJung commented Aug 23, 2026

Copy link
Copy Markdown
Member

Now that llvm/llvm-project#142321 is fixed, we can use the vector ABI without re-introducing #139029. So this effectively reverts #141309.

This can lead to new hard errors on code that previously compiled if all of the following apply:

  • One is compiling for an i686 target (or for i386-apple-ios which is effectively an i686 target despite the name) -- note that i586 targets are not affected
  • One has disabled SSE (which has emitted a non-silencable warning since Rust 1.86 as these targets require SSE)
  • The program uses a "Rust" ABI function that passes a 128bit SIMD vector by-value

Also this will cause performance regressions on LLVM 22 and 21 as those don't have the fix for llvm/llvm-project#142321. IMO that's fine. Programs will do the right thing, they will just be a bit slower due to #139029.

@rust-lang/lang please let me know if you're fine with just landing this or if you want to apply some sort of process here. (We have just landed this the first time we tried to use SSE in the ABI, but back then I didn't think of the fact that in some unsupported corner cases, this can lead to new hard errors.) If you do think that this needs FCP, please let me know and I will propose that we turn the target-feature ABI check into a hard error on x86-32 (similar to #161280).

r? @nikic
Cc @tgross35

@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 Aug 23, 2026
@RalfJung
RalfJung force-pushed the x86-sse-abi branch 2 times, most recently from 7f487df to 06a4f6d Compare August 23, 2026 10:33
@RalfJung RalfJung added the I-lang-nominated Nominated for discussion during a lang team meeting. label Aug 23, 2026
@rust-log-analyzer

This comment has been minimized.

Comment thread compiler/rustc_target/src/callconv/mod.rs Outdated
@RalfJung
RalfJung force-pushed the x86-sse-abi branch 2 times, most recently from a01a5dd to 7d66bd1 Compare August 23, 2026 11:45
Comment thread tests/codegen-llvm/simd/splat.rs
@RalfJung

Copy link
Copy Markdown
Member Author

@bors try jobs=i686,various

@rust-bors

rust-bors Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

⌛ Trying commit 82b0b84 with merge a32c597

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/32642426825

rust-bors Bot pushed a commit that referenced this pull request Aug 23, 2026
x86: on targets that requires SSE, use those registers for ABI


try-job: *i686*
try-job: *various*
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. 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.

5 participants