summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
diff options
context:
space:
mode:
authorAbdiel Janulgue <abdiel.janulgue@linux.intel.com>2014-06-05 11:05:31 -0700
committerMatt Turner <mattst88@gmail.com>2014-06-09 11:19:48 -0700
commitc17db7537fe112841bb76b91865a30d97aae3594 (patch)
tree2412e7be311791164d895a773d2de54162ead643 /src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
parent609d00e13e1e3e61ce540c42250c35977d4bcaa1 (diff)
downloadexternal_mesa3d-c17db7537fe112841bb76b91865a30d97aae3594.zip
external_mesa3d-c17db7537fe112841bb76b91865a30d97aae3594.tar.gz
external_mesa3d-c17db7537fe112841bb76b91865a30d97aae3594.tar.bz2
i965/vec4: skip copy-propate for logical instructions with negated src entries
The negation source modifier on src registers has changed meaning in Broadwell when used with logical operations. Don't copy propagate when negate src modifier is set and when the destination instruction is a logical op. Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.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.cpp17
1 files changed, 17 insertions, 0 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 83cf191..3242c3a 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
@@ -195,6 +195,15 @@ try_constant_propagation(vec4_instruction *inst, int arg, src_reg *values[4])
return false;
}
+static bool
+is_logic_op(enum opcode opcode)
+{
+ return (opcode == BRW_OPCODE_AND ||
+ opcode == BRW_OPCODE_OR ||
+ opcode == BRW_OPCODE_XOR ||
+ opcode == BRW_OPCODE_NOT);
+}
+
bool
vec4_visitor::try_copy_propagation(vec4_instruction *inst, int arg,
src_reg *values[4])
@@ -233,6 +242,14 @@ vec4_visitor::try_copy_propagation(vec4_instruction *inst, int arg,
value.file != ATTR)
return false;
+ if (brw->gen >= 8) {
+ if (value.negate) {
+ if (is_logic_op(inst->opcode)) {
+ return false;
+ }
+ }
+ }
+
if (inst->src[arg].abs) {
value.negate = false;
value.abs = true;