summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 */