diff options
| author | Colin Davidson <colrdavidson@gmail.com> | 2024-11-20 15:51:08 -0800 |
|---|---|---|
| committer | Colin Davidson <colrdavidson@gmail.com> | 2024-11-20 15:51:08 -0800 |
| commit | d60fb5a44e4d2e371562fd38947f8125b06bceb9 (patch) | |
| tree | 4e924ee102c2af7b30d29017ab716ed00c51ab26 /src/llvm_abi.cpp | |
| parent | f3ab14b8ccb45d0fef8a96937635bdf0943ce7d6 (diff) | |
| parent | 3229f4668dfaa5f43a374bc549f42661b002699d (diff) | |
update to master
Diffstat (limited to 'src/llvm_abi.cpp')
| -rw-r--r-- | src/llvm_abi.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp index 42086b09d..0b2bb7956 100644 --- a/src/llvm_abi.cpp +++ b/src/llvm_abi.cpp @@ -531,6 +531,7 @@ namespace lbAbiAmd64SysV { RegClass_SSEInt16, RegClass_SSEInt32, RegClass_SSEInt64, + RegClass_SSEInt128, RegClass_SSEUp, RegClass_X87, RegClass_X87Up, @@ -572,6 +573,15 @@ namespace lbAbiAmd64SysV { gb_internal Array<RegClass> classify(LLVMTypeRef t); gb_internal LLVMTypeRef llreg(LLVMContextRef c, Array<RegClass> const ®_classes, LLVMTypeRef type); + gb_internal LB_ABI_COMPUTE_RETURN_TYPE(compute_return_type) { + if (!return_is_defined) { + return lb_arg_type_direct(LLVMVoidTypeInContext(c)); + } + LB_ABI_MODIFY_RETURN_IF_TUPLE_MACRO(); + + return amd64_type(c, return_type, Amd64TypeAttribute_StructRect, ft->calling_convention); + } + gb_internal LB_ABI_INFO(abi_info) { LLVMContextRef c = m->ctx; lbFunctionType *ft = gb_alloc_item(permanent_allocator(), lbFunctionType); @@ -582,12 +592,7 @@ namespace lbAbiAmd64SysV { for (unsigned i = 0; i < arg_count; i++) { ft->args[i] = amd64_type(c, arg_types[i], Amd64TypeAttribute_ByVal, calling_convention); } - - if (return_is_defined) { - ft->ret = amd64_type(c, return_type, Amd64TypeAttribute_StructRect, calling_convention); - } else { - ft->ret = lb_arg_type_direct(LLVMVoidTypeInContext(c)); - } + ft->ret = compute_return_type(ft, c, return_type, return_is_defined, return_is_tuple); return ft; } @@ -616,6 +621,10 @@ namespace lbAbiAmd64SysV { } switch (kind) { case LLVMIntegerTypeKind: + if (LLVM_VERSION_MAJOR >= 18 && sz >= 16) { + return true; + } + return false; case LLVMHalfTypeKind: case LLVMFloatTypeKind: case LLVMDoubleTypeKind: |