mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
aco/waitcnt: add print helpers
These may be useful in the future. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25373>
This commit is contained in:
parent
0d0a8c4365
commit
ae9a476c42
3 changed files with 71 additions and 0 deletions
|
|
@ -165,6 +165,20 @@ struct alu_delay_info {
|
|||
{
|
||||
return valu_instrs == valu_nop && trans_instrs == trans_nop && salu_cycles == 0;
|
||||
}
|
||||
|
||||
UNUSED void print(FILE* output) const
|
||||
{
|
||||
if (valu_instrs != valu_nop)
|
||||
fprintf(output, "valu_instrs: %u\n", valu_instrs);
|
||||
if (valu_cycles)
|
||||
fprintf(output, "valu_cycles: %u\n", valu_cycles);
|
||||
if (trans_instrs != trans_nop)
|
||||
fprintf(output, "trans_instrs: %u\n", trans_instrs);
|
||||
if (trans_cycles)
|
||||
fprintf(output, "trans_cycles: %u\n", trans_cycles);
|
||||
if (salu_cycles)
|
||||
fprintf(output, "salu_cycles: %u\n", salu_cycles);
|
||||
}
|
||||
};
|
||||
|
||||
uint8_t
|
||||
|
|
@ -254,6 +268,23 @@ struct wait_entry {
|
|||
events &= ~(event_valu | event_trans | event_salu);
|
||||
}
|
||||
}
|
||||
|
||||
UNUSED void print(FILE* output) const
|
||||
{
|
||||
fprintf(output, "logical: %u\n", logical);
|
||||
imm.print(output);
|
||||
delay.print(output);
|
||||
if (events)
|
||||
fprintf(output, "events: %u\n", events);
|
||||
if (counters)
|
||||
fprintf(output, "counters: %u\n", counters);
|
||||
if (!wait_on_read)
|
||||
fprintf(output, "wait_on_read: %u\n", wait_on_read);
|
||||
if (!logical)
|
||||
fprintf(output, "logical: %u\n", logical);
|
||||
if (vmem_types)
|
||||
fprintf(output, "vmem_types: %u\n", vmem_types);
|
||||
}
|
||||
};
|
||||
|
||||
struct wait_ctx {
|
||||
|
|
@ -328,6 +359,31 @@ struct wait_ctx {
|
|||
{
|
||||
entry.remove_counter(counter);
|
||||
}
|
||||
|
||||
UNUSED void print(FILE* output) const
|
||||
{
|
||||
fprintf(output, "exp_nonzero: %u\n", exp_nonzero);
|
||||
fprintf(output, "vm_nonzero: %u\n", vm_nonzero);
|
||||
fprintf(output, "lgkm_nonzero: %u\n", lgkm_nonzero);
|
||||
fprintf(output, "vs_nonzero: %u\n", vs_nonzero);
|
||||
fprintf(output, "pending_flat_lgkm: %u\n", pending_flat_lgkm);
|
||||
fprintf(output, "pending_flat_vm: %u\n", pending_flat_vm);
|
||||
for (const auto& entry : gpr_map) {
|
||||
fprintf(output, "gpr_map[%c%u] = {\n", entry.first.reg() >= 256 ? 'v' : 's',
|
||||
entry.first.reg() & 0xff);
|
||||
entry.second.print(output);
|
||||
fprintf(output, "}\n");
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < storage_count; i++) {
|
||||
if (!barrier_imm[i].empty() || barrier_events[i]) {
|
||||
fprintf(output, "barriers[%u] = {\n", i);
|
||||
barrier_imm[i].print(output);
|
||||
fprintf(output, "events: %u\n", barrier_events[i]);
|
||||
fprintf(output, "}\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
uint8_t
|
||||
|
|
|
|||
|
|
@ -1287,6 +1287,19 @@ wait_imm::empty() const
|
|||
vs == unset_counter;
|
||||
}
|
||||
|
||||
void
|
||||
wait_imm::print(FILE* output) const
|
||||
{
|
||||
if (exp != unset_counter)
|
||||
fprintf(output, "exp: %u\n", exp);
|
||||
if (vm != unset_counter)
|
||||
fprintf(output, "vm: %u\n", vm);
|
||||
if (lgkm != unset_counter)
|
||||
fprintf(output, "lgkm: %u\n", lgkm);
|
||||
if (vs != unset_counter)
|
||||
fprintf(output, "vs: %u\n", vs);
|
||||
}
|
||||
|
||||
bool
|
||||
should_form_clause(const Instruction* a, const Instruction* b)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -283,6 +283,8 @@ struct wait_imm {
|
|||
bool combine(const wait_imm& other);
|
||||
|
||||
bool empty() const;
|
||||
|
||||
void print(FILE* output) const;
|
||||
};
|
||||
|
||||
/* s_wait_event immediate bits. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue