[Mesa-dev] [PATCH v2 04/20] i965/fs: clamp exec_size to 4 when an instruction has an scalar DF source
Samuel Iglesias Gonsálvez
siglesias at igalia.com
Wed Jan 18 10:44:17 UTC 2017
On Tue, 2017-01-17 at 12:26 -0800, Francisco Jerez wrote:
> Typo in the subject line "an scalar".
>
> Samuel Iglesias Gonsálvez <siglesias at igalia.com> writes:
>
> > Then the SIMD lowering pass will get rid of any compressed
> > instructions with scalar
> > source (whether force_writemask_all or not) and we avoid hitting
> > the Gen7 region
> > decompression bug.
> >
> > Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
> > Suggested-by: Francisco Jerez <currojerez at riseup.net>
> > ---
> > src/mesa/drivers/dri/i965/brw_fs.cpp | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp
> > b/src/mesa/drivers/dri/i965/brw_fs.cpp
> > index 95714c16f15..a2ba0fde9fd 100644
> > --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> > +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> > @@ -4516,6 +4516,11 @@ get_fpu_lowered_simd_width(const struct
> > gen_device_info *devinfo,
> > const unsigned reg_count = DIV_ROUND_UP(inst-
> > >size_written, REG_SIZE);
> > max_width = MIN2(max_width, inst->exec_size /
> > reg_count);
> > }
> > +
> > + if (type_sz(inst->src[i].type) == 8 &&
> > + ((inst->size_read(i) != 0 && inst->size_read(i) <=
> > REG_SIZE) ||
>
> Not sure what you're trying to achieve with the line above.
>
> > + is_uniform(inst->src[i])))
> > + max_width = MIN2(max_width, 4);
>
> AFAICT this is going to do the lowering incorrectly on HSW which
> doesn't
> have the same limitation. Let's restructure things slightly for
> readability:
>
> > for (unsigned i = 0; i < inst->sources; i++) {
> > /* IVB implements DF scalars as <0;2,1> regions. */
> > const bool is_scalar_exception = is_uniform(inst->src[i]) &&
> > (devinfo->is_haswell || type_sz(inst->src[i].type) != 8);
> > const bool is_packed_word_exception =
> > type_sz(inst->dst.type) == 4 && inst->dst.stride == 1 &&
> > type_sz(inst->src[i].type) == 2 && inst->src[i].stride ==
> > 1;
> >
> > if (inst->size_written > REG_SIZE &&
> > inst->size_read(i) != 0 && inst->size_read(i) <= REG_SIZE
> > &&
> > !is_scalar_exception && !is_packed_word_exception) {
> > // ...
> > }
> > }
>
> If you do it as above patch is:
>
> Reviewed-by: Francisco Jerez <currojerez at riseup.net>
>
OK, thanks.
Sam
> > }
> > }
> >
> > --
> > 2.11.0
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170118/122ba988/attachment.sig>
More information about the mesa-dev
mailing list