mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
aco: validate VALU modifiers
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21023>
This commit is contained in:
parent
fc193ab4db
commit
17ff2e8c52
1 changed files with 24 additions and 0 deletions
|
|
@ -382,6 +382,30 @@ validate_ir(Program* program)
|
|||
}
|
||||
check(num_sgprs + (literal.isUndefined() ? 0 : 1) <= const_bus_limit,
|
||||
"Too many SGPRs/literals", instr.get());
|
||||
|
||||
/* Validate modifiers. */
|
||||
check(!instr->valu().opsel || instr->isVOP3() || instr->isVINTERP_INREG(),
|
||||
"OPSEL set for unsupported instruction format", instr.get());
|
||||
check(!instr->valu().opsel_lo || instr->isVOP3P(),
|
||||
"OPSEL_LO set for unsupported instruction format", instr.get());
|
||||
check(!instr->valu().opsel_hi || instr->isVOP3P(),
|
||||
"OPSEL_HI set for unsupported instruction format", instr.get());
|
||||
check(!instr->valu().omod || instr->isVOP3() ||instr->isSDWA(),
|
||||
"OMOD set for unsupported instruction format", instr.get());
|
||||
check(!instr->valu().clamp || instr->isVOP3() || instr->isVOP3P() ||
|
||||
instr->isSDWA() || instr->isVINTERP_INREG(),
|
||||
"CLAMP set for unsupported instruction format", instr.get());
|
||||
|
||||
for (bool abs : instr->valu().abs) {
|
||||
check(!abs || instr->isVOP3() || instr->isVOP3P() || instr->isSDWA() ||
|
||||
instr->isDPP16(),
|
||||
"ABS/NEG_HI set for unsupported instruction format", instr.get());
|
||||
}
|
||||
for (bool neg : instr->valu().neg) {
|
||||
check(!neg || instr->isVOP3() || instr->isVOP3P() || instr->isSDWA() ||
|
||||
instr->isDPP16() || instr->isVINTERP_INREG(),
|
||||
"NEG/NEG_LO set for unsupported instruction format", instr.get());
|
||||
}
|
||||
}
|
||||
|
||||
if (instr->isSOP1() || instr->isSOP2()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue