summaryrefslogtreecommitdiffstats
path: root/src/amd/common
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-02-12 15:00:53 -0500
committerMarek Olšák <[email protected]>2019-04-23 11:28:56 -0400
commit35cd57df2ef2a5def5d45d5201438cafcdfa14c5 (patch)
tree7d0e4b3950e7fe0f1ca336259f8671e77a2486e4 /src/amd/common
parentbfb92875992599d9c5ca5ecf39fce36a1719272d (diff)
ac: add ac_get_i1_sgpr_mask
Tested-by: Dieter Nützel <[email protected]> Acked-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r--src/amd/common/ac_llvm_build.c16
-rw-r--r--src/amd/common/ac_llvm_build.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index d75b28e1b82..4fdf73c99ba 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -461,6 +461,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 debc029f192..f4cee667153 100644
--- a/src/amd/common/ac_llvm_build.h
+++ b/src/amd/common/ac_llvm_build.h
@@ -153,6 +153,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);