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 <alyssa.rosenzweig@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6749>
This commit is contained in:
Alyssa Rosenzweig 2020-09-14 13:08:44 -04:00 committed by Marge Bot
parent 944cb8bcba
commit 05041811ce
2 changed files with 24 additions and 0 deletions

View 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 {

View 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