Mesa (master): aco/validate: validate that p_create_vector operands are aligned unless they are subdword operands

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jan 21 11:13:24 UTC 2021


Module: Mesa
Branch: master
Commit: 8fb66187eccab895c3a6b3ba0b8465a7ab3ce578
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8fb66187eccab895c3a6b3ba0b8465a7ab3ce578

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Wed Dec 30 16:38:08 2020 +0000

aco/validate: validate that p_create_vector operands are aligned unless they are subdword operands

Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8260>

---

 src/amd/compiler/aco_validate.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/amd/compiler/aco_validate.cpp b/src/amd/compiler/aco_validate.cpp
index 4c707b49699..ffd25121726 100644
--- a/src/amd/compiler/aco_validate.cpp
+++ b/src/amd/compiler/aco_validate.cpp
@@ -359,6 +359,7 @@ bool validate_ir(Program* program)
             if (instr->opcode == aco_opcode::p_create_vector) {
                unsigned size = 0;
                for (const Operand& op : instr->operands) {
+                  check(op.bytes() < 4 || size % 4 == 0, "Operand is not aligned", instr.get());
                   size += op.bytes();
                }
                check(size == instr->definitions[0].bytes(), "Definition size does not match operand sizes", instr.get());



More information about the mesa-commit mailing list