Commit Graph

7 Commits

Author SHA1 Message Date
Alyssa Rosenzweig 258c1f5b24 pan/bi: Defer newline printing in disassembler
Easy reduction in generated code, while we're at it. Pretty obvious
change after working on similar fixes for the other generators.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:56 +00:00
Alyssa Rosenzweig d47e0af56b pan/bi: Add unused instruction mechanism
Certain instructions are highly unlikely to ever be used in the Bifrost
compiler, due to differences in the Mesa stack versus the Arm compiler,
as well as hardware features added speculatively and that never became
API visible. It doesn't make sense to include these instructions in the
IR, so let's disable them, while retaining complete disassembly.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8213>
2020-12-23 17:06:56 +00:00
Alyssa Rosenzweig b18855a0a1 pan/bi: Space out disassembly
Makes things much more legible with some "room to breathe".

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8139>
2020-12-21 21:54:50 +00:00
Boris Brezillon ccb3d7d8be panfrost: bifrost: disassemble: Fix decoding of next_regs
next_regs decoding is wrong for the first and last instructions in a
clause:
- the first instruction has its destination encoded in the second reg
  block
- the last instruction has its destination encoded in the first reg block
  (things wrap around)

So, only the last instruction should pass first=true when decoding
next_regs. Fix that by passing the is_last_instruction information
instead of is_first_instruction to the disasm helpers.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7040>
2020-10-07 14:21:20 +02:00
Alyssa Rosenzweig bdb33f7529 pan/bi: Pass 'first' through disassembler
Required to decode the registers of the first instruction of a clause
correctly.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6793>
2020-09-24 11:27:22 +00:00
Alyssa Rosenzweig 9de34e16e0 pan/bi: Track M values of disassembled constants
We'll want to route these values from the clause itself to the source
dump in order to disassemble modified embedded constants.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6793>
2020-09-24 11:27:21 +00:00
Alyssa Rosenzweig 82f33155f6 pan/bi: Add disassembler generator
Given a parsed instruction set definition, this script generates
instruction disassembly routines responsible for decoding instruction
words and pretty-printing. Decoding is somewhat complex as with the
previous disassembler but can be automated.

Disssembly is complicated by indirect specifications of instruction
modifiers. These specifiers are given as logic expressions in the XML,
which optimizes for straightforwaard packing but makes disassembly
awkward. Instead of attempting to invert the logic directly, we generate
lookup tables of `modifiers -> encoding` maps which we may invert
directly to produce a lookup table for the `encoding -> modifiers` map
needed for disassembly.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6749>
2020-09-16 20:05:34 +00:00