[Beignet] [PATCH 05/27] Add the long unpacked ud uw into the instruction schedule consideration

junyan.he at inbox.com junyan.he at inbox.com
Tue Jan 6 02:00:29 PST 2015


From: Junyan He <junyan.he at linux.intel.com>

Besides long and double, unpacked ud for long <8,4:2> and
unpacked uw for long <16,4:4> can also stride several registers.
We need to add the second half into the dependency when doing
instruction schedule.

Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
 backend/src/backend/gen_insn_scheduling.cpp | 6 +++---
 backend/src/backend/gen_register.hpp        | 9 +++++++++
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/backend/src/backend/gen_insn_scheduling.cpp b/backend/src/backend/gen_insn_scheduling.cpp
index 5538a74..a0a2594 100644
--- a/backend/src/backend/gen_insn_scheduling.cpp
+++ b/backend/src/backend/gen_insn_scheduling.cpp
@@ -256,7 +256,7 @@ namespace gbe
     if (this->ignoreDependency(reg) == false) {
       const uint32_t index = this->getIndex(reg);
       this->addDependency(node0, index, m);
-      if (scheduler.policy == POST_ALLOC && (reg.isdf() || reg.isint64()))
+      if (scheduler.policy == POST_ALLOC && (reg.isdf() || reg.isint64() || reg.is_unpacked_long()))
         this->addDependency(node0, index + 1, m);
     }
   }
@@ -265,7 +265,7 @@ namespace gbe
     if (this->ignoreDependency(reg) == false) {
       const uint32_t index = this->getIndex(reg);
       this->addDependency(index, node0, m);
-      if (scheduler.policy == POST_ALLOC && (reg.isdf() || reg.isint64()))
+      if (scheduler.policy == POST_ALLOC && (reg.isdf() || reg.isint64() || reg.is_unpacked_long()))
         this->addDependency(index + 1, node0, m);
     }
   }
@@ -367,7 +367,7 @@ namespace gbe
       if (this->ignoreDependency(dst) == false) {
         const uint32_t index = this->getIndex(dst);
         this->nodes[index] = node;
-        if (scheduler.policy == POST_ALLOC && (dst.isdf() || dst.isint64()))
+        if (scheduler.policy == POST_ALLOC && (dst.isdf() || dst.isint64() || dst.is_unpacked_long()))
           this->nodes[index + 1] = node;
       }
     }
diff --git a/backend/src/backend/gen_register.hpp b/backend/src/backend/gen_register.hpp
index 2164ef7..d8a89dd 100644
--- a/backend/src/backend/gen_register.hpp
+++ b/backend/src/backend/gen_register.hpp
@@ -295,6 +295,15 @@ namespace gbe
       return false;
     }
 
+    /* Besides long and double, there are also some cases which can also stride
+       several registers, eg. unpacked ud for long<8,4:2> and unpacked uw for
+       long<16,4:4> */
+    INLINE bool is_unpacked_long(void) const {
+      if (file != GEN_GENERAL_REGISTER_FILE) return false;
+      if (width == GEN_WIDTH_4 && hstride > GEN_HORIZONTAL_STRIDE_1) return true;
+      return false;
+    }
+
     INLINE bool isimmdf(void) const {
       if (type == GEN_TYPE_DF && file == GEN_IMMEDIATE_VALUE)
         return true;
-- 
1.9.1



More information about the Beignet mailing list