aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/freedreno/ir3/ir3_context.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/freedreno/ir3/ir3_context.c b/src/freedreno/ir3/ir3_context.c
index 2543991f8d9..bdcf816bd12 100644
--- a/src/freedreno/ir3/ir3_context.c
+++ b/src/freedreno/ir3/ir3_context.c
@@ -239,6 +239,12 @@ ir3_put_dst(struct ir3_context *ctx, nir_dest *dst)
ctx->last_dst_n = 0;
}
+static unsigned
+dest_flags(struct ir3_instruction *instr)
+{
+ return instr->regs[0]->flags & (IR3_REG_HALF | IR3_REG_HIGH);
+}
+
struct ir3_instruction *
ir3_create_collect(struct ir3_context *ctx, struct ir3_instruction *const *arr,
unsigned arrsz)
@@ -249,7 +255,7 @@ ir3_create_collect(struct ir3_context *ctx, struct ir3_instruction *const *arr,
if (arrsz == 0)
return NULL;
- unsigned flags = arr[0]->regs[0]->flags & IR3_REG_HALF;
+ unsigned flags = dest_flags(arr[0]);
collect = ir3_instr_create2(block, OPC_META_FI, 1 + arrsz);
ir3_reg_create(collect, 0, flags); /* dst */
@@ -285,7 +291,7 @@ ir3_create_collect(struct ir3_context *ctx, struct ir3_instruction *const *arr,
elem = ir3_MOV(block, elem, type);
}
- compile_assert(ctx, (elem->regs[0]->flags & IR3_REG_HALF) == flags);
+ compile_assert(ctx, dest_flags(elem) == flags);
ir3_reg_create(collect, 0, IR3_REG_SSA | flags)->instr = elem;
}
@@ -308,7 +314,7 @@ ir3_split_dest(struct ir3_block *block, struct ir3_instruction **dst,
return;
}
- unsigned flags = src->regs[0]->flags & (IR3_REG_HALF | IR3_REG_HIGH);
+ unsigned flags = dest_flags(src);
for (int i = 0, j = 0; i < n; i++) {
struct ir3_instruction *split = ir3_instr_create(block, OPC_META_FO);