nir: add fmul_rtz

It's needed in NVK for correctness with interpolation.

Backport-to: 26.1
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
(cherry picked from commit 4e520f671c)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41402>
This commit is contained in:
Karol Herbst 2026-04-25 14:36:57 +02:00 committed by Eric Engestrom
parent d3ec8ffb9c
commit f40ef3b0d9
2 changed files with 5 additions and 1 deletions

View file

@ -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

View file

@ -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;