[Mesa-dev] [PATCH 4/6] ac: add 8-bit support to ac_build_umsb()

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon Apr 1 14:18:09 UTC 2019


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/amd/common/ac_llvm_build.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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, "");
 	}
 
-- 
2.21.0



More information about the mesa-dev mailing list