mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
i965/fs: Print fs_reg::offset field consistently for all register files.
The offset printing code in fs_visitor::dump_instruction() was doing things differently for sources and destinations and for each register file -- In some cases it would be added to the base register number fs_reg::nr, in other cases it would follow the base register separated with a plus sign, in other cases (uniforms) it would do both (!). The sub-register offset was also being printed or not rather inconsistently. Fix it. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
parent
950af5ed40
commit
ec259f5307
1 changed files with 22 additions and 16 deletions
|
|
@ -5233,10 +5233,6 @@ fs_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
|
|||
switch (inst->dst.file) {
|
||||
case VGRF:
|
||||
fprintf(file, "vgrf%d", inst->dst.nr);
|
||||
if (alloc.sizes[inst->dst.nr] * REG_SIZE != inst->size_written ||
|
||||
inst->dst.offset % REG_SIZE)
|
||||
fprintf(file, "+%d.%d",
|
||||
inst->dst.offset / REG_SIZE, inst->dst.offset % REG_SIZE);
|
||||
break;
|
||||
case FIXED_GRF:
|
||||
fprintf(file, "g%d", inst->dst.nr);
|
||||
|
|
@ -5248,10 +5244,10 @@ fs_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
|
|||
fprintf(file, "(null)");
|
||||
break;
|
||||
case UNIFORM:
|
||||
fprintf(file, "***u%d***", inst->dst.nr + inst->dst.offset / 4);
|
||||
fprintf(file, "***u%d***", inst->dst.nr);
|
||||
break;
|
||||
case ATTR:
|
||||
fprintf(file, "***attr%d***", inst->dst.nr + inst->dst.offset / REG_SIZE);
|
||||
fprintf(file, "***attr%d***", inst->dst.nr);
|
||||
break;
|
||||
case ARF:
|
||||
switch (inst->dst.nr) {
|
||||
|
|
@ -5277,6 +5273,15 @@ fs_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
|
|||
case IMM:
|
||||
unreachable("not reached");
|
||||
}
|
||||
|
||||
if (inst->dst.offset ||
|
||||
(inst->dst.file == VGRF &&
|
||||
alloc.sizes[inst->dst.nr] * REG_SIZE != inst->size_written)) {
|
||||
const unsigned reg_size = (inst->dst.file == UNIFORM ? 4 : REG_SIZE);
|
||||
fprintf(file, "+%d.%d", inst->dst.offset / reg_size,
|
||||
inst->dst.offset % reg_size);
|
||||
}
|
||||
|
||||
if (inst->dst.stride != 1)
|
||||
fprintf(file, "<%u>", inst->dst.stride);
|
||||
fprintf(file, ":%s, ", brw_reg_type_letters(inst->dst.type));
|
||||
|
|
@ -5289,10 +5294,6 @@ fs_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
|
|||
switch (inst->src[i].file) {
|
||||
case VGRF:
|
||||
fprintf(file, "vgrf%d", inst->src[i].nr);
|
||||
if (alloc.sizes[inst->src[i].nr] * REG_SIZE != inst->size_read(i) ||
|
||||
inst->src[i].offset % REG_SIZE != 0)
|
||||
fprintf(file, "+%d.%d", inst->src[i].offset / REG_SIZE,
|
||||
inst->src[i].offset % REG_SIZE);
|
||||
break;
|
||||
case FIXED_GRF:
|
||||
fprintf(file, "g%d", inst->src[i].nr);
|
||||
|
|
@ -5301,14 +5302,10 @@ fs_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
|
|||
fprintf(file, "***m%d***", inst->src[i].nr);
|
||||
break;
|
||||
case ATTR:
|
||||
fprintf(file, "attr%d+%d", inst->src[i].nr, inst->src[i].offset / REG_SIZE);
|
||||
fprintf(file, "attr%d", inst->src[i].nr);
|
||||
break;
|
||||
case UNIFORM:
|
||||
fprintf(file, "u%d", inst->src[i].nr + inst->src[i].offset / 4);
|
||||
if (inst->src[i].offset % 4 != 0) {
|
||||
fprintf(file, "+%d.%d", inst->src[i].offset / 4,
|
||||
inst->src[i].offset % 4);
|
||||
}
|
||||
fprintf(file, "u%d", inst->src[i].nr);
|
||||
break;
|
||||
case BAD_FILE:
|
||||
fprintf(file, "(null)");
|
||||
|
|
@ -5363,6 +5360,15 @@ fs_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
|
|||
fprintf(file, "+%d", inst->src[i].subnr);
|
||||
break;
|
||||
}
|
||||
|
||||
if (inst->src[i].offset ||
|
||||
(inst->src[i].file == VGRF &&
|
||||
alloc.sizes[inst->src[i].nr] * REG_SIZE != inst->size_read(i))) {
|
||||
const unsigned reg_size = (inst->src[i].file == UNIFORM ? 4 : REG_SIZE);
|
||||
fprintf(file, "+%d.%d", inst->src[i].offset / reg_size,
|
||||
inst->src[i].offset % reg_size);
|
||||
}
|
||||
|
||||
if (inst->src[i].abs)
|
||||
fprintf(file, "|");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue