aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_abi.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-09-20 01:29:39 +0100
committergingerBill <bill@gingerbill.org>2024-09-20 01:29:39 +0100
commitb116e8ff55c9250d29f63d7b91cb749bf0766c4f (patch)
treec1c19e4eae13878e20130d4da089a79f93ee4d2f /src/llvm_abi.cpp
parenta4dd4892846c73d21793138f518fc4b877aebca8 (diff)
Fix 128-bit integer support for wasm targets
Diffstat (limited to 'src/llvm_abi.cpp')
-rw-r--r--src/llvm_abi.cpp9
1 files changed, 5 insertions, 4 deletions
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;
}