Support u128/i128 c-variadic arguments#155429
Conversation
|
@bors try jobs=dist-various-1,dist-various-2,aarch64-apple,x86_64-mingw-1 |
This comment has been minimized.
This comment has been minimized.
Support `u128`/`i128` c-variadic arguments try-job: dist-various-1 try-job: dist-various-2 try-job: aarch64-apple try-job: x86_64-mingw-1
This comment has been minimized.
This comment has been minimized.
3f2ff65 to
5e8c8b5
Compare
|
@bors try jobs=dist-various-1,dist-various-2,aarch64-apple,x86_64-mingw-1 |
Support `u128`/`i128` c-variadic arguments try-job: dist-various-1 try-job: dist-various-2 try-job: aarch64-apple try-job: x86_64-mingw-1
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
5e8c8b5 to
bcf4cfa
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
💔 Test for d3bd26f failed: CI. Failed job:
|
bcf4cfa to
8e7c3b1
Compare
|
@bors try jobs=dist-various-1,dist-various-2,aarch64-apple,x86_64-mingw-1 |
This comment has been minimized.
This comment has been minimized.
Support `u128`/`i128` c-variadic arguments try-job: dist-various-1 try-job: dist-various-2 try-job: aarch64-apple try-job: x86_64-mingw-1
8e7c3b1 to
d765f82
Compare
This comment has been minimized.
This comment has been minimized.
d765f82 to
1b40600
Compare
| Primitive::Int(integer, _) => match integer { | ||
| Integer::I8 | Integer::I16 => unreachable!(), | ||
| Integer::I32 | Integer::I64 => { /* fall through */ } | ||
| Integer::I128 => return Align::EIGHT, |
There was a problem hiding this comment.
It has custom behavior, the va_arg implementation for powerpc64 is here
and it uses the implementation here
The logic falls through to the last line for i128, returning 8. For f128 it curiously does use an alignment of 16, so I've just added that already because it would be easy to miss down the line.
There was a problem hiding this comment.
That's Weird. Kinda almost want to ask if that's intentional. I suppose this is currently correct, at least...? ...but does gcc agree...?
There was a problem hiding this comment.
GCC does agree, see https://godbolt.org/z/eW3daf7rG. 24 is added to the pointer, with an alignment of 16 you'd expect to see 32 to be added. 24 = 8 (for the u32 plus padding) + 16 (for the i128).
There was a problem hiding this comment.
Ah thanks for digging that up! Such a weird assembly language, to notate immediate adds with their own instruction and use juxtaposition for addition...
There was a problem hiding this comment.
r? workingjubilee
Thanks! I'm going to cogitate on this a little now that I've absorbed it and raised what half-formed thoughts of concerns I have and had those addressed insofar as they were addressable, and will approve-approve this later this night or tomorrow assuming l'esprit d'escalier does not come up with a more material problem. Feel free to ping if it's like Thursday/Friday and it's still waiting on r+, shouldn't be even that long.
There was a problem hiding this comment.
I think this is the only extra thing I'd like to record, since clang also mentions "welllll, this isn't in the psABI buuuuut..." and someone might apply the impl without checking the compiler code and then at some point we encounter hilarity and bug reports and etc.
On platforms where `clang` defines `__int128`.
06ff181 to
68d7148
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. |
|
|
|
@bors r+ |
…ingjubilee Support `u128`/`i128` c-variadic arguments The restriction on `u128` is kind of arbitrary, so let's see what it would take to support it. r? @ghost
|
⌛ Testing commit 68d7148 with merge d3b0bac... Workflow: https://github.com/rust-lang/rust/actions/runs/28565410648 |
Support `u128`/`i128` c-variadic arguments The restriction on `u128` is kind of arbitrary, so let's see what it would take to support it. r? @ghost
|
yielding to rollup @bors yield |
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #158678. |
…ingjubilee Support `u128`/`i128` c-variadic arguments The restriction on `u128` is kind of arbitrary, so let's see what it would take to support it. r? @ghost
…ingjubilee Support `u128`/`i128` c-variadic arguments The restriction on `u128` is kind of arbitrary, so let's see what it would take to support it. r? @ghost
Rollup of 5 pull requests Successful merges: - #155429 (Support `u128`/`i128` c-variadic arguments) - #158627 (Simplify option-iterator flattening in the compiler) - #158669 (Remove `src/tools/test-float-parse/Cargo.lock`) - #158674 (library: Polish transmute's `split_at_stdlib` example) - #158682 (Avoid delayed bug for disabled on_type_error arguments)
View all comments
The restriction on
u128is kind of arbitrary, so let's see what it would take to support it.r? @ghost