[Mesa-dev] [PATCH 26/38] ac/nir: implement 8 and 16 bit ac_build_imsb

Rhys Perry pendingchaos02 at gmail.com
Fri Dec 7 17:22:19 UTC 2018


Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
---
 src/amd/common/ac_llvm_build.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index 0123f3e31d..2172d81f8b 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -1640,6 +1640,10 @@ ac_build_imsb(struct ac_llvm_context *ctx,
 	      LLVMValueRef arg,
 	      LLVMTypeRef dst_type)
 {
+	//TODO: support 64-bit integers
+	if (LLVMTypeOf(arg) != ctx->i32)
+		arg = LLVMBuildSExt(ctx->builder, arg, ctx->i32, "");
+
 	LLVMValueRef msb = ac_build_intrinsic(ctx, "llvm.amdgcn.sffbh.i32",
 					      dst_type, &arg, 1,
 					      AC_FUNC_ATTR_READNONE);
-- 
2.19.2



More information about the mesa-dev mailing list