[Beignet] [PATCH] Backend: Refine block_read buffer with unaligned OWord block read

Yang, Rong R rong.r.yang at intel.com
Wed Aug 31 06:43:18 UTC 2016


Maybe aligned OWord block read's performance is better than unaligned, but because there is no way to check the address is OWord aligned or not in the compiler, and will introduce the other overhead if check in the runtime, so use unaligned OWord block read is OK to me.

Will push it later.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Xiuli Pan
> Sent: Thursday, August 18, 2016 12:57
> To: beignet at lists.freedesktop.org
> Cc: Pan, Xiuli <xiuli.pan at intel.com>
> Subject: [Beignet] [PATCH] Backend: Refine block_read buffer with
> unaligned OWord block read
> 
> From: Pan Xiuli <xiuli.pan at intel.com>
> 
> Block read buffer may have address that is unaligned to OWord, using
> unaligned OWord block read to refine block read buffer.
> 
> Signed-off-by: Pan Xiuli <xiuli.pan at intel.com>
> ---
>  backend/src/backend/gen_context.cpp | 6 +++---
> backend/src/backend/gen_encoder.cpp | 2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/backend/src/backend/gen_context.cpp
> b/backend/src/backend/gen_context.cpp
> index b429ec3..34d74cd 100644
> --- a/backend/src/backend/gen_context.cpp
> +++ b/backend/src/backend/gen_context.cpp
> @@ -3507,7 +3507,7 @@ namespace gbe
> 
>        // Update the header with the current address
>        p->curr.execWidth = 1;
> -      p->SHR(headeraddr, addr, GenRegister::immud(4));
> +      p->MOV(headeraddr, addr);
> 
>        // Put zero in the general state base address
>        p->MOV(GenRegister::offset(header, 0, 5 * 4), GenRegister::immud(0));
> @@ -3540,7 +3540,7 @@ namespace gbe
>              {
>                // Update the address in header
>                p->curr.execWidth = 1;
> -              p->ADD(headeraddr, headeraddr, GenRegister::immud(8));
> +              p->ADD(headeraddr, headeraddr, GenRegister::immud(128));
>              }
>              p->pop();
>            }
> @@ -3561,7 +3561,7 @@ namespace gbe
>              {
>                // Update the address in header
>                p->curr.execWidth = 1;
> -              p->ADD(headeraddr, headeraddr, GenRegister::immud(8));
> +              p->ADD(headeraddr, headeraddr, GenRegister::immud(128));
>              }
>              p->pop();
>            }
> diff --git a/backend/src/backend/gen_encoder.cpp
> b/backend/src/backend/gen_encoder.cpp
> index f8c99b2..975e1c7 100644
> --- a/backend/src/backend/gen_encoder.cpp
> +++ b/backend/src/backend/gen_encoder.cpp
> @@ -1270,7 +1270,7 @@ namespace gbe
>                  insn,
>                  bti,
>                  size,
> -                GEN7_OBLOCK_READ,
> +                GEN7_UNALIGNED_OBLOCK_READ,
>                  msg_length,
>                  response_length);
>    }
> --
> 2.7.4
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list