Mesa (master): aco: fix sub-dword opsel/sdwa checks

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 17 11:11:04 UTC 2020


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

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Tue Jun 16 19:13:34 2020 +0100

aco: fix sub-dword opsel/sdwa checks

These should all check if the operand has a regclass. The opsel check
should also be skipped post-RA.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5504>

---

 src/amd/compiler/aco_validate.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/amd/compiler/aco_validate.cpp b/src/amd/compiler/aco_validate.cpp
index 26e1c9b35bc..90272433f85 100644
--- a/src/amd/compiler/aco_validate.cpp
+++ b/src/amd/compiler/aco_validate.cpp
@@ -148,7 +148,7 @@ void validate(Program* program, FILE * output)
             }
 
             for (unsigned i = 0; i < MIN2(instr->operands.size(), 2); i++) {
-               if (instr->operands[i].regClass().is_subdword())
+               if (instr->operands[i].hasRegClass() && instr->operands[i].regClass().is_subdword())
                   check((sdwa->sel[i] & sdwa_asuint) == (sdwa_isra | instr->operands[i].bytes()), "Unexpected SDWA sel for sub-dword operand", instr.get());
             }
             if (instr->definitions[0].regClass().is_subdword())
@@ -162,10 +162,10 @@ void validate(Program* program, FILE * output)
             check((vop3->opsel & ~(0x10 | ((1 << instr->operands.size()) - 1))) == 0, "Unused bits in opsel must be zeroed out", instr.get());
 
             for (unsigned i = 0; i < instr->operands.size(); i++) {
-               if (instr->operands[i].regClass().is_subdword())
+               if (instr->operands[i].hasRegClass() && instr->operands[i].regClass().is_subdword() && !instr->operands[i].isFixed())
                   check((vop3->opsel & (1 << i)) == 0, "Unexpected opsel for sub-dword operand", instr.get());
             }
-            if (instr->definitions[0].regClass().is_subdword())
+            if (instr->definitions[0].regClass().is_subdword() && !instr->definitions[0].isFixed())
                check((vop3->opsel & (1 << 3)) == 0, "Unexpected opsel for sub-dword definition", instr.get());
          }
 



More information about the mesa-commit mailing list