[Mesa-dev] [PATCH 04/26] ac: add ac_get_i1_sgpr_mask

Marek Olšák maraeo at gmail.com
Wed Feb 13 05:15:59 UTC 2019


From: Marek Olšák <marek.olsak at amd.com>

---
 src/amd/common/ac_llvm_build.c | 16 ++++++++++++++++
 src/amd/common/ac_llvm_build.h |  2 ++
 2 files changed, 18 insertions(+)

diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index 9395bd1bbda..7adca596943 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -453,6 +453,22 @@ ac_build_ballot(struct ac_llvm_context *ctx,
 				  AC_FUNC_ATTR_CONVERGENT);
 }
 
+LLVMValueRef ac_get_i1_sgpr_mask(struct ac_llvm_context *ctx,
+				 LLVMValueRef value)
+{
+	LLVMValueRef args[3] = {
+		value,
+		ctx->i1false,
+		LLVMConstInt(ctx->i32, LLVMIntNE, 0),
+	};
+
+	assert(HAVE_LLVM >= 0x0800);
+	return ac_build_intrinsic(ctx, "llvm.amdgcn.icmp.i1", ctx->i64, args, 3,
+				  AC_FUNC_ATTR_NOUNWIND |
+				  AC_FUNC_ATTR_READNONE |
+				  AC_FUNC_ATTR_CONVERGENT);
+}
+
 LLVMValueRef
 ac_build_vote_all(struct ac_llvm_context *ctx, LLVMValueRef value)
 {
diff --git a/src/amd/common/ac_llvm_build.h b/src/amd/common/ac_llvm_build.h
index f218eaf2832..6dd15dda3e8 100644
--- a/src/amd/common/ac_llvm_build.h
+++ b/src/amd/common/ac_llvm_build.h
@@ -149,6 +149,8 @@ void ac_build_optimization_barrier(struct ac_llvm_context *ctx,
 LLVMValueRef ac_build_shader_clock(struct ac_llvm_context *ctx);
 
 LLVMValueRef ac_build_ballot(struct ac_llvm_context *ctx, LLVMValueRef value);
+LLVMValueRef ac_get_i1_sgpr_mask(struct ac_llvm_context *ctx,
+				 LLVMValueRef value);
 
 LLVMValueRef ac_build_vote_all(struct ac_llvm_context *ctx, LLVMValueRef value);
 
-- 
2.17.1



More information about the mesa-dev mailing list