aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_abi.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-03-20 11:12:43 +0000
committergingerBill <bill@gingerbill.org>2024-03-20 11:12:43 +0000
commit1514d6496447506f7d8f43168a36147f9007b0d2 (patch)
treed8fb5ba92330e706b9eb4845bd50d4af35bf36e7 /src/llvm_abi.cpp
parente4c502e79b4fba9924aac4ff029889a494d3f1ae (diff)
Update ARM64 ABI return type
Diffstat (limited to 'src/llvm_abi.cpp')
-rw-r--r--src/llvm_abi.cpp11
1 files 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);