From a9206a271adf01e89f71ee064ff5cc552e150cd6 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Mon, 20 Apr 2026 17:13:33 +0200 Subject: [PATCH] intel/brw: port over to nir_op_ffma Reviewed-by: Alyssa Rosenzweig Reviewed-by: Georg Lehmann Part-of: --- src/intel/compiler/brw/brw_compiler.c | 2 ++ src/intel/compiler/brw/brw_from_nir.cpp | 1 + src/intel/compiler/intel_nir_opt_peephole_ffma.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/intel/compiler/brw/brw_compiler.c b/src/intel/compiler/brw/brw_compiler.c index 29f79a0a45f..e15fbaa737b 100644 --- a/src/intel/compiler/brw/brw_compiler.c +++ b/src/intel/compiler/brw/brw_compiler.c @@ -29,6 +29,8 @@ const struct nir_shader_compiler_options brw_scalar_nir_options = { .has_pack_32_4x8 = true, .has_uclz = true, .has_pixel_coord = true, + .float_mul_add16 = nir_float_muladd_support_has_ffma, + .float_mul_add32 = nir_float_muladd_support_has_ffma, .lower_base_vertex = true, .lower_bitfield_extract = true, .lower_bitfield_extract8 = true, diff --git a/src/intel/compiler/brw/brw_from_nir.cpp b/src/intel/compiler/brw/brw_from_nir.cpp index 341b1027ea0..e237c56487f 100644 --- a/src/intel/compiler/brw/brw_from_nir.cpp +++ b/src/intel/compiler/brw/brw_from_nir.cpp @@ -1646,6 +1646,7 @@ brw_from_nir_emit_alu(nir_to_brw_state &ntb, nir_alu_instr *instr, inst->saturate = true; break; + case nir_op_ffma: case nir_op_ffma_old: if (nir_has_any_rounding_mode_enabled(execution_mode)) { brw_rnd_mode rnd = diff --git a/src/intel/compiler/intel_nir_opt_peephole_ffma.c b/src/intel/compiler/intel_nir_opt_peephole_ffma.c index 6a13a863501..82419958cf3 100644 --- a/src/intel/compiler/intel_nir_opt_peephole_ffma.c +++ b/src/intel/compiler/intel_nir_opt_peephole_ffma.c @@ -201,7 +201,7 @@ intel_nir_opt_peephole_ffma_instr(nir_builder *b, if (negate) mul_src[0] = nir_fneg(b, mul_src[0]); - nir_alu_instr *ffma = nir_alu_instr_create(b->shader, nir_op_ffma_old); + nir_alu_instr *ffma = nir_alu_instr_create(b->shader, nir_op_ffma); ffma->fp_math_ctrl = b->fp_math_ctrl; for (unsigned i = 0; i < 2; i++) {