diff options
| author | gingerBill <bill@gingerbill.org> | 2019-02-23 18:05:41 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-02-23 18:05:41 +0000 |
| commit | 38ae2e9efaf8d227a138d749085599e7ee9fde54 (patch) | |
| tree | d2b5e32dc31dab7b055bbf7da38e55c4a5b96811 /src/types.cpp | |
| parent | 684945ea57da61c82ab5425930c5571157359cfb (diff) | |
Allow basic arithmetic operations for vectors
Diffstat (limited to 'src/types.cpp')
| -rw-r--r-- | src/types.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/types.cpp b/src/types.cpp index 6dcbf029f..c6886e984 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -974,11 +974,20 @@ bool is_type_poly_proc(Type *t) { t = base_type(t); return t->kind == Type_Proc && t->Proc.is_polymorphic; } +bool is_type_simd_vector(Type *t) { + t = base_type(t); + return t->kind == Type_SimdVector; +} + Type *base_array_type(Type *t) { if (is_type_array(t)) { t = base_type(t); return t->Array.elem; } + if (is_type_simd_vector(t)) { + t = base_type(t); + return t->SimdVector.elem; + } return t; } @@ -987,10 +996,6 @@ bool is_type_generic(Type *t) { return t->kind == Type_Generic; } -bool is_type_simd_vector(Type *t) { - t = base_type(t); - return t->kind == Type_SimdVector; -} Type *core_array_type(Type *t) { |