[Beignet] [PATCH] GBE: fix a bug in byte scatter write.

Yang, Rong R rong.r.yang at intel.com
Mon Apr 13 01:55:30 PDT 2015


LGTM, thanks.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Zhigang Gong
> Sent: Monday, April 13, 2015 10:38
> To: beignet at lists.freedesktop.org
> Cc: Gong, Zhigang
> Subject: [Beignet] [PATCH] GBE: fix a bug in byte scatter write.
> 
> In uniform mode, we should set simd width to 1 and set noMask bit.
> 
> Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
> ---
>  backend/src/backend/gen_insn_selection.cpp | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/backend/src/backend/gen_insn_selection.cpp
> b/backend/src/backend/gen_insn_selection.cpp
> index 2c5e9a1..4a7cca5 100644
> --- a/backend/src/backend/gen_insn_selection.cpp
> +++ b/backend/src/backend/gen_insn_selection.cpp
> @@ -3466,11 +3466,17 @@ namespace gbe
>          const GenRegister value = sel.selReg(insn.getValue(0));
>          GBE_ASSERT(insn.getValueNum() == 1);
>          const GenRegister tmp = sel.selReg(sel.reg(FAMILY_DWORD, isUniform),
> ir::TYPE_U32);
> -        if (elemSize == GEN_BYTE_SCATTER_WORD) {
> -          sel.MOV(tmp, GenRegister::retype(value, GEN_TYPE_UW));
> -        } else if (elemSize == GEN_BYTE_SCATTER_BYTE) {
> -          sel.MOV(tmp, GenRegister::retype(value, GEN_TYPE_UB));
> -        }
> +        sel.push();
> +          if (isUniform) {
> +            sel.curr.noMask = 1;
> +            sel.curr.execWidth = 1;
> +          }
> +
> +          if (elemSize == GEN_BYTE_SCATTER_WORD)
> +            sel.MOV(tmp, GenRegister::retype(value, GEN_TYPE_UW));
> +          else if (elemSize == GEN_BYTE_SCATTER_BYTE)
> +            sel.MOV(tmp, GenRegister::retype(value, GEN_TYPE_UB));
> +        sel.pop();
>          sel.BYTE_SCATTER(addr, tmp, elemSize, bti);
>        }
>      }
> --
> 1.9.1
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list