jay: fix instr counts

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40960>
This commit is contained in:
Alyssa Rosenzweig 2026-04-13 16:36:46 -04:00 committed by Marge Bot
parent 3a1227f36b
commit 48a24f3c27
3 changed files with 10 additions and 7 deletions

View file

@ -3200,7 +3200,10 @@ static void
jay_gather_stats(const jay_shader *s, struct genisa_stats *stats)
{
jay_foreach_inst_in_shader(s, f, I) {
stats->instrs += I->op != JAY_OPCODE_SYNC;
if (I->op != JAY_OPCODE_SYNC) {
stats->instrs += jay_macro_length(I) << jay_simd_split(s, I);
}
stats->loops += I->op == JAY_OPCODE_WHILE;
stats->sends += I->op == JAY_OPCODE_SEND;

View file

@ -788,7 +788,7 @@ struct jay_partition {
};
static inline enum jay_stride
jay_gpr_to_stride(struct jay_partition *p, unsigned reg)
jay_gpr_to_stride(const struct jay_partition *p, unsigned reg)
{
return (reg < p->base8 || reg >= p->base_eot) ? JAY_STRIDE_4 :
reg >= p->base2 ? JAY_STRIDE_2 :
@ -958,10 +958,10 @@ jay_inst_is_uniform(const jay_inst *I)
(I->dst.file == J_ARF && !jay_is_null(I->dst));
}
unsigned jay_simd_split(jay_shader *s, const jay_inst *I);
unsigned jay_simd_split(const jay_shader *s, const jay_inst *I);
static inline unsigned
jay_simd_width_logical(jay_shader *s, const jay_inst *I)
jay_simd_width_logical(const jay_shader *s, const jay_inst *I)
{
unsigned base = jay_inst_is_uniform(I) ? 1 : s->dispatch_width;
@ -1072,7 +1072,7 @@ jay_num_regs(jay_shader *shader, enum jay_file file)
}
static inline enum jay_stride
jay_def_stride(jay_shader *shader, jay_def x)
jay_def_stride(const jay_shader *shader, jay_def x)
{
assert(x.file == GPR);
return jay_gpr_to_stride(&shader->partition, x.reg);

View file

@ -7,7 +7,7 @@
#include "jay_opcodes.h"
static unsigned
max_simd_width(jay_shader *shader, const jay_inst *I)
max_simd_width(const jay_shader *shader, const jay_inst *I)
{
/* Only certain "complex" quad swizzles require splitting down to SIMD4 */
if (I->op == JAY_OPCODE_QUAD_SWIZZLE &&
@ -54,7 +54,7 @@ max_simd_width(jay_shader *shader, const jay_inst *I)
}
unsigned
jay_simd_split(jay_shader *s, const jay_inst *I)
jay_simd_split(const jay_shader *s, const jay_inst *I)
{
unsigned actual = jay_simd_width_logical(s, I);
unsigned max = max_simd_width(s, I);