diff options
-rw-r--r-- | src/amd/common/ac_llvm_build.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index f8d28a59cfe..8d749cc8eb0 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -1953,6 +1953,12 @@ ac_build_umsb(struct ac_llvm_context *ctx, highest_bit = LLVMConstInt(ctx->i16, 15, false); zero = ctx->i16_0; break; + case 8: + intrin_name = "llvm.ctlz.i8"; + type = ctx->i8; + highest_bit = LLVMConstInt(ctx->i8, 7, false); + zero = ctx->i8_0; + break; default: unreachable(!"invalid bitsize"); break; @@ -1973,7 +1979,7 @@ ac_build_umsb(struct ac_llvm_context *ctx, if (bitsize == 64) { msb = LLVMBuildTrunc(ctx->builder, msb, ctx->i32, ""); - } else if (bitsize == 16) { + } else if (bitsize < 32) { msb = LLVMBuildSExt(ctx->builder, msb, ctx->i32, ""); } |