mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Patch win64 ABI problem caused by a bug in LLVM for 128 bit integers
This commit is contained in:
+6
-1
@@ -400,7 +400,12 @@ namespace lbAbi386 {
|
|||||||
lb_is_type_kind(type, LLVMIntegerTypeKind) &&
|
lb_is_type_kind(type, LLVMIntegerTypeKind) &&
|
||||||
type == LLVMIntTypeInContext(c, 128)) {
|
type == LLVMIntTypeInContext(c, 128)) {
|
||||||
// NOTE(bill): Because Windows AMD64 is weird
|
// NOTE(bill): Because Windows AMD64 is weird
|
||||||
LLVMTypeRef cast_type = LLVMVectorType(LLVMInt64TypeInContext(c), 2);
|
// TODO(bill): LLVM is probably bugged here and doesn't correctly generate the right code
|
||||||
|
// So even though it is "technically" wrong, no cast might be the best option
|
||||||
|
LLVMTypeRef cast_type = nullptr;
|
||||||
|
if (!is_return) {
|
||||||
|
cast_type = LLVMVectorType(LLVMInt64TypeInContext(c), 2);
|
||||||
|
}
|
||||||
return lb_arg_type_direct(type, cast_type, nullptr, nullptr);
|
return lb_arg_type_direct(type, cast_type, nullptr, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user