mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 07:40:11 +01:00
radv: Handle repeated instructions when splitting disassembly
cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30734>
This commit is contained in:
parent
1cf507b806
commit
19d633af0b
1 changed files with 19 additions and 0 deletions
|
|
@ -241,11 +241,30 @@ radv_add_split_disasm(const char *disasm, uint64_t start_addr, unsigned *num, st
|
|||
{
|
||||
struct radv_shader_inst *last_inst = *num ? &instructions[*num - 1] : NULL;
|
||||
char *next;
|
||||
char *repeat = strstr(disasm, "then repeated");
|
||||
|
||||
while ((next = strchr(disasm, '\n'))) {
|
||||
struct radv_shader_inst *inst = &instructions[*num];
|
||||
unsigned len = next - disasm;
|
||||
|
||||
if (repeat >= disasm && repeat < next) {
|
||||
uint32_t repeat_count;
|
||||
sscanf(repeat, "then repeated %u times", &repeat_count);
|
||||
|
||||
for (uint32_t i = 0; i < repeat_count; i++) {
|
||||
inst = &instructions[*num];
|
||||
memcpy(inst, last_inst, sizeof(struct radv_shader_inst));
|
||||
inst->offset = last_inst->offset + last_inst->size * (i + 1);
|
||||
(*num)++;
|
||||
}
|
||||
|
||||
last_inst = inst;
|
||||
|
||||
disasm = next + 1;
|
||||
repeat = strstr(disasm, "then repeated");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!memchr(disasm, ';', len)) {
|
||||
/* Ignore everything that is not an instruction. */
|
||||
disasm = next + 1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue