From b116e8ff55c9250d29f63d7b91cb749bf0766c4f Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 20 Sep 2024 01:29:39 +0100 Subject: Fix 128-bit integer support for wasm targets --- src/llvm_abi.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/llvm_abi.cpp') diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp index aa5c4dc60..42086b09d 100644 --- a/src/llvm_abi.cpp +++ b/src/llvm_abi.cpp @@ -1257,11 +1257,12 @@ namespace lbAbiWasm { } gb_internal lbArgType non_struct(LLVMContextRef c, LLVMTypeRef type, bool is_return) { - if (!is_return && type == LLVMIntTypeInContext(c, 128)) { - LLVMTypeRef cast_type = LLVMVectorType(LLVMInt64TypeInContext(c), 2); + if (type == LLVMIntTypeInContext(c, 128)) { + // LLVMTypeRef cast_type = LLVMVectorType(LLVMInt64TypeInContext(c), 2); + LLVMTypeRef cast_type = nullptr; return lb_arg_type_direct(type, cast_type, nullptr, nullptr); } - + if (!is_return && lb_sizeof(type) > 8) { return lb_arg_type_indirect(type, nullptr); } @@ -1282,7 +1283,7 @@ namespace lbAbiWasm { case LLVMPointerTypeKind: return true; case LLVMIntegerTypeKind: - return lb_sizeof(type) <= 8; + return lb_sizeof(type) <= 16; } return false; } -- cgit v1.2.3