isaspec: Add initial decoding support
authorConnor Abbott <cwabbott0@gmail.com>
Mon, 26 Jun 2023 15:20:34 +0000 (17:20 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 28 Jul 2023 18:41:58 +0000 (18:41 +0000)
commit038680c2f6273889f0454a701308f5813a983267
tree5cd37c45fd01943dcd5145c5131b845fcdd2fb14
parent2faf344f037b41ceeaf14369854df5e1594c4590
isaspec: Add initial decoding support

This reuses the <map> entries in the <encode> block to go in the reverse
direction and parse an instruction into a machine-readable structure. It
currently assumes that <map> entries are simple l-values like
"src->src[0]" or "src->flag", which is enough for afuc, but the plan for
the future is to use the <decode> block to allow us to override that for
more complex cases.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23949>
src/compiler/isaspec/decode.py
src/compiler/isaspec/isa.py
src/compiler/isaspec/isaspec.h
src/compiler/isaspec/isaspec_decode_decl.h
src/compiler/isaspec/isaspec_decode_impl.c