[gamecode] Invert the meaning of the skip matrix

Rather than specifying that the conversion should be skipped, it now
specifies the mode of the conversions (with 0 being no conversion). This
is in preparation for boolean conversion.
This commit is contained in:
Bill Currie 2022-01-13 15:58:12 +09:00
parent 6f6f47e27e
commit 3eb2194343
1 changed files with 11 additions and 10 deletions

View File

@ -34,22 +34,23 @@ vec_types = [
"ulvec", "ulvec",
None, # no such thing as unsigned double None, # no such thing as unsigned double
] ]
skip_matrix = [ convert_matrix = [
#i f l d ui X ul X #i f l d ui X ul X
[1, 0, 0, 0, 1, 1, 0, 1], # i [0, 1, 1, 1, 0, 0, 1, 0], # i
[0, 1, 0, 0, 0, 1, 0, 1], # f [1, 0, 1, 1, 1, 0, 1, 0], # f
[0, 0, 1, 0, 0, 1, 1, 1], # l [1, 1, 0, 1, 1, 0, 0, 0], # l
[0, 0, 0, 1, 0, 1, 0, 1], # d [1, 1, 1, 0, 1, 0, 1, 0], # d
[1, 0, 0, 0, 1, 1, 0, 1], # ui [0, 1, 1, 1, 0, 0, 1, 0], # ui
[1, 1, 1, 1, 1, 1, 1, 1], # X [0, 0, 0, 0, 0, 0, 0, 0], # X
[0, 0, 1, 0, 0, 1, 1, 1], # ul [1, 1, 0, 1, 1, 0, 0, 0], # ul
[1, 1, 1, 1, 1, 1, 1, 1], # X [0, 0, 0, 0, 0, 0, 0, 0], # X
] ]
for width in range(4): for width in range(4):
for src_type in range(8): for src_type in range(8):
for dst_type in range(8): for dst_type in range(8):
if skip_matrix[src_type][dst_type]: mode = convert_matrix[src_type][dst_type]
if not mode:
continue continue
case = (width << 6) | (src_type << 3) | (dst_type) case = (width << 6) | (src_type << 3) | (dst_type)
if width == 0: if width == 0: