From 055cbf983619354f41a55a0e021d8ec9f30755ca Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 10 Mar 2025 11:24:18 -0700 Subject: [PATCH] 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: fab92fa1cba ("i965/fs: Optimize SEL with the same sources into a MOV.") Reviewed-by: Ivan Briano Part-of: (cherry picked from commit 07dc1d40437ce6a5ac417f0b20146d9512a595a1) --- .pick_status.json | 2 +- src/intel/compiler/brw_opt_algebraic.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index f27b5ce471a..cba8b78940f 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 diff --git a/src/intel/compiler/brw_opt_algebraic.cpp b/src/intel/compiler/brw_opt_algebraic.cpp index 940f52c245f..95b973cf836 100644 --- a/src/intel/compiler/brw_opt_algebraic.cpp +++ b/src/intel/compiler/brw_opt_algebraic.cpp @@ -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) {