jay/validate_ra: use jay_def_stride

higher level than jay_gpr_to_stride

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41808>
This commit is contained in:
Alyssa Rosenzweig 2026-05-26 10:16:25 -04:00 committed by Marge Bot
parent 805fe361a6
commit fc3fb1c3f9

View file

@ -58,18 +58,15 @@ print_regfile(struct regfile *rf, FILE *fp)
}
static bool
validate_src(struct jay_partition *partition,
jay_inst *I,
unsigned s,
struct regfile *rf,
jay_def def)
validate_src(
jay_shader *shader, jay_inst *I, unsigned s, struct regfile *rf, jay_def def)
{
jay_foreach_comp(def, c) {
uint32_t actual = *def_reg(rf, def, c);
if (def.file == GPR) {
assert(jay_gpr_to_stride(partition, def.reg) ==
jay_gpr_to_stride(partition, def.reg + c));
assert(jay_def_stride(shader, def) ==
jay_def_stride(shader, jay_extract_post_ra(def, c)));
}
if (actual == 0 || actual != jay_channel(def, c)) {
@ -93,6 +90,7 @@ validate_src(struct jay_partition *partition,
static bool
validate_block(jay_function *func, jay_block *block, struct regfile *blocks)
{
jay_shader *shader = func->shader;
struct regfile *rf = &blocks[block->index];
bool success = true;
@ -138,8 +136,7 @@ validate_block(jay_function *func, jay_block *block, struct regfile *blocks)
/* Validate sources */
jay_foreach_ssa_src(I, s) {
if (jay_channel(I->src[s], 0) != JAY_SENTINEL) {
success &=
validate_src(&func->shader->partition, I, s, rf, I->src[s]);
success &= validate_src(shader, I, s, rf, I->src[s]);
}
}
@ -150,9 +147,8 @@ validate_block(jay_function *func, jay_block *block, struct regfile *blocks)
*def_reg(rf, dst, c) = jay_channel(dst, c);
if (dst.file == GPR) {
struct jay_partition *p = &func->shader->partition;
assert(jay_gpr_to_stride(p, dst.reg) ==
jay_gpr_to_stride(p, dst.reg + c));
assert(jay_def_stride(shader, dst) ==
jay_def_stride(shader, jay_extract_post_ra(dst, c)));
}
}
}