mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 13:10:10 +01:00
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:
parent
a0635f8f52
commit
76e1588ca8
1 changed files with 13 additions and 0 deletions
|
|
@ -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__':
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue