Mesa (main): ir3: Properly validate pcopy reg sizes
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Aug 20 10:57:11 UTC 2021
Module: Mesa
Branch: main
Commit: cca2e0fc1409f6040839ac588adbb5c2c9d45cdb
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cca2e0fc1409f6040839ac588adbb5c2c9d45cdb
Author: Connor Abbott <cwabbott0 at gmail.com>
Date: Wed Aug 18 14:43:48 2021 +0200
ir3: Properly validate pcopy reg sizes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033>
---
src/freedreno/ir3/ir3_validate.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/freedreno/ir3/ir3_validate.c b/src/freedreno/ir3/ir3_validate.c
index 4c07b02159b..4fe56b45c9c 100644
--- a/src/freedreno/ir3/ir3_validate.c
+++ b/src/freedreno/ir3/ir3_validate.c
@@ -185,6 +185,10 @@ validate_instr(struct ir3_validate_ctx *ctx, struct ir3_instruction *instr)
/* handled below */
} else if (opc_cat(instr->opc) == 0) {
/* end/chmask/etc are allowed to have different size sources */
+ } else if (instr->opc == OPC_META_PARALLEL_COPY) {
+ /* pcopy sources have to match with their destination but can have
+ * different size.
+ */
} else if (n > 0) {
validate_assert(ctx, (last_reg->flags & IR3_REG_HALF) ==
(reg->flags & IR3_REG_HALF));
@@ -322,6 +326,13 @@ validate_instr(struct ir3_validate_ctx *ctx, struct ir3_instruction *instr)
break;
}
}
+
+ if (instr->opc == OPC_META_PARALLEL_COPY) {
+ foreach_src_n (src, n, instr) {
+ validate_assert(ctx, reg_class_flags(src) ==
+ reg_class_flags(instr->dsts[n]));
+ }
+ }
}
void
More information about the mesa-commit
mailing list