r600/sfn: rename free_slots and improve updating it

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36584>
This commit is contained in:
Gert Wollny
2025-06-19 22:46:26 +02:00
committed by Marge Bot
parent 67d0f51029
commit a6d97070a7
3 changed files with 14 additions and 15 deletions
@@ -15,7 +15,11 @@
namespace r600 {
AluGroup::AluGroup() { std::fill(m_slots.begin(), m_slots.end(), nullptr); }
AluGroup::AluGroup()
{
std::fill(m_slots.begin(), m_slots.end(), nullptr);
m_free_slots = has_t() ? 0x1f : 0xf;
}
bool
AluGroup::add_instruction(AluInstr *instr)
@@ -114,6 +118,7 @@ AluGroup::add_trans_instructions(AluInstr *instr)
update_indirect_access(instr)) {
m_readports_evaluator = readports_evaluator;
m_slots[4] = instr;
m_free_slots &= ~0x10;
instr->pin_sources_to_chan();
sfn_log << SfnLog::schedule << "T: " << *instr << "\n";
@@ -127,17 +132,6 @@ AluGroup::add_trans_instructions(AluInstr *instr)
return false;
}
int
AluGroup::free_slots() const
{
int free_mask = 0;
for (int i = 0; i < s_max_slots; ++i) {
if (!m_slots[i])
free_mask |= 1 << i;
}
return free_mask;
}
bool
AluGroup::add_vec_instructions(AluInstr *instr)
{
@@ -261,6 +255,7 @@ AluGroup::try_readport(AluInstr *instr, AluBankSwizzle cycle)
update_indirect_access(instr)) {
m_readports_evaluator = readports_evaluator;
m_slots[preferred_chan] = instr;
m_free_slots &= ~(1 << preferred_chan);
m_has_lds_op |= instr->has_lds_access();
sfn_log << SfnLog::schedule << "V: " << *instr << "\n";
auto dest = instr->dest();
@@ -46,11 +46,13 @@ public:
static void set_chipclass(r600_chip_class chip_class);
int free_slots() const;
auto addr() const { return std::make_pair(m_addr_used, m_addr_is_index); }
uint32_t slots() const override;
uint8_t free_slot_mask() const
{
return m_free_slots;
}
AluInstr::SrcValues get_kconsts() const;
@@ -105,6 +107,8 @@ private:
bool m_addr_for_src{false};
bool m_has_kill_op{false};
AluInstr *m_origin{nullptr};
uint8_t m_free_slots;
};
} // namespace r600
@@ -591,7 +591,7 @@ BlockScheduler::schedule_alu(Shader::ShaderBlocks& out_blocks)
assert(group);
int free_slots = group->free_slots();
int free_slots = group->free_slot_mask();
while (free_slots && has_alu_ready) {
if (!alu_vec_ready.empty())