pan/bi: Add bi_disasm_dest_* helpers
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 14 Sep 2020 17:08:44 +0000 (13:08 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 16 Sep 2020 20:05:34 +0000 (20:05 +0000)
Used to print the actual register/temporary for an instruction
destination given the port arrangement.

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>

src/panfrost/bifrost/disassemble.c
src/panfrost/bifrost/disassemble.h

index 20a047e..437ed73 100644 (file)
@@ -308,6 +308,27 @@ static void dump_regs(FILE *fp, struct bifrost_regs srcs)
 
         fprintf(fp, "\n");
 }
+
+void
+bi_disasm_dest_fma(FILE *fp, struct bifrost_regs *next_regs)
+{
+    struct bifrost_reg_ctrl next_ctrl = DecodeRegCtrl(fp, *next_regs);
+    if (next_ctrl.fma_write_unit != REG_WRITE_NONE)
+        fprintf(fp, "r%u:t0", GetRegToWrite(next_ctrl.fma_write_unit, *next_regs));
+    else
+        fprintf(fp, "t0");
+}
+
+void
+bi_disasm_dest_add(FILE *fp, struct bifrost_regs *next_regs)
+{
+    struct bifrost_reg_ctrl next_ctrl = DecodeRegCtrl(fp, *next_regs);
+    if (next_ctrl.add_write_unit != REG_WRITE_NONE)
+        fprintf(fp, "r%u:t1", GetRegToWrite(next_ctrl.add_write_unit, *next_regs));
+    else
+        fprintf(fp, "t1");
+}
+
 static void dump_const_imm(FILE *fp, uint32_t imm)
 {
         union {
index dd5b38d..0f7ed50 100644 (file)
@@ -39,4 +39,7 @@ bi_disasm_fma(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost
 
 void bi_disasm_add(FILE *fp, unsigned bits, struct bifrost_regs *srcs, struct bifrost_regs *next_regs, unsigned staging_register, unsigned branch_offset, uint64_t *consts);
 
+void bi_disasm_dest_fma(FILE *fp, struct bifrost_regs *next_regs);
+void bi_disasm_dest_add(FILE *fp, struct bifrost_regs *next_regs);
+
 #endif