Try old struct logic for vectorcall

This commit is contained in:
gingerBill
2026-04-08 11:09:05 +01:00
parent 39acfd4d62
commit a65bb976b3
3 changed files with 18 additions and 1 deletions

View File

@@ -486,6 +486,7 @@ namespace lbAbiAmd64Win64 {
switch (calling_convention) {
case ProcCC_Odin:
case ProcCC_Contextless:
return true;
case ProcCC_VectorCall:
return true;
}
@@ -501,12 +502,27 @@ namespace lbAbiAmd64Win64 {
if (is_vectorcall(calling_convention)) {
if (kind == LLVMStructTypeKind || kind == LLVMArrayTypeKind) {
#if 0
i64 sz = lb_sizeof(t);
if (sz <= 8) {
args[i] = lb_arg_type_direct(t, LLVMIntTypeInContext(c, 8*cast(unsigned)sz), nullptr, nullptr);
} else {
args[i] = lb_arg_type_indirect(t, nullptr);
}
#else
i64 sz = lb_sizeof(t);
switch (sz) {
case 1:
case 2:
case 4:
case 8:
args[i] = lb_arg_type_direct(t, LLVMIntTypeInContext(c, 8*cast(unsigned)sz), nullptr, nullptr);
break;
default:
args[i] = lb_arg_type_indirect(t, nullptr);
break;
}
#endif
}
if (kind == LLVMVectorTypeKind) {

View File

@@ -741,6 +741,7 @@ lbCallingConventionKind const lb_calling_convention_map[ProcCC_MAX] = {
lbCallingConvention_PreserveMost, // ProcCC_PreserveMost,
lbCallingConvention_PreserveAll, // ProcCC_PreserveAll,
lbCallingConvention_X86_VectorCall, // ProcCC_VectorCall,
};
enum : LLVMDWARFTypeEncoding {

View File

@@ -305,7 +305,7 @@ enum ProcCallingConvention : i32 {
ProcCC_PreserveMost = 12,
ProcCC_PreserveAll = 13,
ProcCC_VectorCall = 14,
ProcCC_VectorCall = 14,
ProcCC_MAX,