[Mesa-dev] [PATCH 1/6] ac/nir: add support for nir_op_b2i8

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon Apr 1 14:18:06 UTC 2019


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/amd/common/ac_nir_to_llvm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 4e9af58538f..6739551ca26 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -345,6 +345,8 @@ static LLVMValueRef emit_b2i(struct ac_llvm_context *ctx,
 	LLVMValueRef result = LLVMBuildAnd(ctx->builder, src0, ctx->i32_1, "");
 
 	switch (bitsize) {
+	case 8:
+		return LLVMBuildTrunc(ctx->builder, result, ctx->i8, "");
 	case 16:
 		return LLVMBuildTrunc(ctx->builder, result, ctx->i16, "");
 	case 32:
@@ -978,6 +980,7 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
 	case nir_op_f2b32:
 		result = emit_f2b(&ctx->ac, src[0]);
 		break;
+	case nir_op_b2i8:
 	case nir_op_b2i16:
 	case nir_op_b2i32:
 	case nir_op_b2i64:
-- 
2.21.0



More information about the mesa-dev mailing list