[Beignet] [PATCH] Fix a upsample regression.
Yang Rong
rong.r.yang at intel.com
Tue Oct 14 20:06:57 PDT 2014
Should check hstride when unpack.
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..c11c7e7 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_B);
+ else
+ dest = GenRegister::unpacked_uw(dest.nr, dest.subnr);
+
+ if(GenRegister::hstride_size(src0) == 0)
+ src0 = GenRegister::retype(src0, GEN_TYPE_B);
+ else
+ src0 = GenRegister::unpacked_uw(src0.nr, src0.subnr);
+
+ if(GenRegister::hstride_size(src1) == 0)
+ src1 = GenRegister::retype(src1, GEN_TYPE_B);
+ else
+ src1 = GenRegister::unpacked_uw(src1.nr, src1.subnr);
MOV(dest, src1);
dest.subnr += 2;
MOV(dest, src0);
--
1.8.3.2
More information about the Beignet
mailing list