summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunyan He <junyan.he@linux.intel.com>2015-12-01 16:10:33 +0800
committerYang Rong <rong.r.yang@intel.com>2015-12-14 15:11:38 +0800
commit04c8ce5330986a8c914f5b0e46faa2be4416eb1f (patch)
treef622756ab94caaa837997e4670d89cfd1d0e415b
parentccf24abc85fe1add43ea85299e80021b8852e896 (diff)
Add forward message function for gen encoder.
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r--backend/src/backend/gen_encoder.cpp12
-rw-r--r--backend/src/backend/gen_encoder.hpp2
2 files changed, 14 insertions, 0 deletions
diff --git a/backend/src/backend/gen_encoder.cpp b/backend/src/backend/gen_encoder.cpp
index d8eedb80..9f9e420d 100644
--- a/backend/src/backend/gen_encoder.cpp
+++ b/backend/src/backend/gen_encoder.cpp
@@ -863,6 +863,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 8cc0e4d1..02392930 100644
--- a/backend/src/backend/gen_encoder.hpp
+++ b/backend/src/backend/gen_encoder.hpp
@@ -141,6 +141,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 */