aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-05-25 21:29:45 +0100
committergingerBill <bill@gingerbill.org>2022-05-25 21:29:45 +0100
commit63cc8a80a045d48960d85640d11f39237c2f8ca4 (patch)
tree270f01c9c64ef01b7c4cc140f2c5e311e9c3f4d9 /src/types.cpp
parent1549d01bf76e8c5e13626e57b1f976330a9cdd50 (diff)
Correct parapoly for #simd
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/types.cpp b/src/types.cpp
index 755f78f1c..2d5709b19 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -261,6 +261,7 @@ struct TypeProc {
TYPE_KIND(SimdVector, struct { \
i64 count; \
Type *elem; \
+ Type *generic_count; \
}) \
TYPE_KIND(RelativePointer, struct { \
Type *pointer_type; \
@@ -1085,10 +1086,11 @@ Type *alloc_type_bit_set() {
-Type *alloc_type_simd_vector(i64 count, Type *elem) {
+Type *alloc_type_simd_vector(i64 count, Type *elem, Type *generic_count=nullptr) {
Type *t = alloc_type(Type_SimdVector);
t->SimdVector.count = count;
t->SimdVector.elem = elem;
+ t->SimdVector.generic_count = generic_count;
return t;
}
@@ -2078,6 +2080,11 @@ bool is_type_polymorphic(Type *t, bool or_specialized=false) {
return true;
}
return is_type_polymorphic(t->Array.elem, or_specialized);
+ case Type_SimdVector:
+ if (t->SimdVector.generic_count != nullptr) {
+ return true;
+ }
+ return is_type_polymorphic(t->SimdVector.elem, or_specialized);
case Type_DynamicArray:
return is_type_polymorphic(t->DynamicArray.elem, or_specialized);
case Type_Slice: