Auto merge of #99476 - dpaoliello:rawdylibvectorcall, r=michaelwoerister
Add tests for raw-dylib with vectorcall, and fix vectorcall code generation * Adds tests for using `raw-dylib` (#58713) with `vectorcall`. * Fixed code generation for `vectorcall` (parameters have to be marked with `InReg`, just like `fastcall`). * Enabled running the `raw-dylib` `fastcall` tests when using MSVC (since I had to add support in the test for running MSVC-only tests since GCC doesn't support `vectorcall`).
This commit is contained in:
@@ -669,8 +669,10 @@ impl<'a, Ty> FnAbi<'a, Ty> {
|
||||
|
||||
match &cx.target_spec().arch[..] {
|
||||
"x86" => {
|
||||
let flavor = if let spec::abi::Abi::Fastcall { .. } = abi {
|
||||
x86::Flavor::Fastcall
|
||||
let flavor = if let spec::abi::Abi::Fastcall { .. }
|
||||
| spec::abi::Abi::Vectorcall { .. } = abi
|
||||
{
|
||||
x86::Flavor::FastcallOrVectorcall
|
||||
} else {
|
||||
x86::Flavor::General
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::spec::HasTargetSpec;
|
||||
#[derive(PartialEq)]
|
||||
pub enum Flavor {
|
||||
General,
|
||||
Fastcall,
|
||||
FastcallOrVectorcall,
|
||||
}
|
||||
|
||||
pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>, flavor: Flavor)
|
||||
@@ -60,9 +60,9 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
if flavor == Flavor::Fastcall {
|
||||
if flavor == Flavor::FastcallOrVectorcall {
|
||||
// Mark arguments as InReg like clang does it,
|
||||
// so our fastcall is compatible with C/C++ fastcall.
|
||||
// so our fastcall/vectorcall is compatible with C/C++ fastcall/vectorcall.
|
||||
|
||||
// Clang reference: lib/CodeGen/TargetInfo.cpp
|
||||
// See X86_32ABIInfo::shouldPrimitiveUseInReg(), X86_32ABIInfo::updateFreeRegs()
|
||||
|
||||
Reference in New Issue
Block a user