From 2a6633a8bac4eab545c65eae2b88ed3c765b0f3b Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Thu, 23 Apr 2026 16:03:37 +0200 Subject: [PATCH] ntt: use ffma_weak It used the TGSI MAD opcode to implement the old ffma, but this one let's the driver choose to implement it as unfused or fused, so ffma_weak is a better git over ffma or fmad. Reviewed-by: Georg Lehmann Part-of: --- src/gallium/auxiliary/nir/nir_to_tgsi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c index a0f53d53386..0c65f0ef618 100644 --- a/src/gallium/auxiliary/nir/nir_to_tgsi.c +++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c @@ -1570,6 +1570,9 @@ ntt_emit_alu(struct ntt_compile *c, nir_alu_instr *instr) [nir_op_fmax] = { TGSI_OPCODE_MAX, TGSI_OPCODE_DMAX }, [nir_op_imax] = { TGSI_OPCODE_IMAX, TGSI_OPCODE_I64MAX }, [nir_op_umax] = { TGSI_OPCODE_UMAX, TGSI_OPCODE_U64MAX }, + /* This is fine as long as drivers implement TGSI MAD as fmad */ + [nir_op_fmad] = { TGSI_OPCODE_MAD, TGSI_OPCODE_DMAD }, + [nir_op_ffma_weak] = { TGSI_OPCODE_MAD, TGSI_OPCODE_DMAD }, [nir_op_ffma_old] = { TGSI_OPCODE_MAD, TGSI_OPCODE_DMAD }, [nir_op_ldexp] = { TGSI_OPCODE_LDEXP, 0 }, };