Mesa (main): aco: disallow literals with some instruction formats
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jun 8 09:19:35 UTC 2021
Module: Mesa
Branch: main
Commit: 8e0c6e196ed43254db536e66adedd1af31bdf0ca
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8e0c6e196ed43254db536e66adedd1af31bdf0ca
Author: Rhys Perry <pendingchaos02 at gmail.com>
Date: Fri Apr 23 11:56:18 2021 +0100
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 at gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3151>
---
src/amd/compiler/aco_validate.cpp | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/amd/compiler/aco_validate.cpp b/src/amd/compiler/aco_validate.cpp
index 2e64a2358f2..57a61e5ded8 100644
--- a/src/amd/compiler/aco_validate.cpp
+++ b/src/amd/compiler/aco_validate.cpp
@@ -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());
More information about the mesa-commit
mailing list