Update ARM64 ABI return type

This commit is contained in:
gingerBill
2024-03-20 11:12:43 +00:00
parent e4c502e79b
commit 1514d64964
+3 -8
View File
@@ -1145,14 +1145,9 @@ namespace lbAbiArm64 {
i64 size = lb_sizeof(return_type); i64 size = lb_sizeof(return_type);
if (size <= 16) { if (size <= 16) {
LLVMTypeRef cast_type = nullptr; LLVMTypeRef cast_type = nullptr;
if (size <= 1) {
cast_type = LLVMInt8TypeInContext(c); if (size <= 8) {
} else if (size <= 2) { cast_type = LLVMIntTypeInContext(c, cast(unsigned)(size*8));
cast_type = LLVMInt16TypeInContext(c);
} else if (size <= 4) {
cast_type = LLVMInt32TypeInContext(c);
} else if (size <= 8) {
cast_type = LLVMInt64TypeInContext(c);
} else { } else {
unsigned count = cast(unsigned)((size+7)/8); unsigned count = cast(unsigned)((size+7)/8);
cast_type = llvm_array_type(LLVMInt64TypeInContext(c), count); cast_type = llvm_array_type(LLVMInt64TypeInContext(c), count);