diff --git a/src/intel/compiler/jay/jay_from_nir.c b/src/intel/compiler/jay/jay_from_nir.c index a4cd6a8d3de..64f64a78116 100644 --- a/src/intel/compiler/jay/jay_from_nir.c +++ b/src/intel/compiler/jay/jay_from_nir.c @@ -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; diff --git a/src/intel/compiler/jay/jay_ir.h b/src/intel/compiler/jay/jay_ir.h index 37d0b722319..2d0a9037be7 100644 --- a/src/intel/compiler/jay/jay_ir.h +++ b/src/intel/compiler/jay/jay_ir.h @@ -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); diff --git a/src/intel/compiler/jay/jay_simd_width.c b/src/intel/compiler/jay/jay_simd_width.c index 86a48ba320d..41adb3859bc 100644 --- a/src/intel/compiler/jay/jay_simd_width.c +++ b/src/intel/compiler/jay/jay_simd_width.c @@ -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);