[Beignet] [Patch V2] Fix a upsample regression.
Zhigang Gong
zhigang.gong at linux.intel.com
Thu Oct 16 00:10:55 PDT 2014
Use upacked_uw with physical nr and subnr seems not good. Could we push these
operations into instruction selection stage and do the unpacked_uw with virtual
register rather than physical register number?
On Thu, Oct 16, 2014 at 03:51:22PM +0800, Yang Rong wrote:
> Should check hstride when unpack.
>
> V2: Fix a typo.
> Signed-off-by: Yang Rong <rong.r.yang at intel.com>
> ---
> backend/src/backend/gen_encoder.cpp | 34 ++++++++++++++++++++++++++++------
> 1 file changed, 28 insertions(+), 6 deletions(-)
>
> diff --git a/backend/src/backend/gen_encoder.cpp b/backend/src/backend/gen_encoder.cpp
> index 847ab7b..2402a2b 100644
> --- a/backend/src/backend/gen_encoder.cpp
> +++ b/backend/src/backend/gen_encoder.cpp
> @@ -613,18 +613,40 @@ namespace gbe
> }
>
> void GenEncoder::UPSAMPLE_SHORT(GenRegister dest, GenRegister src0, GenRegister src1) {
> - dest = GenRegister::retype(GenRegister::unpacked_uw(dest.nr, dest.subnr), GEN_TYPE_B);
> - src0 = GenRegister::retype(GenRegister::unpacked_uw(src0.nr, src0.subnr), GEN_TYPE_B);
> - src1 = GenRegister::retype(GenRegister::unpacked_uw(src1.nr, src1.subnr), GEN_TYPE_B);
> + if(GenRegister::hstride_size(dest) == 0)
> + dest = GenRegister::retype(dest, GEN_TYPE_B);
> + else
> + dest = GenRegister::retype(GenRegister::unpacked_uw(dest.nr, dest.subnr), GEN_TYPE_B);
> +
> + if(GenRegister::hstride_size(src0) == 0)
> + src0 = GenRegister::retype(src0, GEN_TYPE_B);
> + else
> + src0 = GenRegister::retype(GenRegister::unpacked_uw(src0.nr, src0.subnr), GEN_TYPE_B);
> +
> + if(GenRegister::hstride_size(src1) == 0)
> + src1 = GenRegister::retype(src1, GEN_TYPE_B);
> + else
> + src1 = GenRegister::retype(GenRegister::unpacked_uw(src1.nr, src1.subnr), GEN_TYPE_B);
> MOV(dest, src1);
> dest.subnr ++;
> MOV(dest, src0);
> }
>
> void GenEncoder::UPSAMPLE_INT(GenRegister dest, GenRegister src0, GenRegister src1) {
> - dest = GenRegister::unpacked_uw(dest.nr, dest.subnr);
> - src0 = GenRegister::unpacked_uw(src0.nr, src0.subnr);
> - src1 = GenRegister::unpacked_uw(src1.nr, src1.subnr);
> + if(GenRegister::hstride_size(dest) == 0)
> + dest = GenRegister::retype(dest, GEN_TYPE_W);
> + else
> + dest = GenRegister::unpacked_uw(dest.nr, dest.subnr);
> +
> + if(GenRegister::hstride_size(src0) == 0)
> + src0 = GenRegister::retype(src0, GEN_TYPE_W);
> + else
> + src0 = GenRegister::unpacked_uw(src0.nr, src0.subnr);
> +
> + if(GenRegister::hstride_size(src1) == 0)
> + src1 = GenRegister::retype(src1, GEN_TYPE_W);
> + else
> + src1 = GenRegister::unpacked_uw(src1.nr, src1.subnr);
> MOV(dest, src1);
> dest.subnr += 2;
> MOV(dest, src0);
> --
> 1.8.3.2
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list