diff options
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp | 17 |
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 83cf19114be..3242c3a0dd0 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; |