summaryrefslogtreecommitdiff
path: root/src/freedreno/ir3
diff options
context:
space:
mode:
Diffstat (limited to 'src/freedreno/ir3')
-rw-r--r--src/freedreno/ir3/ir3.c19
-rw-r--r--src/freedreno/ir3/ir3.h3
-rw-r--r--src/freedreno/ir3/ir3_shader.c11
3 files changed, 29 insertions, 4 deletions
diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c
index 124b41f9a3a..c8d066088b4 100644
--- a/src/freedreno/ir3/ir3.c
+++ b/src/freedreno/ir3/ir3.c
@@ -954,10 +954,17 @@ void * ir3_assemble(struct ir3_shader_variant *v)
if ((instr->opc == OPC_BARY_F) && (instr->regs[0]->flags & IR3_REG_EI))
info->last_baryf = info->instrs_count;
- info->instrs_count += 1 + instr->repeat + instr->nop;
- info->nops_count += instr->nop;
- if (instr->opc == OPC_NOP)
- info->nops_count += 1 + instr->repeat;
+ unsigned instrs_count = 1 + instr->repeat + instr->nop;
+ unsigned nops_count = instr->nop;
+
+ if (instr->opc == OPC_NOP) {
+ nops_count = 1 + instr->repeat;
+ info->instrs_per_cat[0] += nops_count;
+ } else {
+ info->instrs_per_cat[opc_cat(instr->opc)] += instrs_count;
+ info->instrs_per_cat[0] += nops_count;
+ }
+
if (instr->opc == OPC_MOV) {
if (instr->cat1.src_type == instr->cat1.dst_type) {
info->mov_count += 1 + instr->repeat;
@@ -965,6 +972,10 @@ void * ir3_assemble(struct ir3_shader_variant *v)
info->cov_count += 1 + instr->repeat;
}
}
+
+ info->instrs_count += instrs_count;
+ info->nops_count += nops_count;
+
dwords += 2;
if (instr->flags & IR3_INSTR_SS) {
diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h
index 2f5423238e0..cb42636f285 100644
--- a/src/freedreno/ir3/ir3.h
+++ b/src/freedreno/ir3/ir3.h
@@ -65,6 +65,9 @@ struct ir3_info {
uint16_t sstall;
uint16_t last_baryf; /* instruction # of last varying fetch */
+
+ /* Number of instructions of a given category: */
+ uint16_t instrs_per_cat[8];
};
struct ir3_register {
diff --git a/src/freedreno/ir3/ir3_shader.c b/src/freedreno/ir3/ir3_shader.c
index f91c4508c6a..519fafec900 100644
--- a/src/freedreno/ir3/ir3_shader.c
+++ b/src/freedreno/ir3/ir3_shader.c
@@ -615,6 +615,17 @@ ir3_shader_disasm(struct ir3_shader_variant *so, uint32_t *bin, FILE *out)
so->info.max_reg + 1,
so->constlen);
+ fprintf(out, "; %s prog %d/%d: %u cat0, %u cat1, %u cat2, %u cat3, %u cat4, %u cat5, %u cat6, %u cat7, \n",
+ type, so->shader->id, so->id,
+ so->info.instrs_per_cat[0],
+ so->info.instrs_per_cat[1],
+ so->info.instrs_per_cat[2],
+ so->info.instrs_per_cat[3],
+ so->info.instrs_per_cat[4],
+ so->info.instrs_per_cat[5],
+ so->info.instrs_per_cat[6],
+ so->info.instrs_per_cat[7]);
+
fprintf(out, "; %s prog %d/%d: %u sstall, %u (ss), %u (sy), %d max_sun, %d loops\n",
type, so->shader->id, so->id,
so->info.sstall,