[Mesa-dev] [PATCH 2/6] ac: add 8-bit support to ac_build_bit_count()

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


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

diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index fe280b31368..6d26ab31a66 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -2553,6 +2553,13 @@ LLVMValueRef ac_build_bit_count(struct ac_llvm_context *ctx, LLVMValueRef src0)
 					    (LLVMValueRef []) { src0 }, 1,
 					    AC_FUNC_ATTR_READNONE);
 
+		result = LLVMBuildZExt(ctx->builder, result, ctx->i32, "");
+		break;
+	case 8:
+		result = ac_build_intrinsic(ctx, "llvm.ctpop.i8", ctx->i8,
+					    (LLVMValueRef []) { src0 }, 1,
+					    AC_FUNC_ATTR_READNONE);
+
 		result = LLVMBuildZExt(ctx->builder, result, ctx->i32, "");
 		break;
 	default:
-- 
2.21.0



More information about the mesa-dev mailing list