<div dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 18, 2019 at 6:09 PM Francisco Jerez <<a href="mailto:currojerez@riseup.net">currojerez@riseup.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Even though the hardware spec claims that any "integer DWord multiply"<br>
operation is affected by the regioning restrictions of CHV/BXT/GLK,<br>
this is inconsistent with the behavior of the simulator and with<br>
empirical evidence -- Return false from has_dst_aligned_region_restriction()<br>
for such instructions as a micro-optimization.<br>
---<br>
src/intel/compiler/brw_ir_fs.h | 14 +++++++++++---<br>
1 file changed, 11 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/intel/compiler/brw_ir_fs.h b/src/intel/compiler/brw_ir_fs.h<br>
index 0a0ba1d363a..c50df45922a 100644<br>
--- a/src/intel/compiler/brw_ir_fs.h<br>
+++ b/src/intel/compiler/brw_ir_fs.h<br>
@@ -543,11 +543,19 @@ has_dst_aligned_region_restriction(const gen_device_info *devinfo,<br>
const fs_inst *inst)<br>
{<br>
const brw_reg_type exec_type = get_exec_type(inst);<br>
- const bool is_int_multiply = !brw_reg_type_is_floating_point(exec_type) &&<br>
- (inst->opcode == BRW_OPCODE_MUL || inst->opcode == BRW_OPCODE_MAD);<br>
+ /* Even though the hardware spec claims that "integer DWord multiply"<br>
+ * operations are restricted, empirical evidence and the behavior of the<br>
+ * simulator suggest that only 32x32-bit integer multiplication is<br>
+ * restricted.<br>
+ */<br>
+ const bool is_dword_multiply = !brw_reg_type_is_floating_point(exec_type) &&<br>
+ ((inst->opcode == BRW_OPCODE_MUL &&<br>
+ MIN2(type_sz(inst->src[0].type), type_sz(inst->src[1].type)) >= 4) ||<br>
+ (inst->opcode == BRW_OPCODE_MAD &&<br>
+ MIN2(type_sz(inst->src[1].type), type_sz(inst->src[2].type)) >= 4));<br>
<br>
if (type_sz(inst->dst.type) > 4 || type_sz(exec_type) > 4 ||<br>
- (type_sz(exec_type) == 4 && is_int_multiply))<br>
+ (type_sz(exec_type) == 4 && is_dword_multiply))<br>
return devinfo->is_cherryview || gen_device_info_is_9lp(devinfo);<br>
else<br>
return false;<br>
-- <br>
2.19.2<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">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>
</blockquote></div>