diff --git a/.pick_status.json b/.pick_status.json index d67f7fb292d..0d73d4685e4 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -6814,7 +6814,7 @@ "description": "brw: Fix folding case for MAD instruction with all immediates", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "b605f76b2a6b19194a3f4f29d7bb40e47648cda3", "notes": null diff --git a/src/intel/compiler/brw_opt_algebraic.cpp b/src/intel/compiler/brw_opt_algebraic.cpp index 00d50ce3c3d..1e532daaeb4 100644 --- a/src/intel/compiler/brw_opt_algebraic.cpp +++ b/src/intel/compiler/brw_opt_algebraic.cpp @@ -181,12 +181,12 @@ brw_opt_constant_fold_instruction(const intel_device_info *devinfo, brw_inst *in break; case BRW_OPCODE_MAD: - if (inst->src[1].file == IMM && + if (inst->src[0].file == IMM && + inst->src[1].file == IMM && inst->src[2].file == IMM && - inst->src[3].file == IMM && + !brw_type_is_vector_imm(inst->src[0].type) && !brw_type_is_vector_imm(inst->src[1].type) && - !brw_type_is_vector_imm(inst->src[2].type) && - !brw_type_is_vector_imm(inst->src[3].type)) { + !brw_type_is_vector_imm(inst->src[2].type)) { fold_multiplicands_of_MAD(inst); assert(inst->opcode == BRW_OPCODE_ADD);