Commit d186e522 authored by Chen, Weiyu's avatar Chen, Weiyu

Make SFID a enum class

Change-Id: If571d3d1f915fd598e4d893ce583f2888e237bb6
parent 4be564fa
......@@ -1202,7 +1202,7 @@ public:
unsigned funcCtrl,
unsigned regs2rcv,
unsigned regs2snd,
CISA_SHARED_FUNCTION_ID funcID,
SFID funcID,
bool eot,
unsigned extMsgLength,
uint16_t extFuncCtrl,
......@@ -1674,7 +1674,7 @@ public:
unsigned regs2rcv,
unsigned execsize,
unsigned fc,
CISA_SHARED_FUNCTION_ID tf_id,
SFID tf_id,
bool eot,
bool head_present,
bool isRead,
......@@ -1690,7 +1690,7 @@ public:
unsigned regs2rcv,
unsigned execsize,
unsigned fc, unsigned exFuncCtrl,
CISA_SHARED_FUNCTION_ID tf_id, bool eot,
SFID tf_id, bool eot,
bool head_present,
bool isRead,
bool isWrite,
......
......@@ -131,7 +131,7 @@ G4_SendMsgDescriptor* IR_Builder::createSendMsgDesc(
unsigned funcCtrl,
unsigned regs2rcv,
unsigned regs2snd,
CISA_SHARED_FUNCTION_ID funcID,
SFID funcID,
bool eot,
unsigned extMsgLength,
uint16_t extFuncCtrl,
......@@ -141,7 +141,7 @@ G4_SendMsgDescriptor* IR_Builder::createSendMsgDesc(
G4_Operand *sti)
{
G4_SendMsgDescriptor* msgDesc = new (mem) G4_SendMsgDescriptor(
funcCtrl, regs2rcv, regs2snd, funcID, eot, (uint16_t) extMsgLength,
funcCtrl, regs2rcv, regs2snd, SFIDtoInt(funcID), eot, (uint16_t) extMsgLength,
extFuncCtrl, isRead, isWrite, bti, sti, *this);
return msgDesc;
}
......@@ -724,7 +724,7 @@ G4_InstSend* IR_Builder::Create_Send_Inst_For_CISA(
unsigned regs2rcv,
unsigned execsize,
unsigned fc,
CISA_SHARED_FUNCTION_ID tf_id,
SFID tf_id,
bool eot,
bool header_present,
bool isRead,
......@@ -894,7 +894,7 @@ G4_InstSend* IR_Builder::Create_SplitSend_Inst_For_CISA(
unsigned execsize,
unsigned fc,
unsigned exFuncCtrl,
CISA_SHARED_FUNCTION_ID tf_id,
SFID tf_id,
bool eot,
bool header_present,
bool isRead,
......
......@@ -790,23 +790,36 @@ typedef struct
const char* str;
} CISA_PreDefined_Var_Info;
typedef enum
namespace vISA
{
SFID_NULL = 0,
SFID_SAMPLER = 2,
SFID_GATEWAY = 3,
SFID_DP_DC2 = 4,
SFID_DP_WRITE = 5, //DATAPORT WRITE
SFID_URB = 6, //URB
SFID_SPAWNER = 7, //THREAD SPAWNER
SFID_VME = 8, //VIDEO MOTION ESTIMATION
SFID_DP_CC = 9, //CONSTANT CACHE DATAPORT
SFID_DP_DC = 10, //DATA CACHE DATAPORT
SFID_DP_PI = 11, //PIXEL INTERPOLATOR
SFID_DP_DC1 = 12, //DATA CACHE DATAPORT1
SFID_CRE = 13, //CHECK & REFINEMENT ENGINE
SFID_NUM = 14
} CISA_SHARED_FUNCTION_ID;
enum class SFID
{
NULL_SFID = 0,
SAMPLER = 2,
GATEWAY = 3,
DP_DC2 = 4,
DP_WRITE = 5, //DATAPORT WRITE
URB = 6, //URB
SPAWNER = 7, //THREAD SPAWNER
VME = 8, //VIDEO MOTION ESTIMATION
DP_CC = 9, //CONSTANT CACHE DATAPORT
DP_DC = 10, //DATA CACHE DATAPORT
DP_PI = 11, //PIXEL INTERPOLATOR
DP_DC1 = 12, //DATA CACHE DATAPORT1
CRE = 13, //CHECK & REFINEMENT ENGINE
NUM = 14
};
inline int SFIDtoInt(SFID id)
{
return static_cast<int>(id);
};
inline SFID intToSFID(int id)
{
return static_cast<SFID>(id);
};
};
typedef enum
{
......
......@@ -1114,7 +1114,7 @@ void FlowGraph::handleExit(G4_BB* firstSubroutineBB)
G4_SrcRegRegion* sendMsgOpnd = builder->Create_Src_Opnd_From_Dcl(
builder->getBuiltinR0(),
builder->getRegionStride1());
auto msgDesc = builder->createSendMsgDesc(desc, SFID_SAMPLER, true, true);
auto msgDesc = builder->createSendMsgDesc(desc, SFIDtoInt(SFID::SAMPLER), true, true);
G4_INST* samplerFlushInst = builder->createSendInst(nullptr, G4_send,
8, builder->createNullDst(Type_UD), sendMsgOpnd,
builder->createImm(desc, Type_UD),
......@@ -4062,7 +4062,7 @@ void G4_BB::addEOTSend(G4_INST* lastInst)
}
instList.push_back(movInst);
int exdesc = (0x1 << 5) + SFID_SPAWNER;
int exdesc = (0x1 << 5) + SFIDtoInt(SFID::SPAWNER);
// response len = 0, msg len = 1
int desc = (0x1 << 25) + (0x1 << 4);
......
......@@ -307,9 +307,9 @@ const char* G4_SendMsgDescriptor::getDescType()
switch (msgDesc->getFuncId())
{
case SFID_SAMPLER: return "sampler"; break;
case SFID_GATEWAY: return "gateway"; break;
case SFID_DP_DC2:
case SFID::SAMPLER: return "sampler"; break;
case SFID::GATEWAY: return "gateway"; break;
case SFID::DP_DC2:
switch (bits)
{
case DC2_UNTYPED_SURFACE_READ:
......@@ -331,7 +331,7 @@ const char* G4_SendMsgDescriptor::getDescType()
default:
return "unrecognized message";
}
case SFID_DP_WRITE:
case SFID::DP_WRITE:
switch (bits)
{
case 0xc: return "render target write"; break;
......@@ -339,10 +339,10 @@ const char* G4_SendMsgDescriptor::getDescType()
default: return "reserved encoding used!";
}
break;
case SFID_URB: return "urb"; break;
case SFID_SPAWNER: return "thread spawner"; break;
case SFID_VME: return "vme"; break;
case SFID_DP_CC:
case SFID::URB: return "urb"; break;
case SFID::SPAWNER: return "thread spawner"; break;
case SFID::VME: return "vme"; break;
case SFID::DP_CC:
switch (bits)
{
case 0x0: return "oword block read"; break;
......@@ -352,7 +352,7 @@ const char* G4_SendMsgDescriptor::getDescType()
default: return "reserved encoding used!";
break;
}
case SFID_DP_DC:
case SFID::DP_DC:
category = (msgDesc->getFuncCtrl() >> 18) & 0x1;
if (category == 0)
{
......@@ -385,8 +385,8 @@ const char* G4_SendMsgDescriptor::getDescType()
return "scratch write";
}
break;
case SFID_DP_PI: return "dp_pi"; break;
case SFID_DP_DC1:
case SFID::DP_PI: return "dp_pi"; break;
case SFID::DP_DC1:
switch (bits)
{
case 0x0: return "transpose read"; break;
......@@ -415,7 +415,7 @@ const char* G4_SendMsgDescriptor::getDescType()
default: return "reserved encoding used!";
}
break;
case SFID_CRE: return "cre"; break;
case SFID::CRE: return "cre"; break;
default: return "--";
}
return NULL;
......@@ -423,7 +423,7 @@ const char* G4_SendMsgDescriptor::getDescType()
bool G4_SendMsgDescriptor::isSLMMessage() const
{
if (getFuncId() == SFID_DP_DC2)
if (getFuncId() == SFID::DP_DC2)
{
uint32_t msgType = getMessageType();
if ((msgType == DC2_UNTYPED_SURFACE_WRITE || msgType == DC2_BYTE_SCATTERED_WRITE) &&
......@@ -433,9 +433,9 @@ bool G4_SendMsgDescriptor::isSLMMessage() const
}
}
if (getFuncId() == SFID_DP_DC2 ||
getFuncId() == SFID_DP_DC1 ||
getFuncId() == SFID_DP_DC)
if (getFuncId() == SFID::DP_DC2 ||
getFuncId() == SFID::DP_DC1 ||
getFuncId() == SFID::DP_DC)
{
if ((getDesc() & 0xFF) == 0xFE)
{
......@@ -454,13 +454,13 @@ bool G4_SendMsgDescriptor::isSLMMessage() const
bool G4_SendMsgDescriptor::isReadOnlyMessage(uint32_t msgDesc,
uint32_t extDesc)
{
CISA_SHARED_FUNCTION_ID funcID = G4_SendMsgDescriptor::getFuncId(extDesc);
SFID funcID = G4_SendMsgDescriptor::getFuncId(extDesc);
unsigned subFuncID = G4_SendMsgDescriptor::getMessageType(msgDesc);
switch (funcID) {
default:
break;
case SFID_DP_DC:
case SFID::DP_DC:
switch (subFuncID) {
case DC_OWORD_BLOCK_READ:
case DC_UNALIGNED_OWORD_BLOCK_READ:
......@@ -470,7 +470,7 @@ bool G4_SendMsgDescriptor::isReadOnlyMessage(uint32_t msgDesc,
default:
return false;
}
case SFID_DP_DC1:
case SFID::DP_DC1:
switch (subFuncID) {
case DC1_UNTYPED_SURFACE_READ:
case DC1_MEDIA_BLOCK_READ:
......@@ -482,7 +482,7 @@ bool G4_SendMsgDescriptor::isReadOnlyMessage(uint32_t msgDesc,
default:
return false;
}
case SFID_DP_DC2:
case SFID::DP_DC2:
switch (subFuncID) {
case DC2_UNTYPED_SURFACE_READ:
case DC2_A64_SCATTERED_READ:
......@@ -492,7 +492,7 @@ bool G4_SendMsgDescriptor::isReadOnlyMessage(uint32_t msgDesc,
default:
return false;
}
case SFID_SAMPLER:
case SFID::SAMPLER:
return true;
}
......@@ -3099,12 +3099,12 @@ bool G4_InstSend::isDirectSplittableSend()
{
unsigned short elemSize = dst->getElemSize();
CISA_SHARED_FUNCTION_ID funcID = msgDesc->getFuncId();
SFID funcID = msgDesc->getFuncId();
unsigned subFuncID = msgDesc->getMessageType();
switch (funcID)
{
case SFID_DP_DC1:
case SFID::DP_DC1:
switch (subFuncID)
{
case DC1_A64_SCATTERED_READ: //emask need be vertically cut.
......@@ -3125,7 +3125,7 @@ bool G4_InstSend::isDirectSplittableSend()
default: return false;
}
case SFID_DP_DC2:
case SFID::DP_DC2:
switch (subFuncID)
{
case DC2_UNTYPED_SURFACE_READ: //gather 4 scaled : emask can be reused if the per-channel data is larger than 1 GRF
......@@ -3145,7 +3145,7 @@ bool G4_InstSend::isDirectSplittableSend()
default: return false;
}
case SFID_DP_DC:
case SFID::DP_DC:
switch (subFuncID)
{
case DC_DWORD_SCATTERED_READ: //dword scattered read: emask need be vertically cut according to splitting
......@@ -3156,7 +3156,7 @@ bool G4_InstSend::isDirectSplittableSend()
return true;
default: return false;
}
case SFID_SAMPLER:
case SFID::SAMPLER:
return true;
default: return false;
}
......
......@@ -298,7 +298,7 @@ public:
void *operator new(size_t sz, Mem_Manager &m) { return m.alloc(sz); }
static uint32_t createExtDesc(CISA_SHARED_FUNCTION_ID funcID,
static uint32_t createExtDesc(SFID funcID,
bool isEot = false)
{
return createExtDesc(funcID, isEot, 0, 0);
......@@ -308,7 +308,7 @@ public:
{
ExtDescData data;
data.value = 0;
data.layout.funcID = SFID_DP_WRITE;
data.layout.funcID = SFIDtoInt(SFID::DP_WRITE);
data.layout.RTIndex = RTIndex;
data.layout.src0Alpha = src0Alpha;
data.layout.eot = isEOT;
......@@ -316,14 +316,14 @@ public:
return data.value;
}
static uint32_t createExtDesc(CISA_SHARED_FUNCTION_ID funcID,
static uint32_t createExtDesc(SFID funcID,
bool isEot,
unsigned extMsgLen,
unsigned extFCtrl = 0)
{
ExtDescData data;
data.value = 0;
data.layout.funcID = funcID;
data.layout.funcID = SFIDtoInt(funcID);
data.layout.eot = isEot;
data.layout.extMsgLength = extMsgLen;
data.layout.extFuncCtrl = extFCtrl;
......@@ -341,15 +341,15 @@ public:
return data.value;
}
static CISA_SHARED_FUNCTION_ID getFuncId(uint32_t extDesc)
static SFID getFuncId(uint32_t extDesc)
{
ExtDescData data;
data.value = extDesc;
return static_cast<CISA_SHARED_FUNCTION_ID>(data.layout.funcID);
return intToSFID(data.layout.funcID);
}
CISA_SHARED_FUNCTION_ID getFuncId() const
SFID getFuncId() const
{
return static_cast<CISA_SHARED_FUNCTION_ID>(extDesc.layout.funcID);
return intToSFID(extDesc.layout.funcID);
}
static uint32_t getFuncCtrl(uint32_t msgDesc)
......@@ -385,44 +385,44 @@ public:
bool isScratchRW() const
{
// scratch msg: DC0, bit 18 = 1
return extDesc.layout.funcID == SFID_DP_DC && ((getFuncCtrl() & 0x40000u) != 0);
return getFuncId() == SFID::DP_DC && ((getFuncCtrl() & 0x40000u) != 0);
}
bool isDataPortOperation() const
{
auto funcID = extDesc.layout.funcID;
return funcID == SFID_SAMPLER || funcID == SFID_DP_WRITE ||
funcID == SFID_DP_CC || funcID == SFID_DP_DC ||
funcID == SFID_DP_DC1;
auto funcID = getFuncId();
return funcID == SFID::SAMPLER || funcID == SFID::DP_WRITE ||
funcID == SFID::DP_CC || funcID == SFID::DP_DC ||
funcID == SFID::DP_DC1;
}
bool isDataPortRead() const { return readMsg; }
bool isDataPortWrite() const { return writeMsg; }
bool isSampler() const
{
return getFuncId() == SFID_SAMPLER;
return getFuncId() == SFID::SAMPLER;
}
bool isHDC() const
{
auto funcID = extDesc.layout.funcID;
return funcID == SFID_DP_DC || funcID == SFID_DP_DC1 || funcID == SFID_DP_DC2;
auto funcID = getFuncId();
return funcID == SFID::DP_DC || funcID == SFID::DP_DC1 || funcID == SFID::DP_DC2;
}
bool isThreadMessage() const
{
auto funcID = extDesc.layout.funcID;
return funcID == SFID_GATEWAY || funcID == SFID_SPAWNER;
auto funcID = getFuncId();
return funcID == SFID::GATEWAY || funcID == SFID::SPAWNER;
}
bool conflictsWithWait() const
{
auto funcID = extDesc.layout.funcID;
return isDataPortOperation() || funcID == SFID_GATEWAY ||
funcID == SFID_SPAWNER || funcID == SFID_URB || funcID == SFID_NUM;
auto funcID = getFuncId();
return isDataPortOperation() || funcID == SFID::GATEWAY ||
funcID == SFID::SPAWNER || funcID == SFID::URB;
}
bool isIntAtomicMessage() const
{
auto funcID = extDesc.layout.funcID;
if (funcID != SFID_DP_DC1)
auto funcID = getFuncId();
if (funcID != SFID::DP_DC1)
return false;
uint16_t msgType = getMessageType();
......@@ -440,8 +440,8 @@ public:
bool isFloatAtomicMessage() const
{
auto funcID = extDesc.layout.funcID;
if (funcID != SFID_DP_DC1)
auto funcID = getFuncId();
if (funcID != SFID::DP_DC1)
return false;
uint16_t msgType = getMessageType();
......@@ -476,9 +476,9 @@ public:
bool isBarrierMsg() const
{
auto funcID = extDesc.layout.funcID;
auto funcID = getFuncId();
uint32_t funcCtrl = getFuncCtrl();
return funcID == SFID_GATEWAY && (funcCtrl & 0xFF) == 0x4;
return funcID == SFID::GATEWAY && (funcCtrl & 0xFF) == 0x4;
}
bool isSLMMessage() const;
......@@ -563,10 +563,10 @@ public:
bool isOwordLoad() const
{
uint32_t funcCtrl = getFuncCtrl();
auto funcID = extDesc.layout.funcID;
auto funcID = getFuncId();
uint16_t msgType = ( funcCtrl >> IVB_MSG_TYPE_OFFSET ) & 0xF;
//SFID = data cache, bit 14-17= 0 or 1
return funcID == SFID_DP_DC && ( msgType == 0 || msgType == 1);
return funcID == SFID::DP_DC && ( msgType == 0 || msgType == 1);
}
static bool isReadOnlyMessage(uint32_t msgDesc, uint32_t exDesc);
......@@ -1499,8 +1499,8 @@ public:
bool canBeEOT()
{
bool canEOT = msgDesc->ResponseLength() == 0 &&
(msgDesc->getFuncId() != SFID_NULL &&
msgDesc->getFuncId() != SFID_SAMPLER);
(msgDesc->getFuncId() != SFID::NULL_SFID &&
msgDesc->getFuncId() != SFID::SAMPLER);
return canEOT;
}
......@@ -1508,17 +1508,17 @@ public:
bool isFence() const
{
G4_SendMsgDescriptor *MD = getMsgDesc();
CISA_SHARED_FUNCTION_ID SFID = MD->getFuncId();
SFID sfid = MD->getFuncId();
unsigned FC = MD->getFuncCtrl();
// Memory Fence
if (SFID == SFID_DP_DC && ((FC >> 14) & 0x1F) == DC_MEMORY_FENCE)
if (sfid == SFID::DP_DC && ((FC >> 14) & 0x1F) == DC_MEMORY_FENCE)
{
return true;
}
// Sampler cache flush
if (SFID == SFID_SAMPLER && ((FC >> 12) & 0x1F) == 0x1F)
if (sfid == SFID::SAMPLER && ((FC >> 12) & 0x1F) == 0x1F)
{
return true;
}
......
......@@ -2634,12 +2634,12 @@ bool Augmentation::updateDstMaskForScatter(G4_INST* inst, unsigned char* mask)
curEMBit = NOMASK_BYTE;
}
CISA_SHARED_FUNCTION_ID funcID = msgDesc->getFuncId();
SFID funcID = msgDesc->getFuncId();
unsigned subFuncID = msgDesc->getMessageType();
switch (funcID)
{
case SFID_DP_DC1:
case SFID::DP_DC1:
switch (subFuncID)
{
case DC1_A64_SCATTERED_READ: //a64 scattered read: svm_gather
......@@ -2703,7 +2703,7 @@ bool Augmentation::updateDstMaskForScatter(G4_INST* inst, unsigned char* mask)
default: return false;
}
break;
case SFID_DP_DC2:
case SFID::DP_DC2:
switch (subFuncID)
{
case DC2_UNTYPED_SURFACE_READ: //gather 4 scaled
......@@ -2742,7 +2742,7 @@ bool Augmentation::updateDstMaskForScatter(G4_INST* inst, unsigned char* mask)
default: return false;
}
break;
case SFID_DP_DC:
case SFID::DP_DC:
switch (subFuncID)
{
case DC_DWORD_SCATTERED_READ: //dword scattered read: gather(dword), handled as block read write
......@@ -6538,7 +6538,7 @@ void GraphColor::saveRegs(
auto sendSrc2 = builder.createSrcRegRegion(Mod_src_undef, Direct, msgDcl->getRegVar(), 0, 0,
builder.rgnpool.createRegion(8, 8, 1), Type_UD);
G4_Imm* descImm = gra.createMsgDesc(owordSize, true, true);
uint32_t extDesc = G4_SendMsgDescriptor::createExtDesc(SFID_DP_DC, false, messageLength);
uint32_t extDesc = G4_SendMsgDescriptor::createExtDesc(SFID::DP_DC, false, messageLength);
auto msgDesc = builder.createSendMsgDesc((uint32_t)descImm->getInt(), extDesc, false, true,
getScratchSurface());
auto sendInst = builder.Create_SplitSend_Inst(nullptr, postDst, sendSrc1, sendSrc2, execSize, msgDesc,
......
......@@ -53,10 +53,10 @@ static DepType DoMemoryInterfereSend(G4_InstSend *send1, G4_InstSend *send2, ret
if (target == VISA_3D || target == VISA_CS)
{
// for 3D and compute we can do more precise dependency checks due to API restrictions
CISA_SHARED_FUNCTION_ID funcId1 = send1->getMsgDesc()->getFuncId();
CISA_SHARED_FUNCTION_ID funcId2 = send2->getMsgDesc()->getFuncId();
SFID funcId1 = send1->getMsgDesc()->getFuncId();
SFID funcId2 = send2->getMsgDesc()->getFuncId();
if (funcId1 == SFID_SAMPLER || funcId2 == SFID_SAMPLER)
if (funcId1 == SFID::SAMPLER || funcId2 == SFID::SAMPLER)
{
// sampler acess will never have memory conflict
return NODEP;
......
......@@ -37,7 +37,7 @@ uint16_t LatencyTable::getLatencyLegacy(G4_INST* Inst) const
{
if (Inst->isSend()) {
G4_SendMsgDescriptor* MsgDesc = Inst->getMsgDesc();
return LegacyFFLatency[MsgDesc->getFuncId()];
return LegacyFFLatency[SFIDtoInt(MsgDesc->getFuncId())];
} else if (Inst->isMath()) {
if (Inst->asMathInst()->getMathCtrl() == MATH_FDIV ||
Inst->asMathInst()->getMathCtrl() == MATH_POW)
......
......@@ -1034,7 +1034,7 @@ union DescData {
// leading URB write should have cache-aligned global offset
static bool isLeadingURBWrite(G4_INST* inst)
{
if (inst->isSend() && inst->getMsgDesc()->getFuncId() == SFID_URB)
if (inst->isSend() && inst->getMsgDesc()->getFuncId() == SFID::URB)
{
DescData desc;
desc.value = inst->getMsgDesc()->getDesc();
......@@ -1116,7 +1116,7 @@ void DDD::pairTypedWriteOrURBWriteNodes(G4_BB *bb) {
}
else if (leadingURB)
{
if (inst->isSend() && inst->getMsgDesc()->getFuncId() == SFID_URB)
if (inst->isSend() && inst->getMsgDesc()->getFuncId() == SFID::URB)
{
if (canFuseURB(inst, (*leadingURB->getInstructions()).front()))
{
......@@ -1165,7 +1165,7 @@ void DDD::pairTypedWriteOrURBWriteNodes(G4_BB *bb) {
assert(firstNode->getInstructions()->size() == 1);
firstNode->addPairInstr(*secondNode->getInstructions()->begin());
if (!kernel->fg.builder->getOption(vISA_NoAtomicSend) &&
firstInstr->isSend() && firstInstr->getMsgDesc()->getFuncId() == SFID_URB)
firstInstr->isSend() && firstInstr->getMsgDesc()->getFuncId() == SFID::URB)
{
firstInstr->setOptionOn(InstOpt_Atomic);
}
......
......@@ -5628,7 +5628,7 @@ bool Optimizer::foldPseudoAndOr(G4_BB* bb, INST_LIST_ITER& ii)
*/
G4_SendMsgDescriptor *desc = sendInst->getMsgDesc();
uint32_t descVal = desc->getDesc();
if ((desc->getFuncId() == SFID_GATEWAY) &&
if ((desc->getFuncId() == SFID::GATEWAY) &&
(descVal == (0x1 << 25) + 0x4) && // 0x2000004
(sendInst->def_size() == 1))
{
......@@ -7094,28 +7094,29 @@ private:
}
// Cover instructions that read this bucket
void coverReadIDs(CISA_SHARED_FUNCTION_ID SFID = SFID_NULL) {
void coverReadIDs(SFID sfid = SFID::NULL_SFID) {
// Go through all the instructions that read this instruction.
// Notify the instruction that one of its registers is covered
for (InstrDescr *ID : IDSet) {
assert(ID->instr->isSend());
// Only sends with the same SFID can be covered
if (SFID == SFID_NULL
|| ID->instr->getMsgDesc()->getFuncId() == SFID) {
if (sfid == SFID::NULL_SFID
|| ID->instr->getMsgDesc()->getFuncId() == sfid)
{
ID->coverR(this);
}
}
}
// Cover instructions that write this bucket
void coverWrittenIDs(CISA_SHARED_FUNCTION_ID SFID = SFID_NULL) {
void coverWrittenIDs(SFID sfid = SFID::NULL_SFID) {
// Go through all the instructions that read this instruction.
// Notify the instruction that one of its registers is covered
for (InstrDescr *ID : IDSet) {
assert(ID->instr->isSend());
// Only sends with the same SFID can be covered
if (SFID == SFID_NULL
|| ID->instr->getMsgDesc()->getFuncId() == SFID) {
if (sfid == SFID::NULL_SFID
|| ID->instr->getMsgDesc()->getFuncId() == sfid) {
ID->coverW(this);
}
}
......@@ -7368,10 +7369,11 @@ public:
// Cover the instructions that read the values read by instrBuckets
void coverInstrReadingBucketsReadBy(const BucketDescrBox &instrBuckets,
CISA_SHARED_FUNCTION_ID SFID) {
SFID sfid)
{
for (const auto &BD : instrBuckets.BDVec) {
if (BD.type == READ) {
bucketVec[BD.bucketIdx].coverReadIDs(SFID);
bucketVec[BD.bucketIdx].coverReadIDs(sfid);
}
}
}
......@@ -7750,7 +7752,7 @@ public:
{
uint16_t extFuncCtrl = 0;
// both scratch and block read use DC
CISA_SHARED_FUNCTION_ID funcID = SFID_DP_DC;
SFID funcID = SFID::DP_DC;
uint32_t headerPresent = 0x80000;
uint32_t msgDescImm = headerPresent;
......@@ -8077,7 +8079,7 @@ public:
desc.layout.resLen = 1;
desc.layout.msgLen = 1;
uint32_t extDesc = G4_SendMsgDescriptor::createExtDesc(SFID_DP_DC);
uint32_t extDesc = G4_SendMsgDescriptor::createExtDesc(SFID::DP_DC);
for (auto bb : kernel.fg.BBs)
{
......
......@@ -127,7 +127,7 @@ namespace vISA
if (samplerHeaderMov &&
inst->isSplitSend() &&
inst->getMsgDesc()->getFuncId() == CISA_SHARED_FUNCTION_ID::SFID_SAMPLER &&
inst->getMsgDesc()->getFuncId() == SFID::SAMPLER &&
inst->getMsgDesc()->isHeaderPresent())
{
MUST_BE_TRUE(samplerHeaderMov->getExecSize() == 1, "Unexpected sampler header");
......@@ -170,7 +170,7 @@ namespace vISA
auto inst = (*instIt);
if (inst->isSplitSend() &&
inst->getMsgDesc()->getFuncId() == CISA_SHARED_FUNCTION_ID::SFID_SAMPLER)
inst->getMsgDesc()->getFuncId() == SFID::SAMPLER)
{
auto samplerHeaderInstIt = samplerHeaderMap.find(inst);
......@@ -325,7 +325,7 @@ namespace vISA
auto inst = (*instIt);
if (inst->isSplitSend() &&
inst->getMsgDesc()->getFuncId() == CISA_SHARED_FUNCTION_ID::SFID_SAMPLER &&
inst->getMsgDesc()->getFuncId() == SFID::SAMPLER &&
inst->getMsgDesc()->isHeaderPresent())
{
toErase = bb->end();
......@@ -645,7 +645,7 @@ namespace vISA
// Run separate checks for sampler
if (uniqueDefInst->isSplitSend() &&
uniqueDefInst->getMsgDesc()->getFuncId() == CISA_SHARED_FUNCTION_ID::SFID_SAMPLER &&
uniqueDefInst->getMsgDesc()->getFuncId() == SFID::SAMPLER &&
uniqueDefInst->getSrc(2)->isImm() &&
uniqueDefInst->getSrc(3)->isImm())
{
......@@ -792,7 +792,7 @@ namespace vISA
auto dstInst = uniqueDef->first;
auto dst = dstInst->getDst();
bool isSampler = dstInst->isSplitSend() && dstInst->getMsgDesc()->getFuncId() == CISA_SHARED_FUNCTION_ID::SFID_SAMPLER;
bool isSampler = dstInst->isSplitSend() && dstInst->getMsgDesc()->getFuncId() == SFID::SAMPLER;
for (unsigned int i = 0; i < G4_MAX_SRCS; i++)
{
......@@ -961,7 +961,7 @@ namespace vISA
for (auto inst : *bb)
{
if (inst->isSplitSend() &&
inst->getMsgDesc()->getFuncId() == CISA_SHARED_FUNCTION_ID::SFID_SAMPLER)
inst->getMsgDesc()->getFuncId() == SFID::SAMPLER)
{
numSampler++;
}
......
......@@ -159,10 +159,10 @@ uint32_t SendFusion::getFuncCtrlWithSimd16(G4_SendMsgDescriptor* Desc)
{
uint32_t FC = Desc->getFuncCtrl();
uint32_t funcID = Desc->getFuncId();
auto funcID = Desc->getFuncId();
uint32_t msgType = Desc->getMessageType();
bool unsupported = false;
if (funcID == SFID_DP_DC)
if (funcID == SFID::DP_DC)
{
switch (msgType)
{
......@@ -179,7 +179,7 @@ uint32_t SendFusion::getFuncCtrlWithSimd16(G4_SendMsgDescriptor* Desc)
break;
}
}
else if (funcID == SFID_DP_DC1)
else if (funcID == SFID::DP_DC1)
{
switch (msgType)
{
......@@ -198,7 +198,7 @@ uint32_t SendFusion::getFuncCtrlWithSimd16(G4_SendMsgDescriptor* Desc)
break;
}
}
else if (funcID == SFID_DP_DC2)