diff options
| author | gingerBill <bill@gingerbill.org> | 2022-07-24 22:46:00 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-07-24 22:46:00 +0100 |
| commit | 9614ca92f0a141d972b654c94b7dc6ae37c4e3b1 (patch) | |
| tree | 6f4232ad1f4516f44d9c82b95bddb11823a95c82 /src/llvm_abi.cpp | |
| parent | b28d4b753b1a3b52f90e215218e63ef9bf455bc9 (diff) | |
Fix #1834
Diffstat (limited to 'src/llvm_abi.cpp')
| -rw-r--r-- | src/llvm_abi.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp index 60a07e531..b22a839b3 100644 --- a/src/llvm_abi.cpp +++ b/src/llvm_abi.cpp @@ -233,7 +233,7 @@ i64 lb_sizeof(LLVMTypeRef type) { i64 elem_size = lb_sizeof(elem); i64 count = LLVMGetVectorSize(type); i64 size = count * elem_size; - return gb_clamp(next_pow2(size), 1, build_context.max_align); + return next_pow2(size); } } @@ -801,16 +801,23 @@ namespace lbAbiAmd64SysV { i64 elem_sz = lb_sizeof(elem); LLVMTypeKind elem_kind = LLVMGetTypeKind(elem); RegClass reg = RegClass_NoClass; + unsigned elem_width = LLVMGetIntTypeWidth(elem); switch (elem_kind) { case LLVMIntegerTypeKind: case LLVMHalfTypeKind: - switch (LLVMGetIntTypeWidth(elem)) { - case 8: reg = RegClass_SSEInt8; - case 16: reg = RegClass_SSEInt16; - case 32: reg = RegClass_SSEInt32; - case 64: reg = RegClass_SSEInt64; + switch (elem_width) { + case 8: reg = RegClass_SSEInt8; break; + case 16: reg = RegClass_SSEInt16; break; + case 32: reg = RegClass_SSEInt32; break; + case 64: reg = RegClass_SSEInt64; break; default: - GB_PANIC("Unhandled integer width for vector type"); + if (elem_width > 64) { + for (i64 i = 0; i < len; i++) { + classify_with(elem, cls, ix, off + i*elem_sz); + } + break; + } + GB_PANIC("Unhandled integer width for vector type %u", elem_width); } break; case LLVMFloatTypeKind: |