From: Samuel Pitoiset Date: Wed, 24 Jan 2018 11:31:40 +0000 (+0100) Subject: ac/nir: only canonicalize 32-bit float min/max outputs on pre-GFX9 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b9e2f78d6e0cd7d562ffd9030768bd96ecc8ecd3;p=mesa.git ac/nir: only canonicalize 32-bit float min/max outputs on pre-GFX9 According to LLVM, only pre-GFX9 targets do not flush denorms for fmin/fmax. All dEQP-VK.glsl.builtin.precision.* still pass. Signed-off-by: Samuel Pitoiset 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 7b56edf8e78..581ccf63c9a 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -1913,18 +1913,24 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr) case nir_op_fmax: result = emit_intrin_2f_param(&ctx->ac, "llvm.maxnum", ac_to_float_type(&ctx->ac, def_type), src[0], src[1]); - if (instr->dest.dest.ssa.bit_size == 32) + if (ctx->ac.chip_class < GFX9 && + instr->dest.dest.ssa.bit_size == 32) { + /* Only pre-GFX9 chips do not flush denorms. */ result = emit_intrin_1f_param(&ctx->ac, "llvm.canonicalize", ac_to_float_type(&ctx->ac, def_type), result); + } break; case nir_op_fmin: result = emit_intrin_2f_param(&ctx->ac, "llvm.minnum", ac_to_float_type(&ctx->ac, def_type), src[0], src[1]); - if (instr->dest.dest.ssa.bit_size == 32) + if (ctx->ac.chip_class < GFX9 && + instr->dest.dest.ssa.bit_size == 32) { + /* Only pre-GFX9 chips do not flush denorms. */ result = emit_intrin_1f_param(&ctx->ac, "llvm.canonicalize", ac_to_float_type(&ctx->ac, def_type), result); + } break; case nir_op_ffma: result = emit_intrin_3f_param(&ctx->ac, "llvm.fmuladd",