From 15dd81913f2d50b327006f0777994e839259c98c Mon Sep 17 00:00:00 2001
From: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Date: Wed, 10 Apr 2019 17:16:47 +0200
Subject: ac/nir: make use of ac_build_imin() where possible
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This changes the predicate from LessThan to Equal.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
---
 src/amd/common/ac_nir_to_llvm.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index f409800c2b1..f074a12c31b 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -751,7 +751,7 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
 		result = ac_build_imax(&ctx->ac, src[0], src[1]);
 		break;
 	case nir_op_imin:
-		result = emit_minmax_int(&ctx->ac, LLVMIntSLT, src[0], src[1]);
+		result = ac_build_imin(&ctx->ac, src[0], src[1]);
 		break;
 	case nir_op_umax:
 		result = emit_minmax_int(&ctx->ac, LLVMIntUGT, src[0], src[1]);
@@ -1109,8 +1109,8 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
 		result = emit_minmax_int(&ctx->ac, LLVMIntULT, result, src[2]);
 		break;
 	case nir_op_imin3:
-		result = emit_minmax_int(&ctx->ac, LLVMIntSLT, src[0], src[1]);
-		result = emit_minmax_int(&ctx->ac, LLVMIntSLT, result, src[2]);
+		result = ac_build_imin(&ctx->ac, src[0], src[1]);
+		result = ac_build_imin(&ctx->ac, result, src[2]);
 		break;
 	case nir_op_fmax3:
 		result = emit_intrin_2f_param(&ctx->ac, "llvm.maxnum",
@@ -1135,9 +1135,9 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
 		break;
 	}
 	case nir_op_imed3: {
-		LLVMValueRef tmp1 = emit_minmax_int(&ctx->ac, LLVMIntSLT, src[0], src[1]);
+		LLVMValueRef tmp1 = ac_build_imin(&ctx->ac, src[0], src[1]);
 		LLVMValueRef tmp2 = ac_build_imax(&ctx->ac, src[0], src[1]);
-		tmp2 = emit_minmax_int(&ctx->ac, LLVMIntSLT, tmp2, src[2]);
+		tmp2 = ac_build_imin(&ctx->ac, tmp2, src[2]);
 		result = ac_build_imax(&ctx->ac, tmp1, tmp2);
 		break;
 	}
-- 
cgit v1.2.3