[Mesa-stable] [PATCH v3 13/48] intel/fs: Use the original destination region for int MUL lowering

Mark Janes mark.a.janes at intel.com
Wed Nov 8 17:46:36 UTC 2017


This patch is CC'd to stable, but CTS regressions bisected to it:

https://bugs.freedesktop.org/show_bug.cgi?id=103626

Please do not merge to stable until the bug is addressed.


Jason Ekstrand <jason at jlekstrand.net> writes:

> Some hardware (CHV, BXT) have special restrictions on register regions
> when doing integer multiplication.  We want to respect those when we
> lower to DxW multiplication.
>
> Cc: mesa-stable at lists.freedesktop.org
> ---
>  src/intel/compiler/brw_fs.cpp | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
> index 56455e9..1c4351b 100644
> --- a/src/intel/compiler/brw_fs.cpp
> +++ b/src/intel/compiler/brw_fs.cpp
> @@ -3482,18 +3482,20 @@ fs_visitor::lower_integer_multiplication()
>  
>              bool needs_mov = false;
>              fs_reg orig_dst = inst->dst;
> +            fs_reg low = inst->dst;
>              if (orig_dst.is_null() || orig_dst.file == MRF ||
>                  regions_overlap(inst->dst, inst->size_written,
>                                  inst->src[0], inst->size_read(0)) ||
>                  regions_overlap(inst->dst, inst->size_written,
>                                  inst->src[1], inst->size_read(1))) {
>                 needs_mov = true;
> -               inst->dst = fs_reg(VGRF, alloc.allocate(dispatch_width / 8),
> -                                  inst->dst.type);
> +               low.nr = alloc.allocate(regs_written(inst));
> +               low.offset = low.offset % REG_SIZE;
>              }
> -            fs_reg low = inst->dst;
> -            fs_reg high(VGRF, alloc.allocate(dispatch_width / 8),
> -                        inst->dst.type);
> +
> +            fs_reg high = inst->dst;
> +            high.nr = alloc.allocate(regs_written(inst));
> +            high.offset = high.offset % REG_SIZE;
>  
>              if (devinfo->gen >= 7) {
>                 if (inst->src[1].file == IMM) {
> @@ -3514,13 +3516,13 @@ fs_visitor::lower_integer_multiplication()
>                          inst->src[1]);
>              }
>  
> -            ibld.ADD(subscript(inst->dst, BRW_REGISTER_TYPE_UW, 1),
> +            ibld.ADD(subscript(low, BRW_REGISTER_TYPE_UW, 1),
>                       subscript(low, BRW_REGISTER_TYPE_UW, 1),
>                       subscript(high, BRW_REGISTER_TYPE_UW, 0));
>  
>              if (needs_mov || inst->conditional_mod) {
>                 set_condmod(inst->conditional_mod,
> -                           ibld.MOV(orig_dst, inst->dst));
> +                           ibld.MOV(orig_dst, low));
>              }
>           }
>  
> -- 
> 2.5.0.400.gff86faf
>
> _______________________________________________
> mesa-stable mailing list
> mesa-stable at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-stable


More information about the mesa-stable mailing list