Improve #simd literal support

This commit is contained in:
gingerBill
2022-05-26 14:55:10 +01:00
parent f308f37ba1
commit 208226dba2
2 changed files with 47 additions and 38 deletions

View File

@@ -777,6 +777,14 @@ i64 check_distance_between_types(CheckerContext *c, Operand *operand, Type *type
return distance + 6;
}
}
if (is_type_simd_vector(dst)) {
Type *dst_elem = base_array_type(dst);
i64 distance = check_distance_between_types(c, operand, dst_elem);
if (distance >= 0) {
return distance + 6;
}
}
if (is_type_matrix(dst)) {
Type *dst_elem = base_array_type(dst);
@@ -786,6 +794,7 @@ i64 check_distance_between_types(CheckerContext *c, Operand *operand, Type *type
}
}
if (is_type_any(dst)) {
if (!is_type_polymorphic(src)) {
if (operand->mode == Addressing_Context && operand->type == t_context) {