Restrict swizzle to a power of two for #simd

This commit is contained in:
gingerBill
2022-05-25 21:17:21 +01:00
parent b168bf9460
commit 1549d01bf7
3 changed files with 44 additions and 3 deletions

View File

@@ -4119,7 +4119,11 @@ ExactValue get_constant_field(CheckerContext *c, Operand const *operand, Selecti
Type *determine_swizzle_array_type(Type *original_type, Type *type_hint, isize new_count) {
Type *array_type = base_type(type_deref(original_type));
GB_ASSERT(array_type->kind == Type_Array);
GB_ASSERT(array_type->kind == Type_Array || array_type->kind == Type_SimdVector);
if (array_type->kind == Type_SimdVector) {
Type *elem_type = array_type->SimdVector.elem;
return alloc_type_simd_vector(new_count, elem_type);
}
Type *elem_type = array_type->Array.elem;
Type *swizzle_array_type = nullptr;