[Beignet] [PATCH 1/3] fix bswap bug.

Yang, Rong R rong.r.yang at intel.com
Mon Sep 7 23:58:13 PDT 2015



> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> xionghu.luo at intel.com
> Sent: Thursday, August 13, 2015 14:28
> To: beignet at lists.freedesktop.org
> Cc: Luo, Xionghu
> Subject: [Beignet] [PATCH 1/3] fix bswap bug.
> 
> From: Luo Xionghu <xionghu.luo at intel.com>
> 
> if the source is uniform and dst is non-uniform, no need to add the indirect
> address index.
> 
> Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
> ---
>  backend/src/backend/gen8_context.cpp | 6 ++++--
> backend/src/backend/gen_context.cpp  | 9 ++++++---
>  2 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/backend/src/backend/gen8_context.cpp
> b/backend/src/backend/gen8_context.cpp
> index b497ee5..eca8eeb 100644
> --- a/backend/src/backend/gen8_context.cpp
> +++ b/backend/src/backend/gen8_context.cpp
> @@ -182,7 +182,8 @@ namespace gbe
>                p->MOV(GenRegister::offset(GenRegister::retype(tmp,
> GEN_TYPE_UB), 0, 16), ind_src);
There is another              ind_src.addr_imm += 16; before this line, also need uniform_src check.


>                if (simd == 16) {
>                  for (int i = 0; i < 2; i++) {
> -                  ind_src.addr_imm += 16;
> +                  if(!uniform_src)
> +                    ind_src.addr_imm += 16;
>                    p->MOV(GenRegister::offset(GenRegister::retype(tmp,
> GEN_TYPE_UB), 1, 16*i), ind_src);
>                  }
>                }
> @@ -237,7 +238,8 @@ namespace gbe
>                GenRegister ind_src =
> GenRegister::to_indirect1xN(GenRegister::retype(src, GEN_TYPE_UB),
> new_a0[0], 0);
>                p->MOV(GenRegister::retype(tmp, GEN_TYPE_UB), ind_src);
>                if (simd == 16) {
> -                ind_src.addr_imm += 16;
> +                if(!uniform_src)
> +                  ind_src.addr_imm += 16;
>                  p->MOV(GenRegister::offset(GenRegister::retype(tmp,
> GEN_TYPE_UB), 0, 16), ind_src);
>                }
>                p->pop();
> diff --git a/backend/src/backend/gen_context.cpp
> b/backend/src/backend/gen_context.cpp
> index e16b0a9..8ee65ee 100644
> --- a/backend/src/backend/gen_context.cpp
> +++ b/backend/src/backend/gen_context.cpp
> @@ -384,12 +384,14 @@ namespace gbe
>              GenRegister ind_src =
> GenRegister::to_indirect1xN(GenRegister::retype(src, GEN_TYPE_UB),
> new_a0[0], 0);
>              p->MOV(GenRegister::retype(tmp, GEN_TYPE_UB), ind_src);
>              for (int i = 1; i < 4; i++) {
> -              ind_src.addr_imm += 8;
> +              if (!uniform_src)
> +                ind_src.addr_imm += 8;
>                p->MOV(GenRegister::offset(GenRegister::retype(tmp,
> GEN_TYPE_UB), 0, 8*i), ind_src);
>              }
>              if (simd == 16) {
>                for (int i = 0; i < 4; i++) {
> -                ind_src.addr_imm += 8;
> +                if (!uniform_src)
> +                  ind_src.addr_imm += 8;
>                  p->MOV(GenRegister::offset(GenRegister::retype(tmp,
> GEN_TYPE_UB), 1, 8*i), ind_src);
>                }
>              }
> @@ -428,7 +430,8 @@ namespace gbe
>              GenRegister ind_src =
> GenRegister::to_indirect1xN(GenRegister::retype(src, GEN_TYPE_UB),
> new_a0[0], 0);
>              p->MOV(GenRegister::retype(tmp, GEN_TYPE_UB), ind_src);
>              for (int i = 1; i < (simd == 8 ? 2 : 4); i++) {
> -              ind_src.addr_imm += 8;
> +              if (!uniform_src)
> +                ind_src.addr_imm += 8;
>                p->MOV(GenRegister::offset(GenRegister::retype(tmp,
> GEN_TYPE_UB), 0, 8*i), ind_src);
>              }
>              p->pop();
> --
> 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