[Mesa-dev] [PATCH 1/3] radv/ac: add support for some integer size conversions.

Dave Airlie airlied at gmail.com
Wed Feb 15 08:43:05 UTC 2017


From: Dave Airlie <airlied at redhat.com>

zero extend ->u64 and sign extend ->i64.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/amd/common/ac_nir_to_llvm.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 883656d..e9e3d14 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -1523,6 +1523,13 @@ static void visit_alu(struct nir_to_llvm_context *ctx, nir_alu_instr *instr)
 	case nir_op_b2f:
 		result = emit_b2f(ctx, src[0]);
 		break;
+	case nir_op_u2i64:
+	case nir_op_u2u64:
+		result = LLVMBuildZExt(ctx->builder, src[0], ctx->i64, "");
+		break;
+	case nir_op_i2i64:
+		result = LLVMBuildSExt(ctx->builder, src[0], ctx->i64, "");
+		break;
 	case nir_op_fquantize2f16:
 		src[0] = to_float(ctx, src[0]);
 		result = LLVMBuildFPTrunc(ctx->builder, src[0], ctx->f16, "");
-- 
2.9.3



More information about the mesa-dev mailing list