<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 24, 2016 at 12:18 AM, Francisco Jerez <span dir="ltr"><<a href="mailto:currojerez@riseup.net" target="_blank">currojerez@riseup.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Due to a Gen7-specific hardware bug native 32-wide instructions get<br>
the lower 16 bits of the execution mask applied incorrectly to both<br>
halves of the instruction, so the MOV trick we currently use wouldn't<br>
work. Instead emit multiple 16-wide MOV instructions in 32-wide mode<br>
in order to cover the whole execution mask.<br>
---<br>
src/mesa/drivers/dri/i965/brw_eu_emit.c | 25 +++++++++++++++++--------<br>
1 file changed, 17 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c<br>
index af7caed..d36877c 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c<br>
@@ -3330,6 +3330,7 @@ void<br>
brw_find_live_channel(struct brw_codegen *p, struct brw_reg dst)<br>
{<br>
const struct brw_device_info *devinfo = p->devinfo;<br>
+ const unsigned exec_size = 1 << brw_inst_exec_size(devinfo, p->current);<br>
brw_inst *inst;<br>
<br>
assert(devinfo->gen >= 7);<br>
@@ -3359,15 +3360,23 @@ brw_find_live_channel(struct brw_codegen *p, struct brw_reg dst)<br>
<br>
brw_MOV(p, flag, brw_imm_ud(0));<br>
<br>
- /* Run a 16-wide instruction returning zero with execution masking<br>
- * and a conditional modifier enabled in order to get the current<br>
- * execution mask in f1.0.<br>
+ /* Run enough instructions returning zero with execution masking and<br>
+ * a conditional modifier enabled in order to get the full execution<br>
+ * mask in f1.0. We could use a single 32-wide move here if it<br>
+ * weren't because of the hardware bug that causes channel enables to<br>
+ * be applied incorrectly to the second half of 32-wide instructions<br>
+ * on Gen7.<br>
*/<br>
- inst = brw_MOV(p, brw_null_reg(), brw_imm_ud(0));<br>
- brw_inst_set_exec_size(devinfo, inst, BRW_EXECUTE_16);<br>
- brw_inst_set_mask_control(devinfo, inst, BRW_MASK_ENABLE);<br>
- brw_inst_set_cond_modifier(devinfo, inst, BRW_CONDITIONAL_Z);<br>
- brw_inst_set_flag_reg_nr(devinfo, inst, 1);<br>
+ const unsigned lower_size = MIN2(16, exec_size);<br>
+ for (unsigned i = 0; i < exec_size / lower_size; i++) {<br>
+ inst = brw_MOV(p, retype(brw_null_reg(), BRW_REGISTER_TYPE_UW),<br>
+ brw_imm_uw(0));<br></blockquote><div><br></div><div>Is there a reason this is changing from D to UW?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ brw_inst_set_mask_control(devinfo, inst, BRW_MASK_ENABLE);<br>
+ brw_inst_set_group(devinfo, inst, lower_size * i);<br>
+ brw_inst_set_cond_modifier(devinfo, inst, BRW_CONDITIONAL_Z);<br>
+ brw_inst_set_flag_reg_nr(devinfo, inst, 1);<br>
+ brw_inst_set_exec_size(devinfo, inst, cvt(lower_size) - 1);<br>
+ }<br>
<br>
brw_FBL(p, vec1(dst), flag);<br>
}<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.3<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="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>