mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Fixes to ABI
This commit is contained in:
+1
-1
@@ -440,7 +440,7 @@ bool sig_compare(TypeCheckSig *a, TypeCheckSig *b, Type *x, Type *y) {
|
|||||||
if (a == b) {
|
if (a == b) {
|
||||||
return sig_compare(a, x, y);
|
return sig_compare(a, x, y);
|
||||||
}
|
}
|
||||||
return (a(x) && b(y) || b(x) && a(y));
|
return ((a(x) && b(y)) || (b(x) && a(y)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool signature_parameter_similar_enough(Type *x, Type *y) {
|
bool signature_parameter_similar_enough(Type *x, Type *y) {
|
||||||
|
|||||||
+14
-15
@@ -1842,6 +1842,10 @@ Type *type_to_abi_compat_param_type(gbAllocator a, Type *original_type, ProcCall
|
|||||||
return new_type;
|
return new_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cc == ProcCC_None) {
|
||||||
|
return new_type;
|
||||||
|
}
|
||||||
|
|
||||||
if (build_context.ODIN_ARCH == "386") {
|
if (build_context.ODIN_ARCH == "386") {
|
||||||
return new_type;
|
return new_type;
|
||||||
}
|
}
|
||||||
@@ -1849,21 +1853,17 @@ Type *type_to_abi_compat_param_type(gbAllocator a, Type *original_type, ProcCall
|
|||||||
if (is_type_simd_vector(original_type)) {
|
if (is_type_simd_vector(original_type)) {
|
||||||
return new_type;
|
return new_type;
|
||||||
}
|
}
|
||||||
|
if (build_context.word_size == 8) {
|
||||||
|
if (is_type_integer_128bit(original_type)) {
|
||||||
|
return alloc_type_simd_vector(2, t_u64);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (build_context.ODIN_OS == "windows") {
|
if (build_context.ODIN_OS == "windows") {
|
||||||
// NOTE(bill): Changing the passing parameter value type is to match C's ABI
|
// NOTE(bill): Changing the passing parameter value type is to match C's ABI
|
||||||
// IMPORTANT TODO(bill): This only matches the ABI on MSVC at the moment
|
// IMPORTANT TODO(bill): This only matches the ABI on MSVC at the moment
|
||||||
// SEE: https://msdn.microsoft.com/en-us/library/zthk2dkh.aspx
|
// SEE: https://msdn.microsoft.com/en-us/library/zthk2dkh.aspx
|
||||||
|
|
||||||
if (build_context.word_size == 8) {
|
|
||||||
if (is_type_integer_128bit(original_type)) {
|
|
||||||
if (cc == ProcCC_None) {
|
|
||||||
return original_type;
|
|
||||||
} else {
|
|
||||||
return alloc_type_simd_vector(2, t_u64);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Type *bt = core_type(original_type);
|
Type *bt = core_type(original_type);
|
||||||
switch (bt->kind) {
|
switch (bt->kind) {
|
||||||
@@ -2044,14 +2044,13 @@ bool abi_compat_return_by_pointer(gbAllocator a, ProcCallingConvention cc, Type
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (build_context.word_size == 8) {
|
||||||
|
if (is_type_integer_128bit(single_type)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (build_context.ODIN_OS == "windows") {
|
if (build_context.ODIN_OS == "windows") {
|
||||||
if (build_context.word_size == 8) {
|
|
||||||
if (is_type_integer_128bit(single_type)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
i64 size = 8*type_size_of(abi_return_type);
|
i64 size = 8*type_size_of(abi_return_type);
|
||||||
switch (size) {
|
switch (size) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|||||||
+1
-1
@@ -301,7 +301,7 @@ void print_query_data_as_json(QueryValue *value, bool format = true, isize inden
|
|||||||
}
|
}
|
||||||
case Query_Integer: {
|
case Query_Integer: {
|
||||||
auto v = cast(QueryValueInteger *)value;
|
auto v = cast(QueryValueInteger *)value;
|
||||||
gb_printf("%lld", v->value);
|
gb_printf("%lld", cast(long long)v->value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case Query_Float: {
|
case Query_Float: {
|
||||||
|
|||||||
Reference in New Issue
Block a user