From fa5ce01ea3fc26f5b2a707d5a51f309aa27df9a8 Mon Sep 17 00:00:00 2001 From: Patrick Lerda Date: Mon, 25 May 2026 13:09:31 +0200 Subject: [PATCH] r600: update muladd support configuration This change updates the configuration to fix some regressions with the fpu64 emulation. Note: The r600 has a single precision fma op code which breaks the fpu64 emulation if used as nir_op_ffma (It likely returns a double). This change was tested on palm and barts. Fixes: aeea2e7c1f0a ("nir: add fmad_or_ffma helpers and use it in lower_double_ops") Signed-off-by: Patrick Lerda Part-of: --- src/gallium/drivers/r600/r600_pipe_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r600/r600_pipe_common.c b/src/gallium/drivers/r600/r600_pipe_common.c index 2584b83a364..bd424ced007 100644 --- a/src/gallium/drivers/r600/r600_pipe_common.c +++ b/src/gallium/drivers/r600/r600_pipe_common.c @@ -1083,10 +1083,12 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen, printf("max_alignment = %u\n", (unsigned)rscreen->info.max_alignment); } + const bool fp64_emulation = rscreen->info.gfx_level < CAYMAN; + const struct nir_shader_compiler_options nir_options = { .float_mul_add16 = nir_float_muladd_support_has_fmad | nir_float_muladd_support_fuse, .float_mul_add32 = nir_float_muladd_support_has_fmad | nir_float_muladd_support_fuse, - .float_mul_add64 = nir_float_muladd_support_has_ffma | nir_float_muladd_support_fuse, + .float_mul_add64 = fp64_emulation ? 0 : nir_float_muladd_support_has_ffma | nir_float_muladd_support_fuse, .lower_flrp32 = true, .lower_flrp64 = true, .lower_fdiv = true, @@ -1152,7 +1154,7 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen, rscreen->nir_options.lower_bitfield_reverse = true; } - if (rscreen->info.gfx_level < CAYMAN) { + if (fp64_emulation) { rscreen->nir_options.lower_atomic_offset_to_range_base = true; rscreen->nir_options.lower_doubles_options =