From 1514d6496447506f7d8f43168a36147f9007b0d2 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 20 Mar 2024 11:12:43 +0000 Subject: [PATCH] Update ARM64 ABI return type --- src/llvm_abi.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp index 857b255f3..24e86fa64 100644 --- a/src/llvm_abi.cpp +++ b/src/llvm_abi.cpp @@ -1145,14 +1145,9 @@ namespace lbAbiArm64 { i64 size = lb_sizeof(return_type); if (size <= 16) { LLVMTypeRef cast_type = nullptr; - if (size <= 1) { - cast_type = LLVMInt8TypeInContext(c); - } else if (size <= 2) { - cast_type = LLVMInt16TypeInContext(c); - } else if (size <= 4) { - cast_type = LLVMInt32TypeInContext(c); - } else if (size <= 8) { - cast_type = LLVMInt64TypeInContext(c); + + if (size <= 8) { + cast_type = LLVMIntTypeInContext(c, cast(unsigned)(size*8)); } else { unsigned count = cast(unsigned)((size+7)/8); cast_type = llvm_array_type(LLVMInt64TypeInContext(c), count);