[Mesa-dev] [PATCH 1/2] r600g: tgsi to llvm emits kcache bank

Vincent Lejeune vljn at ovi.com
Mon Dec 17 09:43:02 PST 2012


---
 src/gallium/drivers/r600/r600_llvm.c   | 6 ++++--
 src/gallium/drivers/r600/r600_shader.c | 4 +++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_llvm.c b/src/gallium/drivers/r600/r600_llvm.c
index 79f6cf0..5efde2d 100644
--- a/src/gallium/drivers/r600/r600_llvm.c
+++ b/src/gallium/drivers/r600/r600_llvm.c
@@ -25,11 +25,13 @@ static LLVMValueRef llvm_fetch_const(
 	enum tgsi_opcode_type type,
 	unsigned swizzle)
 {
-	LLVMValueRef idx = lp_build_const_int32(bld_base->base.gallivm,
+	LLVMValueRef args[2];
+	args[0] = lp_build_const_int32(bld_base->base.gallivm,
 			radeon_llvm_reg_index_soa(reg->Register.Index, swizzle));
+	args[1] = lp_build_const_int32(bld_base->base.gallivm, 0);
 	LLVMValueRef cval = build_intrinsic(bld_base->base.gallivm->builder,
 		"llvm.AMDGPU.load.const", bld_base->base.elem_type,
-		&idx, 1, LLVMReadNoneAttribute);
+		args, 2, LLVMReadNoneAttribute);
 
 	return bitcast(bld_base, type, cval);
 }
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index ac28d22..6eda1e1 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -328,8 +328,10 @@ static unsigned r600_alu_from_byte_stream(struct r600_shader_ctx *ctx,
 	}
 
 	for(src_idx = 0; src_idx < 3; src_idx++) {
-		if (src_const_reg[src_idx])
+		if (src_const_reg[src_idx]) {
+			alu.src[src_idx].kc_bank = src_const_reg[src_idx] - 1;
 			alu.src[src_idx].sel += 512;
+		}
 	}
 
 #if HAVE_LLVM < 0x0302
-- 
1.8.0.2



More information about the mesa-dev mailing list