From 05041811ce51ebf53cd77acd88c53670b0ef78b1 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 14 Sep 2020 13:08:44 -0400 Subject: [PATCH] pan/bi: Add bi_disasm_dest_* helpers Used to print the actual register/temporary for an instruction destination given the port arrangement. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Daniel Stone Part-of: --- src/panfrost/bifrost/disassemble.c | 21 +++++++++++++++++++++ src/panfrost/bifrost/disassemble.h | 3 +++ 2 files changed, 24 insertions(+) diff --git a/src/panfrost/bifrost/disassemble.c b/src/panfrost/bifrost/disassemble.c index 20a047e..437ed73 100644 --- a/src/panfrost/bifrost/disassemble.c +++ b/src/panfrost/bifrost/disassemble.c @@ -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 { diff --git a/src/panfrost/bifrost/disassemble.h b/src/panfrost/bifrost/disassemble.h index dd5b38d..0f7ed50 100644 --- a/src/panfrost/bifrost/disassemble.h +++ b/src/panfrost/bifrost/disassemble.h @@ -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 -- 2.7.4