[06/13] Add forward message function for gen encoder.

Submitted by junyan.he@inbox.com on Dec. 1, 2015, 8:10 a.m.

Details

Message ID 1448957440-3391-6-git-send-email-junyan.he@inbox.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Beignet

Not browsing as part of any series.

Commit Message

junyan.he@inbox.com Dec. 1, 2015, 8:10 a.m.
From: Junyan He <junyan.he@linux.intel.com>

Signed-off-by: Junyan He <junyan.he@linux.intel.com>
---
 backend/src/backend/gen_encoder.cpp |   12 ++++++++++++
 backend/src/backend/gen_encoder.hpp |    2 ++
 2 files changed, 14 insertions(+)

Patch hide | download patch | download mbox

diff --git a/backend/src/backend/gen_encoder.cpp b/backend/src/backend/gen_encoder.cpp
index 7c4357a..505f72a 100644
--- a/backend/src/backend/gen_encoder.cpp
+++ b/backend/src/backend/gen_encoder.cpp
@@ -849,6 +849,18 @@  namespace gbe
      insn->bits3.msg_gateway.sub_function_id = GEN_BARRIER_MSG;
      insn->bits3.msg_gateway.notify = 0x1;
   }
+
+  void GenEncoder::FWD_GATEWAY_MSG(GenRegister src, uint32_t notifyN) {
+     GenNativeInstruction *insn = this->next(GEN_OPCODE_SEND);
+     this->setHeader(insn);
+     this->setDst(insn, GenRegister::null());
+     this->setSrc0(insn, src);
+     setMessageDescriptor(insn, GEN_SFID_MESSAGE_GATEWAY, 1, 0);
+     insn->bits3.msg_gateway.sub_function_id = GEN_FORWARD_MSG;
+     GBE_ASSERT(notifyN <= 2);
+     insn->bits3.msg_gateway.notify = notifyN;
+  }
+
   void GenEncoder::FENCE(GenRegister dst) {
     GenNativeInstruction *insn = this->next(GEN_OPCODE_SEND);
     this->setHeader(insn);
diff --git a/backend/src/backend/gen_encoder.hpp b/backend/src/backend/gen_encoder.hpp
index e4f5ff4..6835196 100644
--- a/backend/src/backend/gen_encoder.hpp
+++ b/backend/src/backend/gen_encoder.hpp
@@ -137,6 +137,8 @@  namespace gbe
     virtual void LOAD_INT64_IMM(GenRegister dest, GenRegister value);
     /*! Barrier message (to synchronize threads of a workgroup) */
     void BARRIER(GenRegister src);
+    /*! Forward the gateway message. */
+    void FWD_GATEWAY_MSG(GenRegister src, uint32_t notifyN = 0);
     /*! Memory fence message (to order loads and stores between threads) */
     void FENCE(GenRegister dst);
     /*! Jump indexed instruction */