brw/algebraic: Clear condition modifier on optimized SEL instruction

The condition modifier on SEL means something completely different than
it means on MOV.  On MOV it means to modify the flags based on the value
written to the destination. On SEL it means to compare the sources using
that mode and pick the result (i.e., as min() or max()) without
modifying the flags.

The resulting MOV should not have a condition modifier for the same
reason it (already) doesn't have a predicate. This bug was found by
inspection, so I added a unit test.

No shader-db or shader-db changes on any Intel platform.

Fixes: fab92fa1cb ("i965/fs: Optimize SEL with the same sources into a MOV.")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34192>
(cherry picked from commit 07dc1d4043)
This commit is contained in:
Ian Romanick 2025-03-10 11:24:18 -07:00 committed by Eric Engestrom
parent 006af589ee
commit 055cbf9836
2 changed files with 2 additions and 1 deletions

View file

@ -3014,7 +3014,7 @@
"description": "brw/algebraic: Clear condition modifier on optimized SEL instruction",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "fab92fa1cba4196a4947731e7105bd1494dfffc4",
"notes": null

View file

@ -552,6 +552,7 @@ brw_opt_algebraic(fs_visitor &s)
inst->opcode = BRW_OPCODE_MOV;
inst->predicate = BRW_PREDICATE_NONE;
inst->predicate_inverse = false;
inst->conditional_mod = BRW_CONDITIONAL_NONE;
inst->resize_sources(1);
progress = true;
} else if (inst->saturate && inst->src[1].file == IMM) {