From 1f58a36abbf94d6e497d189e718e7da882dabbc8 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Thu, 11 Sep 2025 23:47:20 +0200 Subject: [PATCH] r600/sfn: Add method to force-override the dest of an AluInstr Signed-off-by: Gert Wollny Part-of: --- src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp | 8 ++++++++ src/gallium/drivers/r600/sfn/sfn_instr_alu.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp b/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp index 25f0663e9a0..e9de6fd66c6 100644 --- a/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp @@ -537,6 +537,14 @@ bool AluInstr::do_replace_source(PRegister old_src, PVirtualValue new_src) return process; } +void +AluInstr::override_or_clear_dest(PRegister dummy_reg) +{ + m_alu_flags.reset(alu_write); + m_fallback_chan = m_dest->chan(); + m_dest = m_src.size() < 3 ? nullptr : dummy_reg; +} + bool AluInstr::replace_src(int i, PVirtualValue new_src, uint32_t to_set, SourceMod to_clear) { diff --git a/src/gallium/drivers/r600/sfn/sfn_instr_alu.h b/src/gallium/drivers/r600/sfn/sfn_instr_alu.h index 0d103b88956..e98cadddcc3 100644 --- a/src/gallium/drivers/r600/sfn/sfn_instr_alu.h +++ b/src/gallium/drivers/r600/sfn/sfn_instr_alu.h @@ -209,6 +209,8 @@ public: auto output_modifier() const { return m_output_modifier; } auto has_output_modifier() const { return m_output_modifier != omod_none; } + void override_or_clear_dest(PRegister dummy_reg); + private: friend class AluGroup;