summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuiling Song <ruiling.song@intel.com>2016-07-07 15:18:08 +0800
committerYang Rong <rong.r.yang@intel.com>2016-07-20 17:35:27 +0800
commit33f5a328e36a1dc9826dc1c1695053fd863ff397 (patch)
tree71a4f2db37f82ae1f80046c082f1be3287ca7016
parentb1e2beb76840a00eda948dec174ae0d5fea90ad5 (diff)
downloadbeignet-33f5a328e36a1dc9826dc1c1695053fd863ff397.tar.gz
GBE: handle mad with execution width of one.
This could fix below opencv case failure under non-strict mode: ./opencv_test_video --gtest_filter=OCL_Video/PyrLKOpticalFlow* Signed-off-by: Ruiling Song <ruiling.song@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r--backend/src/backend/gen7_encoder.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/backend/src/backend/gen7_encoder.cpp b/backend/src/backend/gen7_encoder.cpp
index abb8b77f..4f354913 100644
--- a/backend/src/backend/gen7_encoder.cpp
+++ b/backend/src/backend/gen7_encoder.cpp
@@ -175,6 +175,16 @@ namespace gbe
{
GenNativeInstruction *insn = this->next(opcode);
Gen7NativeInstruction *gen7_insn = &insn->gen7_insn;
+ int execution_size = 0;
+ if (this->curr.execWidth == 1) {
+ execution_size = GEN_WIDTH_1;
+ } else if (this->curr.execWidth == 8) {
+ execution_size = GEN_WIDTH_8;
+ } else if (this->curr.execWidth == 16) {
+ // Gen7 does not support SIMD16 alu3, still need to use SIMD8
+ execution_size = GEN_WIDTH_8;
+ } else
+ NOT_IMPLEMENTED;
assert(dest.file == GEN_GENERAL_REGISTER_FILE);
assert(dest.nr < 128);
@@ -182,11 +192,11 @@ namespace gbe
assert(dest.type = GEN_TYPE_F);
gen7_insn->bits1.da3src.dest_reg_file = 0;
gen7_insn->bits1.da3src.dest_reg_nr = dest.nr;
- gen7_insn->bits1.da3src.dest_subreg_nr = dest.subnr / 16;
+ gen7_insn->bits1.da3src.dest_subreg_nr = dest.subnr / 4;
gen7_insn->bits1.da3src.dest_writemask = 0xf;
this->setHeader(insn);
gen7_insn->header.access_mode = GEN_ALIGN_16;
- gen7_insn->header.execution_size = GEN_WIDTH_8;
+ gen7_insn->header.execution_size = execution_size;
assert(src0.file == GEN_GENERAL_REGISTER_FILE);
assert(src0.address_mode == GEN_ADDRESS_DIRECT);