summaryrefslogtreecommitdiffstats
path: root/src/amd/common
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-04-01 16:18:08 +0200
committerSamuel Pitoiset <[email protected]>2019-04-01 18:53:53 +0200
commita45d9e3e8d0524a95f929f88ab6a18c943e80f37 (patch)
treec6da1f108c7d79eee71eb1c049a943649e6bbc7d /src/amd/common
parent89cf8ca0ae8b5c9db4af34ebbfc5552366b70c30 (diff)
ac: add 8-bit support to ac_find_lsb()
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r--src/amd/common/ac_llvm_build.c7
1 files changed, 6 insertions, 1 deletions
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, "");
}