Browse Source

Add `#simd[N]rawptr` support

gingerBill 1 year ago
parent
commit
a06cb8ba46
2 changed files with 4 additions and 1 deletions
  1. 1 1
      src/check_type.cpp
  2. 3 0
      src/types.cpp

+ 1 - 1
src/check_type.cpp

@@ -3171,7 +3171,7 @@ gb_internal void check_array_type_internal(CheckerContext *ctx, Ast *e, Type **t
 			} else if (name == "simd") {
 				if (!is_type_valid_vector_elem(elem) && !is_type_polymorphic(elem)) {
 					gbString str = type_to_string(elem);
-					error(at->elem, "Invalid element type for #simd, expected an integer, float, or boolean with no specific endianness, got '%s'", str);
+					error(at->elem, "Invalid element type for #simd, expected an integer, float, boolean, or 'rawptr' with no specific endianness, got '%s'", str);
 					gb_string_free(str);
 					*type = alloc_type_array(elem, count, generic_type);
 					return;

+ 3 - 0
src/types.cpp

@@ -2091,6 +2091,9 @@ gb_internal bool is_type_valid_vector_elem(Type *t) {
 		if (is_type_boolean(t)) {
 			return true;
 		}
+		if (t->Basic.kind == Basic_rawptr) {
+			return true;
+		}
 	}
 	return false;
 }