aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-03-20 16:06:50 +0000
committergingerBill <bill@gingerbill.org>2024-03-20 16:06:50 +0000
commitb4fe9677a1f69acde12e7cf296269f0c4d98362f (patch)
tree58e1394535987130f6c7713be8d861113ca21502 /src
parent1951bc45a68ec930d5e10620f9e4e9c84cf74ded (diff)
Change ARM64 ABI for integer-like parameters
Diffstat (limited to 'src')
-rw-r--r--src/llvm_abi.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp
index 24e86fa64..fcd22a40d 100644
--- a/src/llvm_abi.cpp
+++ b/src/llvm_abi.cpp
@@ -1183,14 +1183,8 @@ namespace lbAbiArm64 {
i64 size = lb_sizeof(type);
if (size <= 16) {
LLVMTypeRef cast_type = nullptr;
- if (size <= 1) {
- cast_type = LLVMIntTypeInContext(c, 8);
- } else if (size <= 2) {
- cast_type = LLVMIntTypeInContext(c, 16);
- } else if (size <= 4) {
- cast_type = LLVMIntTypeInContext(c, 32);
- } else if (size <= 8) {
- cast_type = LLVMIntTypeInContext(c, 64);
+ if (size <= 8) {
+ cast_type = LLVMIntTypeInContext(c, cast(unsigned)(size*8));
} else {
unsigned count = cast(unsigned)((size+7)/8);
cast_type = llvm_array_type(LLVMIntTypeInContext(c, 64), count);