diff options
author | Marek Olšák <marek.olsak@amd.com> | 2017-02-24 22:44:18 +0100 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2017-03-03 15:29:30 +0100 |
commit | 9c09592086d8b8801d663756efcc997bc741868d (patch) | |
tree | 4755dc2a0a53472c846a385eb77d2b22f0210d04 /src/amd/common/ac_llvm_build.c | |
parent | e729dc7c46bc903f40c933d40ce507d6cd23bf83 (diff) |
radeonsi: move kill intrinsic building into amd/common
just a cleanup
Reviewed-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/amd/common/ac_llvm_build.c')
-rw-r--r-- | src/amd/common/ac_llvm_build.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index f0ab9cb136..a569a7c30f 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -1105,3 +1105,19 @@ LLVMValueRef ac_emit_cvt_pkrtz_f16(struct ac_llvm_context *ctx, AC_FUNC_ATTR_READNONE | AC_FUNC_ATTR_LEGACY); } + +/** + * KILL, AKA discard in GLSL. + * + * \param value kill if value < 0.0 or value == NULL. + */ +void ac_emit_kill(struct ac_llvm_context *ctx, LLVMValueRef value) +{ + if (value) { + ac_emit_llvm_intrinsic(ctx, "llvm.AMDGPU.kill", ctx->voidt, + &value, 1, AC_FUNC_ATTR_LEGACY); + } else { + ac_emit_llvm_intrinsic(ctx, "llvm.AMDGPU.kilp", ctx->voidt, + NULL, 0, AC_FUNC_ATTR_LEGACY); + } +} |