<p dir="ltr"><br>
On May 2, 2016 12:31 AM, "Iago Toral" <<a href="mailto:itoral@igalia.com">itoral@igalia.com</a>> wrote:<br>
><br>
> On Sun, 2016-05-01 at 20:04 -0700, Jordan Justen wrote:<br>
> > On 2016-04-29 04:29:56, Samuel Iglesias Gonsálvez wrote:<br>
> > > In that case, the writes need two times the size of a 32-bit value.<br>
> > > We need to adjust the exec_size, so it is not breaking any hardware<br>
> > > rule.<br>
> > ><br>
> > > Signed-off-by: Samuel Iglesias Gonsálvez <<a href="mailto:siglesias@igalia.com">siglesias@igalia.com</a>><br>
> > > ---<br>
> > > src/mesa/drivers/dri/i965/brw_fs.cpp | 8 +++++++-<br>
> > > 1 file changed, 7 insertions(+), 1 deletion(-)<br>
> > ><br>
> > > diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
> > > index 059edc6..85d430c 100644<br>
> > > --- a/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
> > > +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
> > > @@ -4655,7 +4655,13 @@ get_lowered_simd_width(const struct brw_device_info *devinfo,<br>
> > ><br>
> > > case SHADER_OPCODE_MOV_INDIRECT:<br>
> > > /* Prior to Broadwell, we only have 8 address subregisters */<br>
> > > - return devinfo->gen < 8 ? 8 : MIN2(inst->exec_size, 16);<br>
> > > + if (devinfo->gen < 8)<br>
> > > + return 8;<br>
> > > +<br>
> > > + if (inst->exec_size < 16)<br>
> > > + return inst->exec_size;<br>
> > > + else<br>
> > > + return MIN2(inst->exec_size / (type_sz(inst->dst.type) / 4), 16);<br>
> ><br>
> > Can't type_sz return < 4, which could cause a divide by 0? If that<br>
> > can't happen along this code path, would an assert be a good idea?<br>
><br>
> Looking at the places where the driver inserts MOV INDIRECT opcodes it<br>
> seems that it always uses region sizes that are multiples of 4 and dst<br>
> types are usually UD (except in load uniform where I don't think we can<br>
> see any types that are not at least 4 bytes, since we implement bool as<br>
> UD too), so it seems to me that we shouldn't be seeing types with sizes<br>
> < 4 here.</p>
<p dir="ltr">At stone point in the future, it may be used for half-float types. I'm not to worried about that case at the moment though.</p>
<p dir="ltr">> That said, I am adding Jason in the CC just in case I am missing<br>
> something.<br>
><br>
> In any case, adding the assert for extra safety sounds good to me.<br>
><br>
> > -Jordan<br>
> ><br>
> > ><br>
> > > default:<br>
> > > return inst->exec_size;<br>
> > > --<br>
> > > 2.5.0<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">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><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">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
><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">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</p>