GEN6_SFID_DATAPORT_SAMPLER_CACHE = 4,
GEN6_SFID_DATAPORT_RENDER_CACHE = 5,
GEN6_SFID_DATAPORT_CONSTANT_CACHE = 9,
- GEN_SFID_DATAPORT_DATA_CACHE = 10,
+ GEN_SFID_DATAPORT_DATA_CACHE = 10,
+ GEN_SFID_DATAPORT1_DATA_CACHE = 12,
};
#define GEN_PREDICATE_NONE 0
#define GEN_BYTE_SCATTER_SIMD8 0
#define GEN_BYTE_SCATTER_SIMD16 1
-/* Data port message type*/
-#define GEN_OBLOCK_READ 0 //0000: OWord Block Read
-#define GEN_UNALIGNED_OBLOCK_READ 1 //0001: Unaligned OWord Block Read
-#define GEN_ODBLOCK_READ 2 //0010: OWord Dual Block Read
-#define GEN_DWORD_GATHER 3 //0011: DWord Scattered Read
-#define GEN_BYTE_GATHER 4 //0100: Byte Scattered Read
-#define GEN_UNTYPED_READ 5 //0101: Untyped Surface Read
-#define GEN_UNTYPED_ATOMIC_READ 6 //0110: Untyped Atomic Operation
-#define GEN_MEMORY_FENCE 7 //0111: Memory Fence
-#define GEN_OBLOCK_WRITE 8 //1000: OWord Block Write
-#define GEN_ODBLOCK_WRITE 10//1010: OWord Dual Block Write
-#define GEN_DWORD_SCATTER 11//1011: DWord Scattered Write
-#define GEN_BYTE_SCATTER 12//1100: Byte Scattered Write
-#define GEN_UNTYPED_WRITE 13//1101: Untyped Surface Write
+/* Data port message type for gen7*/
+#define GEN7_OBLOCK_READ 0 //0000: OWord Block Read
+#define GEN7_UNALIGNED_OBLOCK_READ 1 //0001: Unaligned OWord Block Read
+#define GEN7_ODBLOCK_READ 2 //0010: OWord Dual Block Read
+#define GEN7_DWORD_GATHER 3 //0011: DWord Scattered Read
+#define GEN7_BYTE_GATHER 4 //0100: Byte Scattered Read
+#define GEN7_UNTYPED_READ 5 //0101: Untyped Surface Read
+#define GEN7_UNTYPED_ATOMIC_READ 6 //0110: Untyped Atomic Operation
+#define GEN7_MEMORY_FENCE 7 //0111: Memory Fence
+#define GEN7_OBLOCK_WRITE 8 //1000: OWord Block Write
+#define GEN7_ODBLOCK_WRITE 10//1010: OWord Dual Block Write
+#define GEN7_DWORD_SCATTER 11//1011: DWord Scattered Write
+#define GEN7_BYTE_SCATTER 12//1100: Byte Scattered Write
+#define GEN7_UNTYPED_WRITE 13//1101: Untyped Surface Write
+
+/* Data port0 message type for Gen75*/
+#define GEN75_P0_OBLOCK_READ 0 //0000: OWord Block Read
+#define GEN75_P0_UNALIGNED_OBLOCK_READ 1 //0001: Unaligned OWord Block Read
+#define GEN75_P0_ODBLOCK_READ 2 //0010: OWord Dual Block Read
+#define GEN75_P0_DWORD_GATHER 3 //0011: DWord Scattered Read
+#define GEN75_P0_BYTE_GATHER 4 //0100: Byte Scattered Read
+#define GEN75_P0_MEMORY_FENCE 7 //0111: Memory Fence
+#define GEN75_P0_OBLOCK_WRITE 8 //1000: OWord Block Write
+#define GEN75_P0_ODBLOCK_WRITE 10 //1010: OWord Dual Block Write
+#define GEN75_P0_DWORD_SCATTER 11 //1011: DWord Scattered Write
+#define GEN75_P0_BYTE_SCATTER 12 //1100: Byte Scattered Write
+
+/* Data port1 message type for Gen75*/
+#define GEN75_P1_UNTYPED_READ 1 //0001: Untyped Surface Read
+#define GEN75_P1_UNTYPED_ATOMIC_OP 2 //0010: Untyped Atomic Operation
+#define GEN75_P1_UNTYPED_ATOMIC_OP_4X2 3 //0011: Untyped Atomic Operation SIMD4x2
+#define GEN75_P1_MEDIA_BREAD 4 //0100: Media Block Read
+#define GEN75_P1_TYPED_SURFACE_READ 5 //0101: Typed Surface Read
+#define GEN75_P1_TYPED_ATOMIC_OP 6 //0110: Typed Atomic Operation
+#define GEN75_P1_TYPED_ATOMIC_OP_4X2 7 //0111: Typed Atomic Operation SIMD4x2
+#define GEN75_P1_UNTYPED_SURFACE_WRITE 9 //1001: Untyped Surface Write
+#define GEN75_P1_MEDIA_TYPED_BWRITE 10 //1010: Media Block Write
+#define GEN75_P1_ATOMIC_COUNTER 11 //1011: Atomic Counter Operation
+#define GEN75_P1_ATOMIC_COUNTER_4X2 12 //1100: Atomic Counter Operation 4X2
+#define GEN75_P1_TYPED_SURFACE_WRITE 13 //1101: Typed Surface Write
/* Data port data cache scratch messages*/
#define GEN_SCRATCH_READ 0
struct {
uint32_t bti:8;
uint32_t chan_mask:4;
- uint32_t pad:1;
- uint32_t slot:1;
+ uint32_t slot:2;
uint32_t msg_type:4;
uint32_t pad2:1;
uint32_t header_present:1;
return false;
}
- static void setMessageDescriptor(GenEncoder *p,
- GenNativeInstruction *inst,
- enum GenMessageTarget sfid,
- unsigned msg_length,
- unsigned response_length,
- bool header_present = false,
- bool end_of_thread = false)
+
+ void GenEncoder::setMessageDescriptor(GenNativeInstruction *inst, enum GenMessageTarget sfid,
+ unsigned msg_length, unsigned response_length,
+ bool header_present, bool end_of_thread)
{
- p->setSrc1(inst, GenRegister::immd(0));
+ setSrc1(inst, GenRegister::immd(0));
inst->bits3.generic_gen5.header_present = header_present;
inst->bits3.generic_gen5.response_length = response_length;
inst->bits3.generic_gen5.msg_length = msg_length;
inst->header.destreg_or_condmod = sfid;
}
- static void setDPUntypedRW(GenEncoder *p,
- GenNativeInstruction *insn,
- uint32_t bti,
- uint32_t rgba,
- uint32_t msg_type,
- uint32_t msg_length,
- uint32_t response_length)
+ void GenEncoder::setTypedWriteMessage(GenNativeInstruction *insn, unsigned char bti,
+ unsigned char msg_type, uint32_t msg_length,
+ bool header_present)
+ {
+ const GenMessageTarget sfid = GEN6_SFID_DATAPORT_RENDER_CACHE;
+ setMessageDescriptor(insn, sfid, msg_length, 0, header_present);
+ insn->bits3.gen7_typed_rw.bti = bti;
+ insn->bits3.gen7_typed_rw.msg_type = msg_type;
+ }
+
+ void GenEncoder::setDPUntypedRW(GenNativeInstruction *insn, uint32_t bti,
+ uint32_t rgba, uint32_t msg_type,
+ uint32_t msg_length, uint32_t response_length)
{
const GenMessageTarget sfid = GEN_SFID_DATAPORT_DATA_CACHE;
- setMessageDescriptor(p, insn, sfid, msg_length, response_length);
+ setMessageDescriptor(insn, sfid, msg_length, response_length);
insn->bits3.gen7_untyped_rw.msg_type = msg_type;
insn->bits3.gen7_untyped_rw.bti = bti;
insn->bits3.gen7_untyped_rw.rgba = rgba;
- if (p->curr.execWidth == 8)
+ if (curr.execWidth == 8)
insn->bits3.gen7_untyped_rw.simd_mode = GEN_UNTYPED_SIMD8;
- else if (p->curr.execWidth == 16)
+ else if (curr.execWidth == 16)
insn->bits3.gen7_untyped_rw.simd_mode = GEN_UNTYPED_SIMD16;
else
NOT_SUPPORTED;
uint32_t response_length)
{
const GenMessageTarget sfid = GEN_SFID_DATAPORT_DATA_CACHE;
- setMessageDescriptor(p, insn, sfid, msg_length, response_length);
+ p->setMessageDescriptor(insn, sfid, msg_length, response_length);
insn->bits3.gen7_byte_rw.msg_type = msg_type;
insn->bits3.gen7_byte_rw.bti = bti;
insn->bits3.gen7_byte_rw.data_size = elem_size;
uint32_t response_length)
{
const GenMessageTarget sfid = GEN_SFID_DATAPORT_DATA_CACHE;
- setMessageDescriptor(p, insn, sfid, msg_length, response_length);
+ p->setMessageDescriptor(insn, sfid, msg_length, response_length);
assert(size == 2 || size == 4);
insn->bits3.gen7_oblock_rw.msg_type = msg_type;
insn->bits3.gen7_oblock_rw.bti = bti;
uint32_t return_format)
{
const GenMessageTarget sfid = GEN_SFID_SAMPLER;
- setMessageDescriptor(p, insn, sfid, msg_length, response_length);
+ p->setMessageDescriptor(insn, sfid, msg_length, response_length);
insn->bits3.sampler_gen7.bti = bti;
insn->bits3.sampler_gen7.sampler = sampler;
insn->bits3.sampler_gen7.msg_type = msg_type;
insn->bits3.sampler_gen7.simd_mode = simd_mode;
}
-
- static void setTypedWriteMessage(GenEncoder *p,
- GenNativeInstruction *insn,
- unsigned char bti,
- unsigned char msg_type,
- uint32_t msg_length,
- bool header_present)
- {
- const GenMessageTarget sfid = GEN6_SFID_DATAPORT_RENDER_CACHE;
- setMessageDescriptor(p, insn, sfid, msg_length, 0, header_present);
- insn->bits3.gen7_typed_rw.bti = bti;
- insn->bits3.gen7_typed_rw.msg_type = msg_type;
- }
static void setDWordScatterMessgae(GenEncoder *p,
GenNativeInstruction *insn,
uint32_t bti,
// We workaround it to use DATA CACHE instead.
const GenMessageTarget sfid = (p->deviceID == PCI_CHIP_BAYTRAIL_T) ?
GEN_SFID_DATAPORT_DATA_CACHE : GEN6_SFID_DATAPORT_CONSTANT_CACHE;
- setMessageDescriptor(p, insn, sfid, msg_length, response_length);
+ p->setMessageDescriptor(insn, sfid, msg_length, response_length);
insn->bits3.gen7_dword_rw.msg_type = msg_type;
insn->bits3.gen7_dword_rw.bti = bti;
insn->bits3.gen7_dword_rw.block_size = block_size;
this->setDst(insn, GenRegister::uw16grf(dst.nr, 0));
this->setSrc0(insn, GenRegister::ud8grf(src.nr, 0));
this->setSrc1(insn, GenRegister::immud(0));
- setDPUntypedRW(this,
- insn,
+ setDPUntypedRW(insn,
bti,
untypedRWMask[elemNum],
- GEN_UNTYPED_READ,
+ GEN7_UNTYPED_READ,
msg_length,
response_length);
}
NOT_IMPLEMENTED;
this->setSrc0(insn, GenRegister::ud8grf(msg.nr, 0));
this->setSrc1(insn, GenRegister::immud(0));
- setDPUntypedRW(this,
- insn,
+ setDPUntypedRW(insn,
bti,
untypedRWMask[elemNum],
- GEN_UNTYPED_WRITE,
+ GEN7_UNTYPED_WRITE,
msg_length,
response_length);
}
insn,
bti,
elemSize,
- GEN_BYTE_GATHER,
+ GEN7_BYTE_GATHER,
msg_length,
response_length);
}
insn,
bti,
elemSize,
- GEN_BYTE_SCATTER,
+ GEN7_BYTE_SCATTER,
msg_length,
response_length);
}
insn,
bti,
block_size,
- GEN_DWORD_GATHER,
+ GEN7_DWORD_GATHER,
msg_length,
response_length);
this->setSrc1(insn, GenRegister::immud(0));
const GenMessageTarget sfid = GEN_SFID_DATAPORT_DATA_CACHE;
- setMessageDescriptor(this, insn, sfid, msg_length, response_length);
- insn->bits3.gen7_atomic_op.msg_type = GEN_UNTYPED_ATOMIC_READ;
+ setMessageDescriptor(insn, sfid, msg_length, response_length);
+ insn->bits3.gen7_atomic_op.msg_type = GEN7_UNTYPED_ATOMIC_READ;
insn->bits3.gen7_atomic_op.bti = bti;
insn->bits3.gen7_atomic_op.return_data = 1;
insn->bits3.gen7_atomic_op.aop_type = function;
this->setHeader(insn);
this->setDst(insn, GenRegister::null());
this->setSrc0(insn, src);
- setMessageDescriptor(this, insn, GEN_SFID_MESSAGE_GATEWAY, 1, 0);
+ setMessageDescriptor(insn, GEN_SFID_MESSAGE_GATEWAY, 1, 0);
insn->bits3.msg_gateway.sub_function_id = GEN_BARRIER_MSG;
insn->bits3.msg_gateway.notify = 0x1;
}
this->setHeader(insn);
this->setDst(insn, dst);
this->setSrc0(insn, dst);
- setMessageDescriptor(this, insn, GEN_SFID_DATAPORT_DATA_CACHE, 1, 1, 1);
+ setMessageDescriptor(insn, GEN_SFID_DATAPORT_DATA_CACHE, 1, 1, 1);
insn->bits3.gen7_memory_fence.msg_type = GEN_MEM_FENCE;
insn->bits3.gen7_memory_fence.commit_enable = 0x1;
}
this->setHeader(insn);
this->setDst(insn, GenRegister::retype(GenRegister::null(), GEN_TYPE_UD));
this->setSrc0(insn, msg);
- setTypedWriteMessage(this, insn, bti, msg_type, msg_length, header_present);
+ setTypedWriteMessage(insn, bti, msg_type, msg_length, header_present);
}
static void setScratchMessage(GenEncoder *p,
GenNativeInstruction *insn,
uint32_t response_length)
{
const GenMessageTarget sfid = GEN_SFID_DATAPORT_DATA_CACHE;
- setMessageDescriptor(p, insn, sfid, msg_length, response_length, true);
+ p->setMessageDescriptor(insn, sfid, msg_length, response_length, true);
insn->bits3.gen7_scratch_rw.block_size = block_size;
insn->bits3.gen7_scratch_rw.msg_type = msg_type;
insn->bits3.gen7_scratch_rw.channel_mode = channel_mode;