From 609d00e13e1e3e61ce540c42250c35977d4bcaa1 Mon Sep 17 00:00:00 2001 From: Abdiel Janulgue Date: Thu, 5 Jun 2014 11:05:29 -0700 Subject: [PATCH] i965/fs: 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 Signed-off-by: Abdiel Janulgue --- .../dri/i965/brw_fs_copy_propagation.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp index d3d59aa1bc9..158d0bad507 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp @@ -272,6 +272,15 @@ fs_copy_prop_dataflow::dump_block_data() const } } +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 fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry) { @@ -330,6 +339,14 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry) if (has_source_modifiers && entry->dst.type != inst->src[arg].type) return false; + if (brw->gen >= 8) { + if (entry->src.negate) { + if (is_logic_op(inst->opcode)) { + return false; + } + } + } + inst->src[arg].file = entry->src.file; inst->src[arg].reg = entry->src.reg; inst->src[arg].reg_offset = entry->src.reg_offset; -- 2.30.2