ptr = dwords = calloc(4, info->sizedwords);
foreach_block (block, &shader->block_list) {
+ unsigned sfu_delay = 0;
+
foreach_instr (instr, &block->instr_list) {
int ret = emit[opc_cat(instr->opc)](instr, dwords, info);
if (ret)
info->nops_count += 1 + instr->repeat;
dwords += 2;
- if (instr->flags & IR3_INSTR_SS)
+ if (instr->flags & IR3_INSTR_SS) {
info->ss++;
+ info->sstall += sfu_delay;
+ }
if (instr->flags & IR3_INSTR_SY)
info->sy++;
+
+ if (is_sfu(instr)) {
+ sfu_delay = 10;
+ } else if (sfu_delay > 0) {
+ sfu_delay--;
+ }
}
}
/* number of sync bits: */
uint16_t ss, sy;
+ /* estimate of number of cycles stalled on (ss) */
+ uint16_t sstall;
+
uint16_t last_baryf; /* instruction # of last varying fetch */
};
pipe_debug_message(debug, SHADER_INFO,
"%s shader: %u inst, %u nops, %u non-nops, %u dwords, "
"%u last-baryf, %u half, %u full, %u constlen, "
- "%u (ss), %u (sy), %d max_sun, %d loops\n",
+ "%u sstall, %u (ss), %u (sy), %d max_sun, %d loops\n",
ir3_shader_stage(v),
v->info.instrs_count,
v->info.nops_count,
v->info.max_half_reg + 1,
v->info.max_reg + 1,
v->constlen,
+ v->info.sstall,
v->info.ss, v->info.sy,
v->max_sun, v->loops);
}