diff options
| author | gingerBill <bill@gingerbill.org> | 2022-05-26 14:55:10 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-05-26 14:55:10 +0100 |
| commit | 208226dba29d46514c8c2b7a8fcd023f1ebf7bd8 (patch) | |
| tree | 4db63fb2b368882cdbb38aff282112ca4b6d3aac /src/check_expr.cpp | |
| parent | f308f37ba112ca361715e470d513749236da026d (diff) | |
Improve `#simd` literal support
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 2a3b5bf02..b7568aa70 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -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) { |