Mesa (master): ac: add 8-bit and 16-bit supports to ac_build_set_inactive()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 19 18:01:47 UTC 2019


Module: Mesa
Branch: master
Commit: 2113867f0cfcd5b6a32e1a3b3091f5aa0ea46f17
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2113867f0cfcd5b6a32e1a3b3091f5aa0ea46f17

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Fri Nov  8 14:15:59 2019 +0100

ac: add 8-bit and 16-bit supports to ac_build_set_inactive()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/amd/llvm/ac_llvm_build.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/amd/llvm/ac_llvm_build.c b/src/amd/llvm/ac_llvm_build.c
index 13c093fb3e6..fdf66c9f52b 100644
--- a/src/amd/llvm/ac_llvm_build.c
+++ b/src/amd/llvm/ac_llvm_build.c
@@ -3864,8 +3864,15 @@ ac_build_set_inactive(struct ac_llvm_context *ctx, LLVMValueRef src,
 {
 	char name[33], type[8];
 	LLVMTypeRef src_type = LLVMTypeOf(src);
+	unsigned bitsize = ac_get_elem_bits(ctx, src_type);
 	src = ac_to_integer(ctx, src);
 	inactive = ac_to_integer(ctx, inactive);
+
+	if (bitsize < 32) {
+		src = LLVMBuildZExt(ctx->builder, src, ctx->i32, "");
+		inactive = LLVMBuildZExt(ctx->builder, inactive, ctx->i32, "");
+	}
+
 	ac_build_type_name_for_intr(LLVMTypeOf(src), type, sizeof(type));
 	snprintf(name, sizeof(name), "llvm.amdgcn.set.inactive.%s", type);
 	LLVMValueRef ret =
@@ -3874,6 +3881,8 @@ ac_build_set_inactive(struct ac_llvm_context *ctx, LLVMValueRef src,
 					src, inactive }, 2,
 					AC_FUNC_ATTR_READNONE |
 					AC_FUNC_ATTR_CONVERGENT);
+	if (bitsize < 32)
+		ret = LLVMBuildTrunc(ctx->builder, ret, src_type, "");
 
 	return ret;
 }




More information about the mesa-commit mailing list