freedreno/ir3/validate: also check instr->address
authorRob Clark <robdclark@chromium.org>
Sun, 7 Jun 2020 18:11:23 +0000 (11:11 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 16 Jun 2020 20:56:15 +0000 (20:56 +0000)
Verify that instructions which have a relative src and/or dest, have
`instr->address`.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5280>

src/freedreno/ir3/ir3_validate.c

index ec8bb937da85a02f74bdaa2f07b80974e8c5ff75..58b5bee1e87e2e38d50920daf5d57061a7037fd3 100644 (file)
@@ -77,7 +77,16 @@ validate_instr(struct ir3_validate_ctx *ctx, struct ir3_instruction *instr)
 {
        struct ir3_register *last_reg = NULL;
 
+       if (writes_gpr(instr)) {
+               if (instr->regs[0]->flags & IR3_REG_RELATIV) {
+                       validate_assert(ctx, instr->address);
+               }
+       }
+
        foreach_src_n (reg, n, instr) {
+               if (reg->flags & IR3_REG_RELATIV)
+                       validate_assert(ctx, instr->address);
+
                validate_src(ctx, reg);
 
                /* Validate that all src's are either half of full.