From 536ff644fa5caa89bed918cc2f29e3af16c2a63a Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Fri, 24 Apr 2026 15:53:03 +0200 Subject: [PATCH] bitfrost: support nir_op_ffma Reviewed-by: Georg Lehmann Part-of: --- src/panfrost/compiler/bifrost/bifrost_compile.c | 1 + src/panfrost/compiler/bifrost/bifrost_compile.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/panfrost/compiler/bifrost/bifrost_compile.c b/src/panfrost/compiler/bifrost/bifrost_compile.c index 1dda2c6e3ec..f27e5ef861e 100644 --- a/src/panfrost/compiler/bifrost/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost/bifrost_compile.c @@ -2975,6 +2975,7 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr) srcs > 2 ? bi_alu_src_index(b, instr->src[2], comps) : bi_null(); switch (instr->op) { + case nir_op_ffma: case nir_op_ffma_old: bi_fma_to(b, sz, dst, s0, s1, s2); break; diff --git a/src/panfrost/compiler/bifrost/bifrost_compile.h b/src/panfrost/compiler/bifrost/bifrost_compile.h index 71eb9e9db44..d5fe7f00044 100644 --- a/src/panfrost/compiler/bifrost/bifrost_compile.h +++ b/src/panfrost/compiler/bifrost/bifrost_compile.h @@ -128,6 +128,12 @@ bool valhall_can_merge_workgroups(nir_shader *nir); .fuse_ffma16 = true, \ .fuse_ffma32 = true, \ .fuse_ffma64 = true, \ + .float_mul_add16 = nir_float_muladd_support_has_ffma | \ + nir_float_muladd_support_fuse, \ + .float_mul_add32 = nir_float_muladd_support_has_ffma | \ + nir_float_muladd_support_fuse, \ + .float_mul_add64 = nir_float_muladd_support_has_ffma | \ + nir_float_muladd_support_fuse, \ \ .lower_uniforms_to_ubo = true, \ \