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: ...@@ -1202,7 +1202,7 @@ public:
unsigned funcCtrl, unsigned funcCtrl,
unsigned regs2rcv, unsigned regs2rcv,
unsigned regs2snd, unsigned regs2snd,
CISA_SHARED_FUNCTION_ID funcID, SFID funcID,
bool eot, bool eot,
unsigned extMsgLength, unsigned extMsgLength,
uint16_t extFuncCtrl, uint16_t extFuncCtrl,
...@@ -1674,7 +1674,7 @@ public: ...@@ -1674,7 +1674,7 @@ public:
unsigned regs2rcv, unsigned regs2rcv,
unsigned execsize, unsigned execsize,
unsigned fc, unsigned fc,
CISA_SHARED_FUNCTION_ID tf_id, SFID tf_id,
bool eot, bool eot,
bool head_present, bool head_present,
bool isRead, bool isRead,
...@@ -1690,7 +1690,7 @@ public: ...@@ -1690,7 +1690,7 @@ public:
unsigned regs2rcv, unsigned regs2rcv,
unsigned execsize, unsigned execsize,
unsigned fc, unsigned exFuncCtrl, unsigned fc, unsigned exFuncCtrl,
CISA_SHARED_FUNCTION_ID tf_id, bool eot, SFID tf_id, bool eot,
bool head_present, bool head_present,
bool isRead, bool isRead,
bool isWrite, bool isWrite,
......
...@@ -131,7 +131,7 @@ G4_SendMsgDescriptor* IR_Builder::createSendMsgDesc( ...@@ -131,7 +131,7 @@ G4_SendMsgDescriptor* IR_Builder::createSendMsgDesc(
unsigned funcCtrl, unsigned funcCtrl,
unsigned regs2rcv, unsigned regs2rcv,
unsigned regs2snd, unsigned regs2snd,
CISA_SHARED_FUNCTION_ID funcID, SFID funcID,
bool eot, bool eot,
unsigned extMsgLength, unsigned extMsgLength,
uint16_t extFuncCtrl, uint16_t extFuncCtrl,
...@@ -141,7 +141,7 @@ G4_SendMsgDescriptor* IR_Builder::createSendMsgDesc( ...@@ -141,7 +141,7 @@ G4_SendMsgDescriptor* IR_Builder::createSendMsgDesc(
G4_Operand *sti) G4_Operand *sti)
{ {
G4_SendMsgDescriptor* msgDesc = new (mem) G4_SendMsgDescriptor( 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); extFuncCtrl, isRead, isWrite, bti, sti, *this);
return msgDesc; return msgDesc;
} }
...@@ -724,7 +724,7 @@ G4_InstSend* IR_Builder::Create_Send_Inst_For_CISA( ...@@ -724,7 +724,7 @@ G4_InstSend* IR_Builder::Create_Send_Inst_For_CISA(
unsigned regs2rcv, unsigned regs2rcv,
unsigned execsize, unsigned execsize,
unsigned fc, unsigned fc,
CISA_SHARED_FUNCTION_ID tf_id, SFID tf_id,
bool eot, bool eot,
bool header_present, bool header_present,
bool isRead, bool isRead,
...@@ -894,7 +894,7 @@ G4_InstSend* IR_Builder::Create_SplitSend_Inst_For_CISA( ...@@ -894,7 +894,7 @@ G4_InstSend* IR_Builder::Create_SplitSend_Inst_For_CISA(
unsigned execsize, unsigned execsize,
unsigned fc, unsigned fc,
unsigned exFuncCtrl, unsigned exFuncCtrl,
CISA_SHARED_FUNCTION_ID tf_id, SFID tf_id,
bool eot, bool eot,
bool header_present, bool header_present,
bool isRead, bool isRead,
......
...@@ -790,23 +790,36 @@ typedef struct ...@@ -790,23 +790,36 @@ typedef struct
const char* str; const char* str;
} CISA_PreDefined_Var_Info; } CISA_PreDefined_Var_Info;
typedef enum namespace vISA
{ {
SFID_NULL = 0, enum class SFID
SFID_SAMPLER = 2, {
SFID_GATEWAY = 3, NULL_SFID = 0,
SFID_DP_DC2 = 4, SAMPLER = 2,
SFID_DP_WRITE = 5, //DATAPORT WRITE GATEWAY = 3,
SFID_URB = 6, //URB DP_DC2 = 4,
SFID_SPAWNER = 7, //THREAD SPAWNER DP_WRITE = 5, //DATAPORT WRITE
SFID_VME = 8, //VIDEO MOTION ESTIMATION URB = 6, //URB
SFID_DP_CC = 9, //CONSTANT CACHE DATAPORT SPAWNER = 7, //THREAD SPAWNER
SFID_DP_DC = 10, //DATA CACHE DATAPORT VME = 8, //VIDEO MOTION ESTIMATION
SFID_DP_PI = 11, //PIXEL INTERPOLATOR DP_CC = 9, //CONSTANT CACHE DATAPORT
SFID_DP_DC1 = 12, //DATA CACHE DATAPORT1 DP_DC = 10, //DATA CACHE DATAPORT
SFID_CRE = 13, //CHECK & REFINEMENT ENGINE DP_PI = 11, //PIXEL INTERPOLATOR
SFID_NUM = 14 DP_DC1 = 12, //DATA CACHE DATAPORT1
} CISA_SHARED_FUNCTION_ID; 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 typedef enum
{ {
......
...@@ -1114,7 +1114,7 @@ void FlowGraph::handleExit(G4_BB* firstSubroutineBB) ...@@ -1114,7 +1114,7 @@ void FlowGraph::handleExit(G4_BB* firstSubroutineBB)
G4_SrcRegRegion* sendMsgOpnd = builder->Create_Src_Opnd_From_Dcl( G4_SrcRegRegion* sendMsgOpnd = builder->Create_Src_Opnd_From_Dcl(
builder->getBuiltinR0(), builder->getBuiltinR0(),
builder->getRegionStride1()); 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, G4_INST* samplerFlushInst = builder->createSendInst(nullptr, G4_send,
8, builder->createNullDst(Type_UD), sendMsgOpnd, 8, builder->createNullDst(Type_UD), sendMsgOpnd,
builder->createImm(desc, Type_UD), builder->createImm(desc, Type_UD),
...@@ -4062,7 +4062,7 @@ void G4_BB::addEOTSend(G4_INST* lastInst) ...@@ -4062,7 +4062,7 @@ void G4_BB::addEOTSend(G4_INST* lastInst)
} }
instList.push_back(movInst); instList.push_back(movInst);
int exdesc = (0x1 << 5) + SFID_SPAWNER; int exdesc = (0x1 << 5) + SFIDtoInt(SFID::SPAWNER);
// response len = 0, msg len = 1 // response len = 0, msg len = 1
int desc = (0x1 << 25) + (0x1 << 4); int desc = (0x1 << 25) + (0x1 << 4);
......
...@@ -307,9 +307,9 @@ const char* G4_SendMsgDescriptor::getDescType() ...@@ -307,9 +307,9 @@ const char* G4_SendMsgDescriptor::getDescType()
switch (msgDesc->getFuncId()) switch (msgDesc->getFuncId())
{ {
case SFID_SAMPLER: return "sampler"; break; case SFID::SAMPLER: return "sampler"; break;
case SFID_GATEWAY: return "gateway"; break; case SFID::GATEWAY: return "gateway"; break;
case SFID_DP_DC2: case SFID::DP_DC2:
switch (bits) switch (bits)
{ {
case DC2_UNTYPED_SURFACE_READ: case DC2_UNTYPED_SURFACE_READ:
...@@ -331,7 +331,7 @@ const char* G4_SendMsgDescriptor::getDescType() ...@@ -331,7 +331,7 @@ const char* G4_SendMsgDescriptor::getDescType()
default: default:
return "unrecognized message"; return "unrecognized message";
} }
case SFID_DP_WRITE: case SFID::DP_WRITE:
switch (bits) switch (bits)
{ {
case 0xc: return "render target write"; break; case 0xc: return "render target write"; break;
...@@ -339,10 +339,10 @@ const char* G4_SendMsgDescriptor::getDescType() ...@@ -339,10 +339,10 @@ const char* G4_SendMsgDescriptor::getDescType()
default: return "reserved encoding used!"; default: return "reserved encoding used!";
} }
break; break;
case SFID_URB: return "urb"; break; case SFID::URB: return "urb"; break;
case SFID_SPAWNER: return "thread spawner"; break; case SFID::SPAWNER: return "thread spawner"; break;
case SFID_VME: return "vme"; break; case SFID::VME: return "vme"; break;
case SFID_DP_CC: case SFID::DP_CC:
switch (bits) switch (bits)
{ {
case 0x0: return "oword block read"; break; case 0x0: return "oword block read"; break;
...@@ -352,7 +352,7 @@ const char* G4_SendMsgDescriptor::getDescType() ...@@ -352,7 +352,7 @@ const char* G4_SendMsgDescriptor::getDescType()
default: return "reserved encoding used!"; default: return "reserved encoding used!";
break; break;
} }
case SFID_DP_DC: case SFID::DP_DC:
category = (msgDesc->getFuncCtrl() >> 18) & 0x1; category = (msgDesc->getFuncCtrl() >> 18) & 0x1;
if (category == 0) if (category == 0)
{ {
...@@ -385,8 +385,8 @@ const char* G4_SendMsgDescriptor::getDescType() ...@@ -385,8 +385,8 @@ const char* G4_SendMsgDescriptor::getDescType()
return "scratch write"; return "scratch write";
} }
break; break;
case SFID_DP_PI: return "dp_pi"; break; case SFID::DP_PI: return "dp_pi"; break;
case SFID_DP_DC1: case SFID::DP_DC1:
switch (bits) switch (bits)
{ {
case 0x0: return "transpose read"; break; case 0x0: return "transpose read"; break;
...@@ -415,7 +415,7 @@ const char* G4_SendMsgDescriptor::getDescType() ...@@ -415,7 +415,7 @@ const char* G4_SendMsgDescriptor::getDescType()
default: return "reserved encoding used!"; default: return "reserved encoding used!";
} }
break; break;
case SFID_CRE: return "cre"; break; case SFID::CRE: return "cre"; break;
default: return "--"; default: return "--";
} }
return NULL; return NULL;
...@@ -423,7 +423,7 @@ const char* G4_SendMsgDescriptor::getDescType() ...@@ -423,7 +423,7 @@ const char* G4_SendMsgDescriptor::getDescType()
bool G4_SendMsgDescriptor::isSLMMessage() const bool G4_SendMsgDescriptor::isSLMMessage() const
{ {
if (getFuncId() == SFID_DP_DC2) if (getFuncId() == SFID::DP_DC2)
{ {
uint32_t msgType = getMessageType(); uint32_t msgType = getMessageType();
if ((msgType == DC2_UNTYPED_SURFACE_WRITE || msgType == DC2_BYTE_SCATTERED_WRITE) && if ((msgType == DC2_UNTYPED_SURFACE_WRITE || msgType == DC2_BYTE_SCATTERED_WRITE) &&
...@@ -433,9 +433,9 @@ bool G4_SendMsgDescriptor::isSLMMessage() const ...@@ -433,9 +433,9 @@ bool G4_SendMsgDescriptor::isSLMMessage() const
} }
} }
if (getFuncId() == SFID_DP_DC2 || if (getFuncId() == SFID::DP_DC2 ||
getFuncId() == SFID_DP_DC1 || getFuncId() == SFID::DP_DC1 ||
getFuncId() == SFID_DP_DC) getFuncId() == SFID::DP_DC)
{ {
if ((getDesc() & 0xFF) == 0xFE) if ((getDesc() & 0xFF) == 0xFE)
{ {
...@@ -454,13 +454,13 @@ bool G4_SendMsgDescriptor::isSLMMessage() const ...@@ -454,13 +454,13 @@ bool G4_SendMsgDescriptor::isSLMMessage() const
bool G4_SendMsgDescriptor::isReadOnlyMessage(uint32_t msgDesc, bool G4_SendMsgDescriptor::isReadOnlyMessage(uint32_t msgDesc,
uint32_t extDesc) uint32_t extDesc)
{ {
CISA_SHARED_FUNCTION_ID funcID = G4_SendMsgDescriptor::getFuncId(extDesc); SFID funcID = G4_SendMsgDescriptor::getFuncId(extDesc);
unsigned subFuncID = G4_SendMsgDescriptor::getMessageType(msgDesc); unsigned subFuncID = G4_SendMsgDescriptor::getMessageType(msgDesc);
switch (funcID) { switch (funcID) {
default: default:
break; break;
case SFID_DP_DC: case SFID::DP_DC:
switch (subFuncID) { switch (subFuncID) {
case DC_OWORD_BLOCK_READ: case DC_OWORD_BLOCK_READ:
case DC_UNALIGNED_OWORD_BLOCK_READ: case DC_UNALIGNED_OWORD_BLOCK_READ:
...@@ -470,7 +470,7 @@ bool G4_SendMsgDescriptor::isReadOnlyMessage(uint32_t msgDesc, ...@@ -470,7 +470,7 @@ bool G4_SendMsgDescriptor::isReadOnlyMessage(uint32_t msgDesc,
default: default:
return false; return false;
} }
case SFID_DP_DC1: case SFID::DP_DC1:
switch (subFuncID) { switch (subFuncID) {
case DC1_UNTYPED_SURFACE_READ: case DC1_UNTYPED_SURFACE_READ:
case DC1_MEDIA_BLOCK_READ: case DC1_MEDIA_BLOCK_READ:
...@@ -482,7 +482,7 @@ bool G4_SendMsgDescriptor::isReadOnlyMessage(uint32_t msgDesc, ...@@ -482,7 +482,7 @@ bool G4_SendMsgDescriptor::isReadOnlyMessage(uint32_t msgDesc,
default: default:
return false; return false;
} }
case SFID_DP_DC2: case SFID::DP_DC2:
switch (subFuncID) { switch (subFuncID) {
case DC2_UNTYPED_SURFACE_READ: case DC2_UNTYPED_SURFACE_READ:
case DC2_A64_SCATTERED_READ: case DC2_A64_SCATTERED_READ:
...@@ -492,7 +492,7 @@ bool G4_SendMsgDescriptor::isReadOnlyMessage(uint32_t msgDesc, ...@@ -492,7 +492,7 @@ bool G4_SendMsgDescriptor::isReadOnlyMessage(uint32_t msgDesc,
default: default:
return false; return false;
} }
case SFID_SAMPLER: case SFID::SAMPLER:
return true; return true;
} }
...@@ -3099,12 +3099,12 @@ bool G4_InstSend::isDirectSplittableSend() ...@@ -3099,12 +3099,12 @@ bool G4_InstSend::isDirectSplittableSend()
{ {
unsigned short elemSize = dst->getElemSize(); unsigned short elemSize = dst->getElemSize();
CISA_SHARED_FUNCTION_ID funcID = msgDesc->getFuncId(); SFID funcID = msgDesc->getFuncId();
unsigned subFuncID = msgDesc->getMessageType(); unsigned subFuncID = msgDesc->getMessageType();
switch (funcID) switch (funcID)
{ {
case SFID_DP_DC1: case SFID::DP_DC1:
switch (subFuncID) switch (subFuncID)
{ {
case DC1_A64_SCATTERED_READ: //emask need be vertically cut. case DC1_A64_SCATTERED_READ: //emask need be vertically cut.
...@@ -3125,7 +3125,7 @@ bool G4_InstSend::isDirectSplittableSend() ...@@ -3125,7 +3125,7 @@ bool G4_InstSend::isDirectSplittableSend()
default: return false; default: return false;
} }
case SFID_DP_DC2: case SFID::DP_DC2:
switch (subFuncID) switch (subFuncID)
{ {
case DC2_UNTYPED_SURFACE_READ: //gather 4 scaled : emask can be reused if the per-channel data is larger than 1 GRF 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() ...@@ -3145,7 +3145,7 @@ bool G4_InstSend::isDirectSplittableSend()
default: return false; default: return false;
} }
case SFID_DP_DC: case SFID::DP_DC:
switch (subFuncID) switch (subFuncID)
{ {
case DC_DWORD_SCATTERED_READ: //dword scattered read: emask need be vertically cut according to splitting case DC_DWORD_SCATTERED_READ: //dword scattered read: emask need be vertically cut according to splitting
...@@ -3156,7 +3156,7 @@ bool G4_InstSend::isDirectSplittableSend() ...@@ -3156,7 +3156,7 @@ bool G4_InstSend::isDirectSplittableSend()
return true; return true;
default: return false; default: return false;
} }
case SFID_SAMPLER: case SFID::SAMPLER:
return true; return true;
default: return false; default: return false;
} }
......
...@@ -298,7 +298,7 @@ public: ...@@ -298,7 +298,7 @@ public:
void *operator new(size_t sz, Mem_Manager &m) { return m.alloc(sz); } 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) bool isEot = false)
{ {
return createExtDesc(funcID, isEot, 0, 0); return createExtDesc(funcID, isEot, 0, 0);
...@@ -308,7 +308,7 @@ public: ...@@ -308,7 +308,7 @@ public:
{ {
ExtDescData data; ExtDescData data;
data.value = 0; data.value = 0;
data.layout.funcID = SFID_DP_WRITE; data.layout.funcID = SFIDtoInt(SFID::DP_WRITE);
data.layout.RTIndex = RTIndex; data.layout.RTIndex = RTIndex;
data.layout.src0Alpha = src0Alpha; data.layout.src0Alpha = src0Alpha;
data.layout.eot = isEOT; data.layout.eot = isEOT;
...@@ -316,14 +316,14 @@ public: ...@@ -316,14 +316,14 @@ public:
return data.value; return data.value;
} }
static uint32_t createExtDesc(CISA_SHARED_FUNCTION_ID funcID, static uint32_t createExtDesc(SFID funcID,
bool isEot, bool isEot,
unsigned extMsgLen, unsigned extMsgLen,
unsigned extFCtrl = 0) unsigned extFCtrl = 0)
{ {
ExtDescData data; ExtDescData data;
data.value = 0; data.value = 0;
data.layout.funcID = funcID; data.layout.funcID = SFIDtoInt(funcID);
data.layout.eot = isEot; data.layout.eot = isEot;
data.layout.extMsgLength = extMsgLen; data.layout.extMsgLength = extMsgLen;
data.layout.extFuncCtrl = extFCtrl; data.layout.extFuncCtrl = extFCtrl;
...@@ -341,15 +341,15 @@ public: ...@@ -341,15 +341,15 @@ public:
return data.value; return data.value;
} }
static CISA_SHARED_FUNCTION_ID getFuncId(uint32_t extDesc) static SFID getFuncId(uint32_t extDesc)
{ {
ExtDescData data; ExtDescData data;
data.value = extDesc; 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) static uint32_t getFuncCtrl(uint32_t msgDesc)
...@@ -385,44 +385,44 @@ public: ...@@ -385,44 +385,44 @@ public:
bool isScratchRW() const bool isScratchRW() const
{ {
// scratch msg: DC0, bit 18 = 1 // 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 bool isDataPortOperation() const
{ {
auto funcID = extDesc.layout.funcID; auto funcID = getFuncId();
return funcID == SFID_SAMPLER || funcID == SFID_DP_WRITE || return funcID == SFID::SAMPLER || funcID == SFID::DP_WRITE ||
funcID == SFID_DP_CC || funcID == SFID_DP_DC || funcID == SFID::DP_CC || funcID == SFID::DP_DC ||
funcID == SFID_DP_DC1; funcID == SFID::DP_DC1;
} }
bool isDataPortRead() const { return readMsg; } bool isDataPortRead() const { return readMsg; }
bool isDataPortWrite() const { return writeMsg; } bool isDataPortWrite() const { return writeMsg; }
bool isSampler() const bool isSampler() const
{ {
return getFuncId() == SFID_SAMPLER; return getFuncId() == SFID::SAMPLER;
} }
bool isHDC() const bool isHDC() const
{ {
auto funcID = extDesc.layout.funcID; auto funcID = getFuncId();
return funcID == SFID_DP_DC || funcID == SFID_DP_DC1 || funcID == SFID_DP_DC2; return funcID == SFID::DP_DC || funcID == SFID::DP_DC1 || funcID == SFID::DP_DC2;
} }
bool isThreadMessage() const bool isThreadMessage() const
{ {
auto funcID = extDesc.layout.funcID; auto funcID = getFuncId();
return funcID == SFID_GATEWAY || funcID == SFID_SPAWNER; return funcID == SFID::GATEWAY || funcID == SFID::SPAWNER;
} }
bool conflictsWithWait() const bool conflictsWithWait() const
{ {
auto funcID = extDesc.layout.funcID; auto funcID = getFuncId();
return isDataPortOperation() || funcID == SFID_GATEWAY || return isDataPortOperation() || funcID == SFID::GATEWAY ||
funcID == SFID_SPAWNER || funcID == SFID_URB || funcID == SFID_NUM; funcID == SFID::SPAWNER || funcID == SFID::URB;
} }
bool isIntAtomicMessage() const bool isIntAtomicMessage() const
{ {
auto funcID = extDesc.layout.funcID; auto funcID = getFuncId();
if (funcID != SFID_DP_DC1) if (funcID != SFID::DP_DC1)
return false; return false;
uint16_t msgType = getMessageType(); uint16_t msgType = getMessageType();
...@@ -440,8 +440,8 @@ public: ...@@ -440,8 +440,8 @@ public:
bool isFloatAtomicMessage() const bool isFloatAtomicMessage() const
{ {
auto funcID = extDesc.layout.funcID; auto funcID = getFuncId();
if (funcID != SFID_DP_DC1) if (funcID != SFID::DP_DC1)
return false; return false;
uint16_t msgType = getMessageType(); uint16_t msgType = getMessageType();
...@@ -476,9 +476,9 @@ public: ...@@ -476,9 +476,9 @@ public:
bool isBarrierMsg() const bool isBarrierMsg() const
{ {
auto funcID = extDesc.layout.funcID; auto funcID = getFuncId();
uint32_t funcCtrl = getFuncCtrl(); uint32_t funcCtrl = getFuncCtrl();
return funcID == SFID_GATEWAY && (funcCtrl & 0xFF) == 0x4; return funcID == SFID::GATEWAY && (funcCtrl & 0xFF) == 0x4;
} }
bool isSLMMessage() const; bool isSLMMessage() const;
...@@ -563,10 +563,10 @@ public: ...@@ -563,10 +563,10 @@ public:
bool isOwordLoad() const bool isOwordLoad() const
{ {
uint32_t funcCtrl = getFuncCtrl(); uint32_t funcCtrl = getFuncCtrl();
auto funcID = extDesc.layout.funcID; auto funcID = getFuncId();
uint16_t msgType = ( funcCtrl >> IVB_MSG_TYPE_OFFSET ) & 0xF; uint16_t msgType = ( funcCtrl >> IVB_MSG_TYPE_OFFSET ) & 0xF;
//SFID = data cache, bit 14-17= 0 or 1 //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); static bool isReadOnlyMessage(uint32_t msgDesc, uint32_t exDesc);
...@@ -1499,8 +1499,8 @@ public: ...@@ -1499,8 +1499,8 @@ public:
bool canBeEOT() bool canBeEOT()
{ {
bool canEOT = msgDesc->ResponseLength() == 0 && bool canEOT = msgDesc->ResponseLength() == 0 &&
(msgDesc->getFuncId() != SFID_NULL && (msgDesc->getFuncId() != SFID::NULL_SFID &&
msgDesc->getFuncId() != SFID_SAMPLER); msgDesc->getFuncId() != SFID::SAMPLER);
return canEOT; return canEOT;
} }
...@@ -1508,17 +1508,17 @@ public: ...@@ -1508,17 +1508,17 @@ public:
bool isFence() const bool isFence() const
{ {
G4_SendMsgDescriptor *MD = getMsgDesc(); G4_SendMsgDescriptor *MD = getMsgDesc();
CISA_SHARED_FUNCTION_ID SFID = MD->getFuncId(); SFID sfid = MD->getFuncId();
unsigned FC = MD->getFuncCtrl(); unsigned FC = MD->getFuncCtrl();
// Memory Fence // 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; return true;
} }
// Sampler cache flush // Sampler cache flush
if (SFID == SFID_SAMPLER && ((FC >> 12) & 0x1F) == 0x1F) if (sfid == SFID::SAMPLER && ((FC >> 12) & 0x1F) == 0x1F)
{ {
return true; return true;
} }
......
...@@ -2634,12 +2634,12 @@ bool Augmentation::updateDstMaskForScatter(G4_INST* inst, unsigned char* mask) ...@@ -2634,12 +2634,12 @@ bool Augmentation::updateDstMaskForScatter(G4_INST* inst, unsigned char* mask)
curEMBit = NOMASK_BYTE; curEMBit = NOMASK_BYTE;
} }
CISA_SHARED_FUNCTION_ID funcID = msgDesc->getFuncId(); SFID funcID = msgDesc->getFuncId();
unsigned subFuncID = msgDesc->getMessageType(); unsigned subFuncID = msgDesc->getMessageType();
switch (funcID) switch (funcID)
{ {
case SFID_DP_DC1: case SFID::DP_DC1:
switch (subFuncID) switch (subFuncID)
{ {
case DC1_A64_SCATTERED_READ: //a64 scattered read: svm_gather case DC1_A64_SCATTERED_READ: //a64 scattered read: svm_gather
...@@ -2703,7 +2703,7 @@ bool Augmentation::updateDstMaskForScatter(G4_INST* inst, unsigned char* mask) ...@@ -2703,7 +2703,7 @@ bool Augmentation::updateDstMaskForScatter(G4_INST* inst, unsigned char* mask)
default: return false; default: return false;
} }
break; break;
case SFID_DP_DC2: case SFID::DP_DC2:
switch (subFuncID) switch (subFuncID)
{ {
case DC2_UNTYPED_SURFACE_READ: //gather 4 scaled case DC2_UNTYPED_SURFACE_READ: //gather 4 scaled
...@@ -2742,7 +2742,7 @@ bool Augmentation::updateDstMaskForScatter(G4_INST* inst, unsigned char* mask) ...@@ -2742,7 +2742,7 @@ bool Augmentation::updateDstMaskForScatter(G4_INST* inst, unsigned char* mask)
default: return false; default: return false;
} }
break; break;
case SFID_DP_DC: case SFID::DP_DC:
switch (subFuncID) switch (subFuncID)
{ {
case DC_DWORD_SCATTERED_READ: //dword scattered read: gather(dword), handled as block read write case DC_DWORD_SCATTERED_READ: //dword scattered read: gather(dword), handled as block read write
...@@ -6538,7 +6538,7 @@ void GraphColor::saveRegs( ...@@ -6538,7 +6538,7 @@ void GraphColor::saveRegs(
auto sendSrc2 = builder.createSrcRegRegion(Mod_src_undef, Direct, msgDcl->getRegVar(), 0, 0, auto sendSrc2 = builder.createSrcRegRegion(Mod_src_undef, Direct, msgDcl->getRegVar(), 0, 0,
builder.rgnpool.createRegion(8, 8, 1), Type_UD); builder.rgnpool.createRegion(8, 8, 1), Type_UD);
G4_Imm* descImm = gra.createMsgDesc(owordSize, true, true); 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, auto msgDesc = builder.createSendMsgDesc((uint32_t)descImm->getInt(), extDesc, false, true,