From afa545b9265588d5855366708ad79521d7c313bb Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Tue, 28 Feb 2023 16:22:34 +0100 Subject: [PATCH] r600/sfn: Add AluGroup method to update readport validation from scratch Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8374 Signed-off-by: Gert Wollny Part-of: --- .../drivers/r600/sfn/sfn_instr_alugroup.cpp | 35 ++++++++++++++++++++++ src/gallium/drivers/r600/sfn/sfn_instr_alugroup.h | 2 ++ 2 files changed, 37 insertions(+) diff --git a/src/gallium/drivers/r600/sfn/sfn_instr_alugroup.cpp b/src/gallium/drivers/r600/sfn/sfn_instr_alugroup.cpp index 86c7cf9..c8b144f 100644 --- a/src/gallium/drivers/r600/sfn/sfn_instr_alugroup.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_instr_alugroup.cpp @@ -251,6 +251,41 @@ AluGroup::add_vec_instructions(AluInstr *instr) return false; } +void AluGroup::update_readport_reserver() +{ + AluReadportReservation readports_evaluator; + for (int i = 0; i < 4; ++i) { + if (!m_slots[i]) + continue; + + AluReadportReservation re = readports_evaluator; + AluBankSwizzle bs = alu_vec_012; + while (bs != alu_vec_unknown) { + if (re.schedule_vec_instruction(*m_slots[i], bs)) { + readports_evaluator = re; + break; + } + ++bs; + } + if (bs == alu_vec_unknown) + unreachable("Bank swizzle should have been checked before"); + } + + if (s_max_slots == 5 && m_slots[4]) { + AluReadportReservation re = readports_evaluator; + AluBankSwizzle bs = sq_alu_scl_201; + while (bs != sq_alu_scl_unknown) { + if (re.schedule_vec_instruction(*m_slots[4], bs)) { + readports_evaluator = re; + break; + } + ++bs; + } + if (bs == sq_alu_scl_unknown) + unreachable("Bank swizzle should have been checked before"); + } +} + bool AluGroup::try_readport(AluInstr *instr, AluBankSwizzle cycle) { diff --git a/src/gallium/drivers/r600/sfn/sfn_instr_alugroup.h b/src/gallium/drivers/r600/sfn/sfn_instr_alugroup.h index b3906e4..05e71a0 100644 --- a/src/gallium/drivers/r600/sfn/sfn_instr_alugroup.h +++ b/src/gallium/drivers/r600/sfn/sfn_instr_alugroup.h @@ -86,6 +86,8 @@ public: m_readports_evaluator = rr; }; + void update_readport_reserver(); + static bool has_t() { return s_max_slots == 5; } bool addr_for_src() const { return m_addr_for_src; } -- 2.7.4