Begin work on matrix type

This commit is contained in:
gingerBill
2021-10-18 16:52:19 +01:00
parent 7aac8df2f2
commit 4c655865e5
14 changed files with 367 additions and 9 deletions
+9
View File
@@ -162,6 +162,13 @@ Type_Info_Relative_Slice :: struct {
slice: ^Type_Info,
base_integer: ^Type_Info,
}
Type_Info_Matrix :: struct {
elem: ^Type_Info,
elem_size: int,
stride: int, // bytes
row_count: int,
column_count: int,
}
Type_Info_Flag :: enum u8 {
Comparable = 0,
@@ -202,6 +209,7 @@ Type_Info :: struct {
Type_Info_Simd_Vector,
Type_Info_Relative_Pointer,
Type_Info_Relative_Slice,
Type_Info_Matrix,
},
}
@@ -233,6 +241,7 @@ Typeid_Kind :: enum u8 {
Simd_Vector,
Relative_Pointer,
Relative_Slice,
Matrix,
}
#assert(len(Typeid_Kind) < 32)
+8
View File
@@ -370,5 +370,13 @@ print_type :: proc "contextless" (ti: ^Type_Info) {
print_type(info.base_integer)
print_string(") ")
print_type(info.slice)
case Type_Info_Matrix:
print_string("[")
print_u64(u64(info.row_count))
print_string("; ")
print_u64(u64(info.column_count))
print_string("]")
print_type(info.elem)
}
}