freedreno/cffdec: When .mergedregs is set, don't count half regs.
authorEric Anholt <eric@anholt.net>
Mon, 17 Aug 2020 17:58:06 +0000 (10:58 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 19 Aug 2020 16:56:13 +0000 (16:56 +0000)
This matches what ir3.c does in the mergedregs case: just count max full
reg used.  This flag is unset so far, but will be soon and keeps our
output comparable between blob and freedreno.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6323>

src/freedreno/ir3/disasm-a3xx.c

index 02ab47a88755ce254d31983420842374444f45a3..ea3a9609c6b23cc9a3d49ef45d83f299576aeb4a 100644 (file)
@@ -272,7 +272,7 @@ static void print_reg_stats(struct disasm_ctx *ctx)
         * assigned to shader:
         */
        fullreg = (fullreg + 3) / 4;
-       halfreg = (halfreg + 3) / 4;
+       halfreg = ctx->regs.used.mergedregs ? 0 : (halfreg + 3) / 4;
 
        // Note this count of instructions includes rptN, which matches
        // up to how mesa prints this: