summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
Diffstat (limited to 'src/amd')
-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, "");
}