[Mesa-dev] [PATCH 2/2] i965/vec4: Unrestrict constant propagation into integer multiply.

Matt Turner mattst88 at gmail.com
Mon Apr 18 23:14:16 UTC 2016


Analogous to commit 81deefc45b in the i965/fs backend.
---
No shader-db changes because the vec4 copy propagation pass is local-only.

 src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

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 92423e1..7929dbc 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
@@ -216,8 +216,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))
-- 
2.7.3



More information about the mesa-dev mailing list