From d7227b11a1056cdb50b4c4192ed30152c51fef58 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 1 Dec 2025 11:07:29 -0800 Subject: [PATCH] brw: elk: Disable can_do_cmod for MACH PRMs for G35 (Gfx4) through Ivy Bridge (Gfx7) all say that conditional modifiers are allowed for MACH. Starting with Haswell (Gfx7.5), this seems to be removed. This function doesn't have any way to know the platform, so false is returned for all platforms. No shader-db or fossil-db changes on any Intel platform. Prevents a failure in "brw: Do cmod prop again after post-RA scheduling" in piglit's builtin-uint-mad_sat-1.0.generated.cl. Cc: stable Reviewed-by: Kenneth Graunke Part-of: --- src/intel/compiler/brw/brw_inst.cpp | 1 - src/intel/compiler/elk/elk_shader.cpp | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/intel/compiler/brw/brw_inst.cpp b/src/intel/compiler/brw/brw_inst.cpp index 0829d3565d2..aa14a08d5ce 100644 --- a/src/intel/compiler/brw/brw_inst.cpp +++ b/src/intel/compiler/brw/brw_inst.cpp @@ -403,7 +403,6 @@ brw_inst::can_do_cmod(enum brw_conditional_mod cmod) const case BRW_OPCODE_LRP: case BRW_OPCODE_LZD: case BRW_OPCODE_MAC: - case BRW_OPCODE_MACH: case BRW_OPCODE_MAD: case BRW_OPCODE_MOV: case BRW_OPCODE_MUL: diff --git a/src/intel/compiler/elk/elk_shader.cpp b/src/intel/compiler/elk/elk_shader.cpp index 167bcf9e214..ccae2fce09e 100644 --- a/src/intel/compiler/elk/elk_shader.cpp +++ b/src/intel/compiler/elk/elk_shader.cpp @@ -1004,7 +1004,6 @@ elk_backend_instruction::can_do_cmod() const case ELK_OPCODE_LRP: case ELK_OPCODE_LZD: case ELK_OPCODE_MAC: - case ELK_OPCODE_MACH: case ELK_OPCODE_MAD: case ELK_OPCODE_MOV: case ELK_OPCODE_MUL: @@ -1023,6 +1022,13 @@ elk_backend_instruction::can_do_cmod() const case ELK_OPCODE_XOR: case ELK_FS_OPCODE_LINTERP: return true; + + /* PRMs for Gfx4 through Gfx7 all say that conditional modifiers are + * allowed for MACH. Starting with Gfx7.5 (Haswell), this seems to be + * removed. This function doesn't have any way to know the platform, so + * false is returned for all platforms. + */ + case ELK_OPCODE_MACH: default: return false; }