etnaviv: isa: Generate opcode enum
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28183>
This commit is contained in:
committed by
Marge Bot
parent
a0635f8f52
commit
76e1588ca8
@@ -52,6 +52,19 @@ def main():
|
||||
|
||||
enums[name] = e
|
||||
|
||||
opc = {}
|
||||
|
||||
for instr in isa.instructions():
|
||||
pattern = instr.xml.findall('pattern')
|
||||
bit05 = int(pattern[0].text, 2)
|
||||
bit6 = int(pattern[1].text, 2)
|
||||
num = bit05 | (bit6 << 6)
|
||||
|
||||
opc[prefix.upper() + '_OPC_' + instr.name.upper()] = num
|
||||
|
||||
opc = dict(sorted(opc.items(), key=lambda item: int(item[1])))
|
||||
enums['opc'] = opc
|
||||
|
||||
print(Template(template).render(prefix=prefix, enums=enums))
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user