freedreno/ir3: propagate HALF flag across fanout
authorRob Clark <robdclark@gmail.com>
Thu, 26 Apr 2018 18:52:09 +0000 (14:52 -0400)
committerRob Clark <robdclark@gmail.com>
Mon, 11 Jun 2018 13:06:03 +0000 (09:06 -0400)
If we have a fanout (split) meta instruction to split the result of a
vector instruction, propagate the HALF flag back to the original
instruction.  Otherwise result ends up in a full precision register
while instruction(s) that use the result look in a half-precision
register.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c

index 3feb1ce0a5cac298aa37ce65b32e257cc9afa9b2..186171960e71e1dde43e47b2edce0e4a0e25e523 100644 (file)
@@ -495,7 +495,10 @@ put_dst(struct ir3_context *ctx, nir_dest *dst)
 
        if (bit_size < 32) {
                for (unsigned i = 0; i < ctx->last_dst_n; i++) {
-                       ctx->last_dst[i]->regs[0]->flags |= IR3_REG_HALF;
+                       struct ir3_instruction *dst = ctx->last_dst[i];
+                       dst->regs[0]->flags |= IR3_REG_HALF;
+                       if (ctx->last_dst[i]->opc == OPC_META_FO)
+                               dst->regs[1]->instr->regs[0]->flags |= IR3_REG_HALF;
                }
        }