From: Gert Wollny Date: Thu, 26 Jan 2023 16:11:02 +0000 (+0100) Subject: r600/sfn: Handle MOVA_INT in sfn assembler X-Git-Tag: upstream/23.3.3~9341 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c5ea9182b4de113fb527e87d75bfd476f2a93b2b;p=platform%2Fupstream%2Fmesa.git r600/sfn: Handle MOVA_INT in sfn assembler To properly emit ALU clauses we have to make sure the backend doesn't add instructions for the address emission. Signed-off-by: Gert Wollny Part-of: --- diff --git a/src/gallium/drivers/r600/sfn/sfn_assembler.cpp b/src/gallium/drivers/r600/sfn/sfn_assembler.cpp index 0fc2cbd..3d59b73 100644 --- a/src/gallium/drivers/r600/sfn/sfn_assembler.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_assembler.cpp @@ -110,7 +110,7 @@ public: std::set vtx_fetch_results; std::set tex_fetch_results; - PRegister m_last_addr{nullptr}; + const VirtualValue *m_last_addr{nullptr}; unsigned m_max_color_exports{0}; int m_loop_nesting{0}; @@ -288,6 +288,16 @@ AssamblerVisitor::emit_alu_op(const AluInstr& ai) if (m_legacy_math_rules) opcode = translate_for_mathrules(opcode); + if (opcode == op1_mova_int) { + m_bc->ar_loaded = 1; + m_last_addr = ai.psrc(0); + m_bc->ar_chan = m_last_addr->chan(); + m_bc->ar_reg = m_last_addr->sel(); + // TODO: this must be deducted correctly or in the scheduler + // we have to inject nop instructions to fix the aliasing problem + r600_load_ar(m_bc, true); + } + auto hw_opcode = opcode_map.find(opcode); if (hw_opcode == opcode_map.end()) { @@ -399,8 +409,6 @@ AssamblerVisitor::emit_alu_op(const AluInstr& ai) m_result = !r600_bytecode_add_alu_type(m_bc, &alu, type); - if (ai.opcode() == op1_mova_int) - m_bc->ar_loaded = 0; if (ai.opcode() == op1_set_cf_idx0) m_bc->index_loaded[0] = 1; diff --git a/src/gallium/drivers/r600/sfn/sfn_instr_alu.h b/src/gallium/drivers/r600/sfn/sfn_instr_alu.h index 20b8a29..5982d70 100644 --- a/src/gallium/drivers/r600/sfn/sfn_instr_alu.h +++ b/src/gallium/drivers/r600/sfn/sfn_instr_alu.h @@ -115,6 +115,7 @@ public: int dest_chan() const { return m_dest ? m_dest->chan() : m_fallback_chan; } + const VirtualValue *psrc(unsigned i) const { return i < m_src.size() ? m_src[i] : nullptr; } PVirtualValue psrc(unsigned i) { return i < m_src.size() ? m_src[i] : nullptr; } VirtualValue& src(unsigned i) {