summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2015-10-14 02:12:09 -0700
committerMatt Turner <mattst88@gmail.com>2015-10-19 10:19:32 -0700
commit9e17c36b8ba79e688011a5fd293ad5f42da21b66 (patch)
tree087a0c6e89b1f5ae0f506160fae5386ee39f7950 /src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
parent41c474df53d9dcd5fd8e24eba5b7acc2b3c32795 (diff)
downloadexternal_mesa3d-9e17c36b8ba79e688011a5fd293ad5f42da21b66.zip
external_mesa3d-9e17c36b8ba79e688011a5fd293ad5f42da21b66.tar.gz
external_mesa3d-9e17c36b8ba79e688011a5fd293ad5f42da21b66.tar.bz2
i965: Extract can_change_source_types() functions.
Make them members of fs_inst/vec4_instruction for use elsewhere. Also fix the fs version to check that dst.type == src[1].type and for !saturate. Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp15
1 files changed, 2 insertions, 13 deletions
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 230b0ca..5589716 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -275,17 +275,6 @@ is_logic_op(enum opcode opcode)
opcode == BRW_OPCODE_NOT);
}
-static bool
-can_change_source_types(fs_inst *inst)
-{
- return !inst->src[0].abs && !inst->src[0].negate &&
- inst->dst.type == inst->src[0].type &&
- (inst->opcode == BRW_OPCODE_MOV ||
- (inst->opcode == BRW_OPCODE_SEL &&
- inst->predicate != BRW_PREDICATE_NONE &&
- !inst->src[1].abs && !inst->src[1].negate));
-}
-
bool
fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry)
{
@@ -368,7 +357,7 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry)
if (has_source_modifiers &&
entry->dst.type != inst->src[arg].type &&
- !can_change_source_types(inst))
+ !inst->can_change_types())
return false;
if (devinfo->gen >= 8 && (entry->src.negate || entry->src.abs) &&
@@ -438,7 +427,7 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry)
* type. If we got here, then we can just change the source and
* destination types of the instruction and keep going.
*/
- assert(can_change_source_types(inst));
+ assert(inst->can_change_types());
for (int i = 0; i < inst->sources; i++) {
inst->src[i].type = entry->dst.type;
}