From: Connor Abbott Date: Mon, 7 Aug 2017 22:56:50 +0000 (-0700) Subject: ac/nir: fix saturate emission X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c12c2e40a36f707f733c0d6ad90160472b7a3cf6;p=mesa.git ac/nir: fix saturate emission The .f32 was already getting added by emit_intrin_2f_param(). Noticed when enabling LLVM module verification. Reviewed-by: Bas Nieuwenhuizen --- diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 3abf40102c2..17bfe5b96f4 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -5272,8 +5272,8 @@ static LLVMValueRef emit_float_saturate(struct ac_llvm_context *ctx, LLVMValueRef v, float lo, float hi) { v = to_float(ctx, v); - v = emit_intrin_2f_param(ctx, "llvm.maxnum.f32", ctx->f32, v, LLVMConstReal(ctx->f32, lo)); - return emit_intrin_2f_param(ctx, "llvm.minnum.f32", ctx->f32, v, LLVMConstReal(ctx->f32, hi)); + v = emit_intrin_2f_param(ctx, "llvm.maxnum", ctx->f32, v, LLVMConstReal(ctx->f32, lo)); + return emit_intrin_2f_param(ctx, "llvm.minnum", ctx->f32, v, LLVMConstReal(ctx->f32, hi)); }