summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2015-10-09 14:39:17 -0700
committerMatt Turner <mattst88@gmail.com>2015-10-12 09:22:08 -0700
commit4e782677e260f1fba1dedf5ded22cfa69c439e5e (patch)
treee8405754e189b039142d690405766c737d7b7743
parent2ef2db703bacf471045c14392d33a89a2479a06f (diff)
i965/vec4: Unrestrict constant propagation into integer multiply.vec4-lower-int-mul
Analogous to commit 81deefc45b in the i965/fs backend.
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp10
1 files changed, 9 insertions, 1 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 610caef7dce..d0aea3a78c1 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
@@ -191,8 +191,16 @@ try_constant_propagate(const struct brw_device_info *devinfo,
} 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/MACH because it's asymmetric.
+ *
+ * The BSpec says for Broadwell that
+ *
+ * "When multiplying DW x DW, the dst cannot be accumulator."
+ *
+ * Integer MUL with a non-accumulator destination will be lowered
+ * by lower_integer_multiplication(), so don't restrict it.
*/
- if ((inst->opcode == BRW_OPCODE_MUL ||
+ if (((inst->opcode == BRW_OPCODE_MUL &&
+ inst->dst.is_accumulator()) ||
inst->opcode == BRW_OPCODE_MACH) &&
(inst->src[1].type == BRW_REGISTER_TYPE_D ||
inst->src[1].type == BRW_REGISTER_TYPE_UD))