<div dir="ltr">On 12 August 2013 13:18, Matt Turner <span dir="ltr"><<a href="mailto:mattst88@gmail.com" target="_blank">mattst88@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
src/mesa/drivers/dri/i965/brw_fs.cpp | 13 +++++++++++++<br>
src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp | 3 +++<br>
src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp | 10 ++++++----<br>
3 files changed, 22 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
index a81e97f..f104f8c 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
@@ -2118,6 +2118,19 @@ fs_visitor::register_coalesce()<br>
}<br>
}<br>
<br>
+ if (has_source_modifiers) {<br>
+ for (int i = 0; i < 3; i++) {<br>
+ if (scan_inst->src[i].file == GRF &&<br>
+ scan_inst->src[i].reg == inst->dst.reg &&<br>
+ scan_inst->src[i].reg_offset == inst->dst.reg_offset &&<br>
+ inst->dst.type != scan_inst->src[i].type)<br>
+ {<br>
+ return false;<br>
+ }<br>
+ }<br>
+ }<br>
+<br>
+<br></blockquote><div><br></div><div>I don't understand the whole patch, but I'm pretty sure it's wrong to return false in this case, because that will exit the entire fs_visitor::register_coalesce() function.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
/* The gen6 MATH instruction can't handle source modifiers or<br>
* unusual register regions, so avoid coalescing those for<br>
* now. We should do something more specific.<br>
diff --git a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp<br>
index 234f8bd..a5cd858 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp<br>
@@ -221,6 +221,9 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry)<br>
entry->src.smear != -1) && !can_do_source_mods(inst))<br>
return false;<br>
<br>
+ if (has_source_modifiers && (entry->dst.type != inst->src[arg].type))<br>
+ return false;<br>
+<br>
inst->src[arg].file = entry->src.file;<br>
inst->src[arg].reg = entry->src.reg;<br>
inst->src[arg].reg_offset = entry->src.reg_offset;<br>
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp<br>
index c28d0de..2a2d403 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp<br>
@@ -206,14 +206,16 @@ vec4_visitor::try_copy_propagation(vec4_instruction *inst, int arg,<br>
if (inst->src[arg].negate)<br>
value.negate = !value.negate;<br>
<br>
- bool has_source_modifiers = (value.negate || value.abs ||<br>
- value.swizzle != BRW_SWIZZLE_XYZW ||<br>
- value.file == UNIFORM);<br>
+ bool has_source_modifiers = value.negate || value.abs;<br>
<br>
/* gen6 math and gen7+ SENDs from GRFs ignore source modifiers on<br>
* instructions.<br>
*/<br>
- if (has_source_modifiers && !can_do_source_mods(inst))<br>
+ if ((has_source_modifiers || value.file == UNIFORM ||<br>
+ value.swizzle != BRW_SWIZZLE_XYZW) && !can_do_source_mods(inst))<br>
+ return false;<br>
+<br>
+ if (has_source_modifiers && (value.type != inst->src[arg].type))<br>
return false;<br>
<br>
bool is_3src_inst = (inst->opcode == BRW_OPCODE_LRP ||<br>
<span class=""><font color="#888888">--<br>
1.8.3.2<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>