[Mesa-dev] [PATCH 02/11] radeonsi: use bitcast in a few places

Marek Olšák maraeo at gmail.com
Fri Sep 29 14:49:46 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/drivers/radeonsi/si_shader.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index c420573..88c3e56 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -1044,22 +1044,21 @@ static LLVMValueRef lds_load(struct lp_build_tgsi_context *bld_base,
 
 	value = ac_build_indexed_load(&ctx->ac, ctx->lds, dw_addr, false);
 	if (tgsi_type_is_64bit(type)) {
 		LLVMValueRef value2;
 		dw_addr = lp_build_add(&bld_base->uint_bld, dw_addr,
 				       ctx->i32_1);
 		value2 = ac_build_indexed_load(&ctx->ac, ctx->lds, dw_addr, false);
 		return si_llvm_emit_fetch_64bit(bld_base, type, value, value2);
 	}
 
-	return LLVMBuildBitCast(gallivm->builder, value,
-				tgsi2llvmtype(bld_base, type), "");
+	return bitcast(bld_base, type, value);
 }
 
 /**
  * Store to LDS.
  *
  * \param swizzle	offset (typically 0..3)
  * \param dw_addr	address in dwords
  * \param value		value to store
  */
 static void lds_store(struct lp_build_tgsi_context *bld_base,
@@ -1332,23 +1331,21 @@ static LLVMValueRef fetch_input_gs(
 	if (tgsi_type_is_64bit(type)) {
 		LLVMValueRef value2;
 		soffset = LLVMConstInt(ctx->i32, (param * 4 + swizzle + 1) * 256, 0);
 
 		value2 = ac_build_buffer_load(&ctx->ac, ctx->esgs_ring, 1,
 					      ctx->i32_0, vtx_offset, soffset,
 					      0, 1, 0, true, false);
 		return si_llvm_emit_fetch_64bit(bld_base, type,
 						value, value2);
 	}
-	return LLVMBuildBitCast(gallivm->builder,
-				value,
-				tgsi2llvmtype(bld_base, type), "");
+	return bitcast(bld_base, type, value);
 }
 
 static int lookup_interp_param_index(unsigned interpolate, unsigned location)
 {
 	switch (interpolate) {
 	case TGSI_INTERPOLATE_CONSTANT:
 		return 0;
 
 	case TGSI_INTERPOLATE_LINEAR:
 		if (location == TGSI_INTERPOLATE_LOC_SAMPLE)
-- 
2.7.4



More information about the mesa-dev mailing list