isaspec: Add support for function and entrypoint labels

Functions (i.e. labels reached from call instructions) should be printed
differently from normal labels. In addition we also need to add support
for entrypoints with user-defined names in order to show packet names in
afuc.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23949>
This commit is contained in:
Connor Abbott
2023-06-22 14:13:25 +02:00
committed by Marge Bot
parent 569d3ac5a1
commit dc874e4654
7 changed files with 133 additions and 8 deletions

View File

@@ -276,6 +276,30 @@ This would produce a disassembly like ``jump #l42`` if the destination is 42
instructions after the start of the disassembly. The destination would be
preceded by a line with just ``l42:``.
``branch`` and ``absbranch`` fields can additionally have a ``call="true"``
attribute. For now, this just changes the disassembly. In particular the label
prefix is changed to ``fxn`` and an extra empty line before the destination is
added to visually seperate the disassembly into functions. So, for example, a
call instruction defined like this:
.. code-block:: xml
<bitset name="call" extends="#instruction">
<display>
call #{OFFSET}
</display>
<pattern low="26" high="31">110010</pattern> <!-- opcode goes here -->
<field name="OFFSET" low="0" high="25" type="branch" call="true"/>
</bitset>
will disassemble to ``call #fxn42``.
Finally, users with special knowledge about where execution may start can define
"entrypoints" when disassembling which are printed like function call
destinations, with an extra empty line, but with an arbitrary user-defined
name. Names that are ``fxn`` or ``l`` followed by a number are discouraged
because they may clash with automatically-generated names.
Encoding
--------