aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-04-01 16:18:07 +0200
committerSamuel Pitoiset <[email protected]>2019-04-01 18:53:52 +0200
commit89cf8ca0ae8b5c9db4af34ebbfc5552366b70c30 (patch)
treee74c3e067dc62d3fec4d03b2b75430589831e335 /src/amd
parent869af0464accd04b802fd42e3118925b03b6207e (diff)
ac: add 8-bit support to ac_build_bit_count()
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/common/ac_llvm_build.c7
1 files changed, 7 insertions, 0 deletions
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
@@ -2555,6 +2555,13 @@ LLVMValueRef ac_build_bit_count(struct ac_llvm_context *ctx, LLVMValueRef src0)
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:
unreachable(!"invalid bitsize");
break;