aco: disallow literals with some instruction formats

Because isVOPn() is true for many VOP3, SDWA and DPP instructions, this
would often not complain.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3151>
This commit is contained in:
Rhys Perry 2021-04-23 11:56:18 +01:00 committed by Marge Bot
parent cf22eabc68
commit 8e0c6e196e
1 changed files with 3 additions and 4 deletions

View File

@ -233,10 +233,9 @@ bool validate_ir(Program* program)
if (!op.isLiteral())
continue;
check(instr->isSOP1() || instr->isSOP2() || instr->isSOPC() ||
instr->isVOP1() || instr->isVOP2() || instr->isVOPC() ||
(instr->isVOP3() && program->chip_class >= GFX10) ||
(instr->isVOP3P() && program->chip_class >= GFX10),
check(!instr->isDPP() && !instr->isSDWA() &&
(!instr->isVOP3() || program->chip_class >= GFX10) &&
(!instr->isVOP3P() || program->chip_class >= GFX10),
"Literal applied on wrong instruction format", instr.get());
check(literal.isUndefined() || (literal.size() == op.size() && literal.constantValue() == op.constantValue()), "Only 1 Literal allowed", instr.get());