r300: fix bias presubtract algebraic transformation

One fneg too many.

Fixes: 0508db915 ("r300: implement bias presubtract")
(cherry picked from commit e68e519b91)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
This commit is contained in:
Pavel Ondračka 2026-03-27 10:40:27 +01:00 committed by Eric Engestrom
parent af53a9bfbc
commit e06648d86a
2 changed files with 3 additions and 3 deletions

View file

@ -704,7 +704,7 @@
"description": "r300: fix bias presubtract algebraic transformation",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "0508db91556242c57029ad538613c2b1ee1969ef",
"notes": null

View file

@ -53,8 +53,8 @@ r300_nir_prepare_presubtract = [
(('fadd', -1.0, a), ('fneg', ('fadd', 1.0, ('fneg', a)))),
# Bias presubtract 1 - 2 * x expects MAD -a 2.0 1.0 form.
(('ffma', 2.0, ('fneg', a), 1.0), ('ffma', ('fneg', a), 2.0, 1.0)),
(('ffma', a, -2.0, 1.0), ('fneg', ('ffma', ('fneg', a), 2.0, 1.0))),
(('ffma', -2.0, a, 1.0), ('fneg', ('ffma', ('fneg', a), 2.0, 1.0))),
(('ffma', a, -2.0, 1.0), ('ffma', ('fneg', a), 2.0, 1.0)),
(('ffma', -2.0, a, 1.0), ('ffma', ('fneg', a), 2.0, 1.0)),
(('ffma', 2.0, a, -1.0), ('fneg', ('ffma', ('fneg', a), 2.0, 1.0))),
(('ffma', a, 2.0, -1.0), ('fneg', ('ffma', ('fneg', a), 2.0, 1.0))),
# x * 2 can be usually folded into output modifier for the previous