diff --git a/releasenotes.md b/releasenotes.md index f60ad7bd8..306f0d554 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -30,7 +30,8 @@ - Bug fix for rethrow + defer catch. - Wrong size for structs containing overaligned structs #1219 - $typeof(*x) should be valid when x is an `[out]` parameter #1226 - +- Fix ABI lowering for 128 bit vectors on Linux. + ### Stdlib changes - Added `remove_first_item` `remove_last_item` and `remove_item` as aliases for the `match` functions. - Added @str_hash, @str_upper, @str_lower, @str_find compile time macros. diff --git a/src/compiler/abi/c_abi_x64.c b/src/compiler/abi/c_abi_x64.c index cec6a8b21..c5d8df89e 100644 --- a/src/compiler/abi/c_abi_x64.c +++ b/src/compiler/abi/c_abi_x64.c @@ -327,10 +327,9 @@ void x64_classify_vector(Type *type, ByteSize offset_base, X64Class *current, X6 } return; } + Type *element = type->array.base; if (size == 8) { - Type *element = type->array.base; - // 1 x double passed in memory (by gcc) if (element->type_kind == TYPE_F64) return; @@ -346,7 +345,8 @@ void x64_classify_vector(Type *type, ByteSize offset_base, X64Class *current, X6 } if (size == 16 || (named_arg == NAMED && size <= platform_target.x64.native_vector_size_avx)) { - if (platform_target.x64.pass_int128_vector_in_mem) return; + if (platform_target.x64.pass_int128_vector_in_mem + && size != 16 && type_is_int128(element)) return; *lo_class = CLASS_SSE; *hi_class = CLASS_SSEUP;