r600/sfn: Simplify m_last_addr tracking in emit_alu_op

Assisted-by: Copilot (auto mode)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41945>
This commit is contained in:
Gert Wollny 2026-05-01 00:07:57 +02:00 committed by Marge Bot
parent e55dbc7882
commit 021cbaba7d

View file

@ -284,12 +284,16 @@ AssemblerVisitor::emit_alu_op(const AluInstr& ai)
auto opcode = ai.opcode();
if (unlikely(opcode == op1_mova_int &&
(m_bc.gfx_level < CAYMAN ||
(ai.dest() && ai.dest()->sel() == 0)))) {
m_last_addr = ai.psrc(0);
m_bc.ar_chan = m_last_addr->chan();
m_bc.ar_reg = m_last_addr->sel();
auto dst = ai.dest();
if (unlikely(opcode == op1_mova_int)) {
if (m_bc.gfx_level < CAYMAN || (dst && dst->sel() == 0)) {
m_last_addr = ai.psrc(0);
m_bc.ar_chan = m_last_addr->chan();
m_bc.ar_reg = m_last_addr->sel();
}
} else if (dst && m_last_addr && m_last_addr->equal_to(*dst)) {
m_last_addr = nullptr;
}
if (m_legacy_math_rules)
@ -325,10 +329,6 @@ AssemblerVisitor::emit_alu_op(const AluInstr& ai)
return;
}
auto dst = ai.dest();
if (dst && ai.opcode() != op1_mova_int && m_last_addr && m_last_addr->equal_to(*dst))
m_last_addr = nullptr;
fill_alu_src_operands(alu, ai, m_bc);
m_result = !r600_bytecode_add_alu(&m_bc, &alu);