mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-13 22:03:42 +00:00
Try old struct logic for vectorcall
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -305,7 +305,7 @@ enum ProcCallingConvention : i32 {
|
||||
ProcCC_PreserveMost = 12,
|
||||
ProcCC_PreserveAll = 13,
|
||||
|
||||
ProcCC_VectorCall = 14,
|
||||
ProcCC_VectorCall = 14,
|
||||
|
||||
ProcCC_MAX,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user