pan/va: Add Valhall assembler
authorAlyssa Rosenzweig <alyssa@collabora.com>
Fri, 16 Jul 2021 14:52:43 +0000 (10:52 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 27 Jul 2021 20:20:32 +0000 (20:20 +0000)
commit508dfba9137347baa34c99ea6a58c05eb0dc27d9
tree39425d44b54fd93b4c5c653cac147d49bc9ee716
parentc43327c049612a8a0e91032479d7a6847074d86c
pan/va: Add Valhall assembler

This Python script acts as a standalone assembler. It takes Valhall
instructions with Mesa-flavour syntax, parses them, errors out if there
are syntax errors, and writes out an assembled binary if there are not.
It also is available as a programmatic interface for automated testing.

While this attempts to handle syntax errors, it does not check
semantics. It will happily compile programs that fault, provided each
instruction locally 'looks' plausible.

The code itself is quite small, despite supporting most of the known
ISA, because the syntax is regular and the heavylifting is done by
ISA.xml and valhall.py.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12025>
src/panfrost/bifrost/valhall/asm.py [new file with mode: 0644]