r600/sfn: Move last_addr handling out of fill_alu_dst

Assisted-by: Copilot (auto mode)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41945>
This commit is contained in:
Gert Wollny 2026-04-30 23:57:21 +02:00 committed by Marge Bot
parent 685c01b112
commit e55dbc7882
3 changed files with 7 additions and 7 deletions

View file

@ -320,11 +320,15 @@ AssemblerVisitor::emit_alu_op(const AluInstr& ai)
if (ai.bank_swizzle() != alu_vec_unknown)
alu.bank_swizzle_force = ai.bank_swizzle();
if (!fill_alu_dst(alu, ai, m_bc, m_last_addr)) {
if (!fill_alu_dst(alu, ai, m_bc)) {
m_result = false;
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);

View file

@ -549,8 +549,7 @@ fill_alu_src_operands(r600_bytecode_alu& alu, const AluInstr& ai, r600_bytecode&
}
bool
fill_alu_dst(r600_bytecode_alu& alu, const AluInstr& ai, r600_bytecode& bc,
const VirtualValue *& last_addr)
fill_alu_dst(r600_bytecode_alu& alu, const AluInstr& ai, r600_bytecode& bc)
{
auto dst = ai.dest();
if (dst) {
@ -566,8 +565,6 @@ fill_alu_dst(r600_bytecode_alu& alu, const AluInstr& ai, r600_bytecode& bc,
}
alu.dst.sel = dst->sel() != g_registers_unused ? dst->sel() : g_registers_end;
alu.dst.chan = dst->chan();
if (last_addr && last_addr->equal_to(*dst))
last_addr = nullptr;
alu.dst.write = write;
alu.dst.rel = dst->addr() ? 1 : 0;

View file

@ -57,8 +57,7 @@ void fill_alu_src_operands(r600_bytecode_alu& alu,
bool fill_alu_dst(r600_bytecode_alu& alu,
const AluInstr& ai,
r600_bytecode& bc,
const VirtualValue *& last_addr);
r600_bytecode& bc);
} // namespace r600