diff options
| author | gingerBill <bill@gingerbill.org> | 2022-05-25 18:59:47 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-05-25 18:59:47 +0100 |
| commit | f21e9ee71281ec8665a3009cd1a350ffde3b7046 (patch) | |
| tree | 3ee15fd5c58bc5ac200201d4d3bc3f64a7a7d6c5 /src/check_expr.cpp | |
| parent | 81dd727f750aad45c6468de64a12119a3141de55 (diff) | |
Allow basic casting of simd vectors
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index a4dfade98..9a7cd5b8b 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -2688,6 +2688,18 @@ bool check_is_castable_to(CheckerContext *c, Operand *operand, Type *y) { return true; } + if (is_type_simd_vector(src) && is_type_simd_vector(dst)) { + if (src->SimdVector.count != dst->SimdVector.count) { + return false; + } + Type *elem_src = base_array_type(src); + Type *elem_dst = base_array_type(dst); + Operand x = {}; + x.type = elem_src; + x.mode = Addressing_Value; + return check_is_castable_to(c, &x, elem_dst); + } + return false; } |