brw: Make LINE normalization into validation

Add validation for Source 0.  Should not cause problems
since this instruction is not used by the compiler anymore.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38877>
This commit is contained in:
Caio Oliveira 2025-12-02 12:36:44 -08:00 committed by Marge Bot
parent 75cf20f0eb
commit 3f436bdc6e
2 changed files with 6 additions and 10 deletions

View file

@ -922,16 +922,7 @@ ALU2(MUL)
ALU2(AVG)
ALU2(ADD)
ALU2(SRND)
brw_eu_inst *
brw_LINE(struct brw_codegen *p, struct brw_reg dest,
struct brw_reg src0, struct brw_reg src1)
{
src0.vstride = BRW_VERTICAL_STRIDE_0;
src0.width = BRW_WIDTH_1;
src0.hstride = BRW_HORIZONTAL_STRIDE_0;
return brw_alu2(p, BRW_OPCODE_LINE, dest, src0, src1);
}
ALU2(LINE)
brw_eu_inst *
brw_PLN(struct brw_codegen *p, struct brw_reg dest,

View file

@ -2275,6 +2275,11 @@ instruction_restrictions(const struct brw_isa_info *isa,
brw_type_is_int(inst->src[1].type),
"ADD can't mix float and non-float sources.");
}
if (inst->opcode == BRW_OPCODE_LINE) {
ERROR_IF(!src_has_scalar_region(inst, 0),
"LINE source 0 must be a scalar.");
}
}
static void