diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2019-04-01 16:18:09 +0200 |
---|---|---|
committer | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2019-04-01 18:53:55 +0200 |
commit | 2cecf6c5cc3d64e40eb3b785a8174b33e8df7563 (patch) | |
tree | 8e2ef405199f6a9fb83ef9a577c383fddb65877b /src/amd | |
parent | a45d9e3e8d0524a95f929f88ab6a18c943e80f37 (diff) |
ac: add 8-bit support to ac_build_umsb()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Diffstat (limited to 'src/amd')
-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, ""); } |