-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows x86: Change i128 to return via the vector ABI #134290
base: master
Are you sure you want to change the base?
Conversation
Attempting to use these types currently causes an `error performing operation: fully_perform`.
Currently we both pass and return `i128` indirectly on Windows for MSVC and MinGW, but this will be adjusted. Introduce a test verifying the current state.
Clang and GCC both return `i128` in xmm0 on windows-msvc and windows-gnu. Currently, Rust returns the type on the stack. Add a calling convention adjustment so we also return scalar `i128`s using the vector ABI, which makes our `i128` compatible with C. In the future, Clang may change to return `i128` on the stack for its `-msvc` targets (more at [1]). If this happens, the change here will need to be adjusted to only affect MinGW. Link: rust-lang#134288 (does not fix)
r? @SparrowLii rustbot has assigned @SparrowLii. Use |
This should make us consistent for now, even if Clang isn't yet doing the best thing on MSVC. The third commit's diff shows how the tests change. |
@bors try |
Windows x86: Change i128 to return via the vector ABI Clang and GCC both return `i128` in xmm0 on windows-msvc and windows-gnu. Currently, Rust returns the type on the stack. Add a calling convention adjustment so we also return scalar `i128`s using the vector ABI, which makes our `i128` compatible with C. In the future, Clang may change to return `i128` on the stack for its `-msvc` targets (more at [1]). If this happens, the change here will need to be adjusted to only affect MinGW. Link: rust-lang#134288 (does not fix) try-job: x86_64-msvc try-job: x86_64-msvc-ext1 try-job: x86_64-mingw-1 try-job: x86_64-mingw-2
// with what LLVM expects. | ||
if a.layout.size.bytes() > 8 | ||
if is_ret && matches!(scalar.primitive(), Primitive::Int(Integer::I128, _)) { | ||
// `i128` is returned in xmm0 by Clang and GCC, no |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, no clue where I was going with that. Will fix.
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
I validated the codegen on a non-windows machine - it looks like the default filecheck labels get applied based on the host rather than the target? That’s interesting. |
Please double check that this doesn't break ABI compat between cg_llvm and cg_clif. And
|
Clang and GCC both return
i128
in xmm0 on windows-msvc and windows-gnu. Currently, Rust returns the type on the stack. Add a calling convention adjustment so we also return scalari128
s using the vector ABI, which makes ouri128
compatible with C.In the future, Clang may change to return
i128
on the stack for its-msvc
targets (more at [1]). If this happens, the change here will need to be adjusted to only affect MinGW.Link: #134288 (does not fix)
try-job: x86_64-msvc
try-job: x86_64-msvc-ext1
try-job: x86_64-mingw-1
try-job: x86_64-mingw-2