make pad_i32 of PassMode::cast an integer - #160132
Conversation
This comment has been minimized.
This comment has been minimized.
ae7c1f7 to
b426b46
Compare
This comment has been minimized.
This comment has been minimized.
9de525c to
945f5d7
Compare
| fn reg_backend_type(&self, ty: &Reg) -> Type<'gcc> { | ||
| ty.gcc_type(self) | ||
| } |
There was a problem hiding this comment.
This is extrapolating from the LLVM implementation, it seems to work fine, cc @antoyo if there is something I'm missing.
| /// `pad_i32` indicates how many `Reg::i32()` dummy arguments are emitted before the real | ||
| /// argument. | ||
| Cast { pad_i32: u8, cast: Box<CastTarget> }, |
There was a problem hiding this comment.
I'm not sure about the name, but can't really think of anything obviously better but also somewhat short.
|
r? @bjorn3 |
|
cc @bjorn3 This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a, @makai410
|
This comment has been minimized.
This comment has been minimized.
945f5d7 to
0057c29
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
0057c29 to
7b5e497
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
FYI, there's some issue with cg_gcc and we're about to revert the last sync. |
so that we can specify more than one i32 of padding.
7b5e497 to
72fa3a8
Compare
|
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. |
What exactly is the ABI for that type that it needs more than 1 i32 padding? |
|
On powerpc (a 32-bit target), when a |
As I understand it, |
|
Well so in practice a A |
|
Something that sort of works is using a simd type, because it does not get split. But, it (correctly) warns about missing target features, and scheme probably fails when there are actually vector registers available. So, yeah, I think this change is needed to support that ABI. it's still pretty limited, Clang allows you to specify a whole custom type for padding. |
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. usingPassMode::prefixeddon't appear to work.More discussion is in #t-compiler/help > power complex abi.