From f40ef3b0d9d3a3766454aec44e7de548c97aaad5 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sat, 25 Apr 2026 14:36:57 +0200 Subject: [PATCH] nir: add fmul_rtz It's needed in NVK for correctness with interpolation. Backport-to: 26.1 Reviewed-by: Mel Henning (cherry picked from commit 4e520f671c2eda86bdef23830dfc861dcbadafb7) Part-of: --- .pick_status.json | 2 +- src/compiler/nir/nir_opcodes.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 3d2b0e1687d..c6cb84fdbf9 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2594,7 +2594,7 @@ "description": "nir: add fmul_rtz", "nominated": true, "nomination_type": 4, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py index b7cf4cc4155..03cb99cc6df 100644 --- a/src/compiler/nir/nir_opcodes.py +++ b/src/compiler/nir/nir_opcodes.py @@ -780,6 +780,10 @@ if (nir_is_rounding_mode_rtz(execution_mode, bit_size)) { } """) +binop("fmul_rtz", tfloat32, _2src_commutative + inexact_associative, """ +dst = _mesa_double_to_float_rtz((double)src0 * (double)src1); +""") + binop("fmulz", tfloat32, _2src_commutative + inexact_associative, """ if (src0 == 0.0 || src1 == 0.0) dst = 0.0;