aco/optimizer: only create v_fma_legacy_f32 when denorms are disabled

For some reasons, this instruction always flushes denorms.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41649>
This commit is contained in:
Georg Lehmann 2026-05-18 14:22:32 +02:00 committed by Marge Bot
parent ea54dea3a4
commit 19e56904f2

View file

@ -4308,7 +4308,7 @@ combine_instruction(opt_ctx& ctx, aco_ptr<Instruction>& instr)
add_opt(v_mul_f32, v_fma_f32, 0x3, "120", create_fma_cb);
add_opt(s_mul_f32, v_fma_f32, 0x3, "120", create_fma_cb);
}
if (ctx.program->gfx_level >= GFX10_3)
if (ctx.program->gfx_level >= GFX10_3 && ctx.fp_mode.denorm32 == 0)
add_opt(v_mul_legacy_f32, v_fma_legacy_f32, 0x3, "120", create_fma_cb);
} else if (info.opcode == aco_opcode::v_add_f16) {
if (ctx.program->gfx_level < GFX9 && ctx.fp_mode.denorm16_64 == 0) {