This is a trivial port of
1d6ead38042cc0d1e667d8ff55937c1e32d108b1 from
the FS.
No significant performance difference on trex (misplaced the data, but it
was about n=20).
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
inst->src[arg] = value;
return true;
+ case BRW_OPCODE_MACH:
case BRW_OPCODE_MUL:
case BRW_OPCODE_ADD:
if (arg == 1) {
return true;
} else if (arg == 0 && inst->src[1].file != IMM) {
/* Fit this constant in by commuting the operands. Exception: we
- * can't do this for 32-bit integer MUL because it's asymmetric.
+ * can't do this for 32-bit integer MUL/MACH because it's asymmetric.
*/
- if (inst->opcode == BRW_OPCODE_MUL &&
+ if ((inst->opcode == BRW_OPCODE_MUL ||
+ inst->opcode == BRW_OPCODE_MACH) &&
(inst->src[1].type == BRW_REGISTER_TYPE_D ||
inst->src[1].type == BRW_REGISTER_TYPE_UD))
break;