summaryrefslogtreecommitdiffstats
path: root/src/amd/common/ac_llvm_build.c
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-06-25 17:56:37 +0200
committerNicolai Hähnle <[email protected]>2017-07-31 14:55:42 +0200
commita69afb68c9a54b475dd2f2588c6c54676b43f9dd (patch)
tree6f7fa5d880f642df2e69a240e5d65a9b94350a2e /src/amd/common/ac_llvm_build.c
parent0f9e32519bb8d00dae0b9ce998d0183d1a46a121 (diff)
radeonsi: use new function ac_build_umin for edgeflag clamping
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/amd/common/ac_llvm_build.c')
-rw-r--r--src/amd/common/ac_llvm_build.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index 2dddf44ff85..9b939c148e5 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -908,6 +908,13 @@ ac_build_umsb(struct ac_llvm_context *ctx,
LLVMConstInt(ctx->i32, -1, true), msb, "");
}
+LLVMValueRef ac_build_umin(struct ac_llvm_context *ctx, LLVMValueRef a,
+ LLVMValueRef b)
+{
+ LLVMValueRef cmp = LLVMBuildICmp(ctx->builder, LLVMIntULE, a, b, "");
+ return LLVMBuildSelect(ctx->builder, cmp, a, b, "");
+}
+
LLVMValueRef ac_build_clamp(struct ac_llvm_context *ctx, LLVMValueRef value)
{
if (HAVE_LLVM >= 0x0500) {