Mesa (main): pan/va: Add whitespace after disassembled branches
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon May 9 21:09:37 UTC 2022
Module: Mesa
Branch: main
Commit: 269eb0cdd526d2020e67c6d42abe6d9e499bc98e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=269eb0cdd526d2020e67c6d42abe6d9e499bc98e
Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date: Mon May 9 10:40:46 2022 -0400
pan/va: Add whitespace after disassembled branches
To make the disassembly easier to read, add whitespace after disassembled
branches. This makes the basic blocks of the original control flow graph more
obvious, to aid comparison with the IR.
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16409>
---
src/panfrost/bifrost/valhall/disassemble.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/panfrost/bifrost/valhall/disassemble.h b/src/panfrost/bifrost/valhall/disassemble.h
index 38eba1c1cc3..1840268ba98 100644
--- a/src/panfrost/bifrost/valhall/disassemble.h
+++ b/src/panfrost/bifrost/valhall/disassemble.h
@@ -61,6 +61,15 @@ disassemble_valhall(FILE *fp, const uint64_t *code, unsigned size, bool verbose)
va_disasm_instr(fp, instr);
fprintf(fp, "\n");
+
+ /* Detect branches */
+ uint64_t opcode = (instr >> 48) & MASK(9);
+ bool branchz = (opcode == 0x1F);
+ bool branchzi = (opcode == 0x2F);
+
+ /* Separate blocks visually by inserting whitespace after branches */
+ if (branchz || branchzi)
+ fprintf(fp, "\n");
}
fprintf(fp, "\n");
More information about the mesa-commit
mailing list