Mesa (master): freedreno/ir3: fix half-reg array stores

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jul 18 16:51:39 UTC 2020


Module: Mesa
Branch: master
Commit: c2d94aa365da628fc2c7e2e9e2d35decec434719
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c2d94aa365da628fc2c7e2e9e2d35decec434719

Author: Rob Clark <robdclark at chromium.org>
Date:   Thu Jul 16 15:20:45 2020 -0700

freedreno/ir3: fix half-reg array stores

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

---

 src/freedreno/ir3/ir3_context.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/freedreno/ir3/ir3_context.c b/src/freedreno/ir3/ir3_context.c
index 4fe61615800..2d1ed21d9e3 100644
--- a/src/freedreno/ir3/ir3_context.c
+++ b/src/freedreno/ir3/ir3_context.c
@@ -615,6 +615,7 @@ ir3_create_array_store(struct ir3_context *ctx, struct ir3_array *arr, int n,
 	struct ir3_block *block = ctx->block;
 	struct ir3_instruction *mov;
 	struct ir3_register *dst;
+	unsigned flags = 0;
 
 	/* if not relative store, don't create an extra mov, since that
 	 * ends up being difficult for cp to remove.
@@ -642,17 +643,24 @@ ir3_create_array_store(struct ir3_context *ctx, struct ir3_array *arr, int n,
 	}
 
 	mov = ir3_instr_create(block, OPC_MOV);
-	mov->cat1.src_type = TYPE_U32;
-	mov->cat1.dst_type = TYPE_U32;
+	if (arr->half) {
+		mov->cat1.src_type = TYPE_U16;
+		mov->cat1.dst_type = TYPE_U16;
+		flags |= IR3_REG_HALF;
+	} else {
+		mov->cat1.src_type = TYPE_U32;
+		mov->cat1.dst_type = TYPE_U32;
+	}
 	mov->barrier_class = IR3_BARRIER_ARRAY_W;
 	mov->barrier_conflict = IR3_BARRIER_ARRAY_R | IR3_BARRIER_ARRAY_W;
 	dst = ir3_reg_create(mov, 0, IR3_REG_ARRAY |
+			flags |
 			COND(address, IR3_REG_RELATIV));
 	dst->instr = arr->last_write;
 	dst->size  = arr->length;
 	dst->array.id = arr->id;
 	dst->array.offset = n;
-	ir3_reg_create(mov, 0, IR3_REG_SSA)->instr = src;
+	ir3_reg_create(mov, 0, IR3_REG_SSA | flags)->instr = src;
 
 	if (address)
 		ir3_instr_set_address(mov, address);



More information about the mesa-commit mailing list