[Mesa-dev] [PATCH 2/2] r600g: Add ar_chan member to struct r600_bytecode

Tom Stellard tom at stellard.net
Tue Jan 22 12:22:11 PST 2013


From: Tom Stellard <thomas.stellard at amd.com>

r600_bytecode::ar_chan stores the register channel for the value that
will be loaded into the AR register.

At the moment, this field is only used by the LLVM backend.  The default
backend always sets ar_chan = 0.
---
 src/gallium/drivers/r600/r600_asm.c    | 2 ++
 src/gallium/drivers/r600/r600_asm.h    | 1 +
 src/gallium/drivers/r600/r600_shader.c | 1 +
 3 files changed, 4 insertions(+)

diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
index 809f85f..f1cd531 100644
--- a/src/gallium/drivers/r600/r600_asm.c
+++ b/src/gallium/drivers/r600/r600_asm.c
@@ -1421,6 +1421,7 @@ static int load_ar_r6xx(struct r600_bytecode *bc)
 	memset(&alu, 0, sizeof(alu));
 	alu.inst = V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOVA_GPR_INT;
 	alu.src[0].sel = bc->ar_reg;
+	alu.src[0].chan = bc->ar_chan;
 	alu.last = 1;
 	alu.index_mode = INDEX_MODE_LOOP;
 	r = r600_bytecode_add_alu(bc, &alu);
@@ -1451,6 +1452,7 @@ static int load_ar(struct r600_bytecode *bc)
 	memset(&alu, 0, sizeof(alu));
 	alu.inst = BC_INST(bc, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOVA_INT);
 	alu.src[0].sel = bc->ar_reg;
+	alu.src[0].chan = bc->ar_chan;
 	alu.last = 1;
 	r = r600_bytecode_add_alu(bc, &alu);
 	if (r)
diff --git a/src/gallium/drivers/r600/r600_asm.h b/src/gallium/drivers/r600/r600_asm.h
index 182f403..0b33c38 100644
--- a/src/gallium/drivers/r600/r600_asm.h
+++ b/src/gallium/drivers/r600/r600_asm.h
@@ -213,6 +213,7 @@ struct r600_bytecode {
 	struct r600_cf_callstack	callstack[SQ_MAX_CALL_DEPTH];
 	unsigned	ar_loaded;
 	unsigned	ar_reg;
+	unsigned	ar_chan;
 	unsigned        ar_handling;
 	unsigned        r6xx_nop_after_rel_dst;
 };
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 11802f0..57b8ea4 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -377,6 +377,7 @@ static unsigned r600_alu_from_byte_stream(struct r600_shader_ctx *ctx,
 
 	if (alu.inst == CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOVA_INT)) {
 		ctx->bc->ar_reg = alu.src[0].sel;
+		ctx->bc->ar_chan = alu.src[0].chan;
 		ctx->bc->ar_loaded = 0;
 		return bytes_read;
 	}
-- 
1.7.11.4



More information about the mesa-dev mailing list