summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-06-07 17:58:18 -0700
committerEric Anholt <eric@anholt.net>2013-06-10 14:04:24 -0700
commitd28e285d41bbb482384fb2174c92b9f63aa1175f (patch)
tree51c01dc0cbe8f6acda430e36f0a9d164bd59fde3 /src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
parent263a7e4cd992738814575b04d2de24ca0a0ad08a (diff)
downloadexternal_mesa3d-d28e285d41bbb482384fb2174c92b9f63aa1175f.zip
external_mesa3d-d28e285d41bbb482384fb2174c92b9f63aa1175f.tar.gz
external_mesa3d-d28e285d41bbb482384fb2174c92b9f63aa1175f.tar.bz2
i965/vs: Allow copy propagation into MUL/MACH.
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>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
index 1a667eb..64f6ccc 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
@@ -95,6 +95,7 @@ try_constant_propagation(vec4_instruction *inst, int arg, src_reg *values[4])
inst->src[arg] = value;
return true;
+ case BRW_OPCODE_MACH:
case BRW_OPCODE_MUL:
case BRW_OPCODE_ADD:
if (arg == 1) {
@@ -102,9 +103,10 @@ try_constant_propagation(vec4_instruction *inst, int arg, src_reg *values[4])
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;