Skip to content

respect the win32 vector register budget - #166363

Open
folkertdev wants to merge 3 commits into
rust-lang:mainfrom
folkertdev:win32-vector-register-budget
Open

folkertdev wants to merge 3 commits into
rust-lang:mainfrom
folkertdev:win32-vector-register-budget

Conversation

@folkertdev

Copy link
Copy Markdown
Contributor

This resolves a long-standing FIXME in the win32 callconv code.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 22, 2026

@folkertdev folkertdev Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +59 to +63
let mut remaining_xmm_registers = match opts.flavor {
Flavor::General { regparam: Some(_) } => 0,
Flavor::General { regparam: None } | Flavor::Fastcall => 3,
Flavor::Vectorcall => 6,
};

@folkertdev folkertdev Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

#[derive(Clone, Copy, PartialEq)]
pub(crate) enum Flavor {
General { regparam: Option<u32> },
General { regparam: Option<NonZeroU32> },

@folkertdev folkertdev Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

A bit overkill maybe, but I think it's nice that we don't need to handle None | Some(0) now.

View changes since the review

@rust-log-analyzer

This comment has been minimized.

@folkertdev
folkertdev force-pushed the win32-vector-register-budget branch from f0bb13c to b164716 Compare November 22, 2026 20:09
@folkertdev

Copy link
Copy Markdown
Contributor Author

It's probably nice to wait for #165920 before merging this, but we can maybe get some review in before that.

cc @ChrisDenton
r? beetrees

@rustbot

rustbot commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

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

@folkertdev
folkertdev marked this pull request as ready for review November 23, 2026 22:06
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 23, 2026

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants