mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 17:10:11 +01:00
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 <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
parent
c8949e2498
commit
b9e2f78d6e
1 changed files with 8 additions and 2 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue