From: Daniel Schürmann Date: Thu, 27 Feb 2020 12:08:45 +0000 (+0100) Subject: aco: validate p_create_vector with subdword elements properly X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ad4e104bb98019d51b1f20798c0754f2e051a8cd;p=mesa.git aco: validate p_create_vector with subdword elements properly Also allows for undef operands Reviewed-by: Rhys Perry Reviewed-By: Timur Kristóf Part-of: --- diff --git a/src/amd/compiler/aco_validate.cpp b/src/amd/compiler/aco_validate.cpp index dd13fa34ed6..68e0c9caf8b 100644 --- a/src/amd/compiler/aco_validate.cpp +++ b/src/amd/compiler/aco_validate.cpp @@ -150,6 +150,7 @@ void validate(Program* program, FILE * output) bool flat = instr->format == Format::FLAT || instr->format == Format::SCRATCH || instr->format == Format::GLOBAL; bool can_be_undef = is_phi(instr) || instr->format == Format::EXP || instr->format == Format::PSEUDO_REDUCTION || + instr->opcode == aco_opcode::p_create_vector || (flat && i == 1) || (instr->format == Format::MIMG && i == 1) || ((instr->format == Format::MUBUF || instr->format == Format::MTBUF) && i == 1); check(can_be_undef, "Undefs can only be used in certain operands", instr.get()); @@ -241,9 +242,9 @@ void validate(Program* program, FILE * output) if (instr->opcode == aco_opcode::p_create_vector) { unsigned size = 0; for (const Operand& op : instr->operands) { - size += op.size(); + size += op.bytes(); } - check(size == instr->definitions[0].size(), "Definition size does not match operand sizes", instr.get()); + check(size == instr->definitions[0].bytes(), "Definition size does not match operand sizes", instr.get()); if (instr->definitions[0].getTemp().type() == RegType::sgpr) { for (const Operand& op : instr->operands) { check(op.isConstant() || op.regClass().type() == RegType::sgpr,