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

View all comments

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

TODO:

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 Outdated
@RalfJung

Copy link
Copy Markdown
Member Author

@bors try jobs=i686,various

@rust-bors

This comment has been minimized.

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*
@rust-bors

rust-bors Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: a32c597 (a32c597e182d95bb782185c7b388721b365ca029)
Base parent: be0ea33 (be0ea33bba5000ac134e58acde780af83d908e44)

@RalfJung

Copy link
Copy Markdown
Member Author

@bors try jobs=aarch64-linux

@rust-bors

This comment has been minimized.

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: *aarch64-linux*
@traviscross traviscross added I-lang-radar Items that are on lang's radar and will need eventual work or consideration. P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang labels Aug 23, 2026
@rust-bors

rust-bors Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 6212267 (6212267738008defc37104e01a0afc3421c7d50e)
Base parent: 9a4ad59 (9a4ad59ae3073b013cd62f53f8349ddc61a012e8)

@RalfJung

Copy link
Copy Markdown
Member Author

It is strange that PR CI passed. Looks like even on LLVM 21, tests/codegen-llvm/pclmulqdq-target-feature-inlining.rs works? How can that be if it does not have llvm/llvm-project#205106 ?

@joshtriplett joshtriplett added the relnotes Marks issues that should be documented in the release notes of the next release. label Sep 2, 2026
@tmandry tmandry added the T-lang Relevant to the language team label Sep 2, 2026
@RalfJung

This comment was marked as resolved.

@RalfJung

RalfJung commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Oh wait nvm, there was a t-lang ask here that I forgot about. :)

@tmandry

tmandry commented Sep 2, 2026

Copy link
Copy Markdown
Member

I think we should make this change, including the breaking change and turning the non-silenceable warning for disabling SSE on i686 targets into a hard error.

@rfcbot fcp merge lang

@rust-rfcbot

rust-rfcbot commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

@tmandry has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Sep 2, 2026
@traviscross

Copy link
Copy Markdown
Contributor

Thanks @RalfJung.

@rfcbot reviewed

If you do think that this needs FCP...

It has been our practice to FCP restabilizations (see, e.g., #145954 (comment)).

@RalfJung

RalfJung commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

@bors try jobs=llvm

@rust-bors

This comment has been minimized.

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


try-job: *llvm*
@traviscross traviscross removed I-lang-nominated Nominated for discussion during a lang team meeting. P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang labels Sep 2, 2026
@rust-rfcbot rust-rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Sep 2, 2026
@rust-rfcbot

Copy link
Copy Markdown
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

@RalfJung

RalfJung commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

turning the non-silenceable warning for disabling SSE on i686 targets into a hard error.

All right, will do. This is blocked on #161280 (FCP finished there but it hasn't been reviewed yet).

@rust-log-analyzer

This comment has been minimized.

@RalfJung

RalfJung commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

It is strange that PR CI passed. Looks like even on LLVM 21, tests/codegen-llvm/pclmulqdq-target-feature-inlining.rs works? How can that be if it does not have llvm/llvm-project#205106 ?

Ah, it doesn't work in LLVM 21, we just don't run that in PR CI. :) (We run it on aarch64, but not on x86.)

@RalfJung

RalfJung commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

@bors try jobs=x86llvm

@rust-bors

This comment has been minimized.

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


try-job: x86*llvm*
@rust-bors

rust-bors Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 88b6b60 (88b6b6084feceee6c66834108ee44fd8cca324e9)
Base parent: 824336a (824336ad4127ce295849937a24c08a4aeff6ada7)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. I-lang-radar Items that are on lang's radar and will need eventual work or consideration. relnotes Marks issues that should be documented in the release notes of the next release. 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-lang Relevant to the language team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants