From a45d9e3e8d0524a95f929f88ab6a18c943e80f37 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 1 Apr 2019 16:18:08 +0200 Subject: ac: add 8-bit support to ac_find_lsb() Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- src/amd/common/ac_llvm_build.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/amd') diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index 6d26ab31a66..f8d28a59cfe 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -2931,6 +2931,11 @@ LLVMValueRef ac_find_lsb(struct ac_llvm_context *ctx, type = ctx->i16; zero = ctx->i16_0; break; + case 8: + intrin_name = "llvm.cttz.i8"; + type = ctx->i8; + zero = ctx->i8_0; + break; default: unreachable(!"invalid bitsize"); } @@ -2956,7 +2961,7 @@ LLVMValueRef ac_find_lsb(struct ac_llvm_context *ctx, if (src0_bitsize == 64) { lsb = LLVMBuildTrunc(ctx->builder, lsb, ctx->i32, ""); - } else if (src0_bitsize == 16) { + } else if (src0_bitsize < 32) { lsb = LLVMBuildSExt(ctx->builder, lsb, ctx->i32, ""); } -- cgit v1.2.3