[02/15] Backend: enable to choose notification register

Submitted by Pan Xiuli on Jan. 21, 2016, 6:51 a.m.

Details

Message ID 1453359115-28123-3-git-send-email-xiuli.pan@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 2 ) in Beignet

Not browsing as part of any series.

Commit Message

Pan Xiuli Jan. 21, 2016, 6:51 a.m.
There are 3 notification can be used by wait, so we
should be able to choose which one we'd like to use.
Also the 3 reg is n0.0 n0.1 and n0.2 so also change
the function name.

Signed-off-by: Pan Xiuli <xiuli.pan@intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
---
 backend/src/backend/gen_encoder.cpp  | 4 ++--
 backend/src/backend/gen_encoder.hpp  | 2 +-
 backend/src/backend/gen_register.hpp | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/backend/src/backend/gen_encoder.cpp b/backend/src/backend/gen_encoder.cpp
index 3f2fdbf..227a5cf 100644
--- a/backend/src/backend/gen_encoder.cpp
+++ b/backend/src/backend/gen_encoder.cpp
@@ -1089,9 +1089,9 @@  namespace gbe
     this->setSrc1(insn, src1);
   }
 
-  void GenEncoder::WAIT(void) {
+  void GenEncoder::WAIT(uint32_t n) {
      GenNativeInstruction *insn = this->next(GEN_OPCODE_WAIT);
-     GenRegister src = GenRegister::notification1();
+     GenRegister src = GenRegister::notification0(n);
      this->setDst(insn, GenRegister::null());
      this->setSrc0(insn, src);
      this->setSrc1(insn, GenRegister::null());
diff --git a/backend/src/backend/gen_encoder.hpp b/backend/src/backend/gen_encoder.hpp
index fb478d2..973c19a 100644
--- a/backend/src/backend/gen_encoder.hpp
+++ b/backend/src/backend/gen_encoder.hpp
@@ -165,7 +165,7 @@  namespace gbe
     /*! No-op */
     void NOP(void);
     /*! Wait instruction (used for the barrier) */
-    void WAIT(void);
+    void WAIT(uint32_t n = 0);
     /*! Atomic instructions */
     virtual void ATOMIC(GenRegister dst, uint32_t function, GenRegister src, GenRegister bti, uint32_t srcNum);
     /*! AtomicA64 instructions */
diff --git a/backend/src/backend/gen_register.hpp b/backend/src/backend/gen_register.hpp
index 2ae6cf1..eb04ac6 100644
--- a/backend/src/backend/gen_register.hpp
+++ b/backend/src/backend/gen_register.hpp
@@ -824,10 +824,10 @@  namespace gbe
                          GEN_HORIZONTAL_STRIDE_0);
     }
 
-    static INLINE GenRegister notification1(void) {
+    static INLINE GenRegister notification0(uint32_t subnr) {
       return GenRegister(GEN_ARCHITECTURE_REGISTER_FILE,
                          GEN_ARF_NOTIFICATION_COUNT,
-                         0,
+                         subnr,
                          GEN_TYPE_UD,
                          GEN_VERTICAL_STRIDE_0,
                          GEN_WIDTH_1,