Skip to content

make pad_i32 of PassMode::cast an integer - #160132

Open
folkertdev wants to merge 1 commit into
rust-lang:mainfrom
folkertdev:pad-i32-count
Open

make pad_i32 of PassMode::cast an integer#160132
folkertdev wants to merge 1 commit into
rust-lang:mainfrom
folkertdev:pad-i32-count

Conversation

@folkertdev

Copy link
Copy Markdown
Contributor

so that we can specify more than one i32 of padding. This PR only adds the functionality but does not yet use it: there should be no functional changes.

This is needed for the ABI of Complex<{ float }> on 32-bit powerpc. Other mechanisms, e.g. using PassMode::prefixed don't appear to work.

More discussion is in #t-compiler/help > power complex abi.

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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 Jul 29, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@folkertdev
folkertdev force-pushed the pad-i32-count branch 2 times, most recently from ee79d0f to 9de525c Compare July 29, 2026 09:52
so that we can specify more than one i32 of padding.
Comment on lines +349 to 351
fn reg_backend_type(&self, ty: &Reg) -> Type<'gcc> {
ty.gcc_type(self)
}

@folkertdev folkertdev Jul 29, 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.

This is extrapolating from the LLVM implementation, it seems to work fine, cc @antoyo if there is something I'm missing.

View changes since the review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be fine.

Comment on lines +58 to +60
/// `pad_i32` indicates how many `Reg::i32()` dummy arguments are emitted before the real
/// argument.
Cast { pad_i32: u8, cast: Box<CastTarget> },

@folkertdev folkertdev Jul 29, 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.

I'm not sure about the name, but can't really think of anything obviously better but also somewhat short.

View changes since the review

@folkertdev

Copy link
Copy Markdown
Contributor Author

r? @bjorn3
cc @workingjubilee

@folkertdev
folkertdev marked this pull request as ready for review July 29, 2026 12:07
@rustbot

rustbot commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

rustc_codegen_cranelift is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_cranelift instead.

cc @bjorn3

This PR changes rustc_public

cc @oli-obk, @celinval, @ouz-a, @makai410

rustc_codegen_gcc is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_gcc instead.

cc @antoyo, @GuillaumeGomez

@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 Jul 29, 2026
@rust-bors

rust-bors Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

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

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