Skip to content

Commit ec53754

Browse files
trbauergfxbot
authored andcommitted
Internal feature
Change-Id: I32d0b36ba1d3f6baf213c700df06a983db5ab43a
1 parent 1ea3c7f commit ec53754

File tree

3 files changed

+38
-32
lines changed

3 files changed

+38
-32
lines changed

visa/Gen4_IR.cpp

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,16 +370,18 @@ static bool isFloatAtomicMessage(SFID funcID, uint16_t msgType)
370370

371371
bool G4_SendMsgDescriptor::isAtomicMessage() const
372372
{
373+
373374
auto funcID = getFuncId();
374375
if (!isHDC())
375376
return false; // guard getMessageType() on SFID without a message type
376377
uint16_t msgType = getHdcMessageType();
377378
return isIntAtomicMessage(funcID,msgType) ||
378-
isFloatAtomicMessage(funcID,msgType);
379+
isFloatAtomicMessage(funcID,msgType);
379380
}
380381

381-
uint16_t G4_SendMsgDescriptor::getAtomicOp() const
382+
uint16_t G4_SendMsgDescriptor::getHdcAtomicOp() const
382383
{
384+
MUST_BE_TRUE(isHDC(),"must be HDC message");
383385
MUST_BE_TRUE(isAtomicMessage(), "getting atomicOp from non-atomic message!");
384386
uint32_t funcCtrl = getFuncCtrl();
385387
if (isIntAtomicMessage(getFuncId(), getHdcMessageType()))
@@ -423,6 +425,33 @@ bool G4_SendMsgDescriptor::isSLMMessage() const
423425
return false;
424426
}
425427

428+
bool G4_SendMsgDescriptor::isBarrierMsg() const
429+
{
430+
auto funcID = getFuncId();
431+
uint32_t funcCtrl = getFuncCtrl();
432+
return funcID == SFID::GATEWAY && (funcCtrl & 0xFF) == 0x4;
433+
}
434+
435+
bool G4_SendMsgDescriptor::isFence() const
436+
{
437+
438+
SFID sfid = getFuncId();
439+
unsigned FC = getFuncCtrl();
440+
441+
// Memory Fence
442+
if (sfid == SFID::DP_DC && ((FC >> 14) & 0x1F) == DC_MEMORY_FENCE)
443+
{
444+
return true;
445+
}
446+
447+
// Sampler cache flush
448+
if (sfid == SFID::SAMPLER && ((FC >> 12) & 0x1F) == 0x1F)
449+
{
450+
return true;
451+
}
452+
453+
return false;
454+
}
426455

427456
bool G4_SendMsgDescriptor::isHeaderPresent() const {
428457

visa/Gen4_IR.hpp

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -396,16 +396,13 @@ class G4_SendMsgDescriptor
396396
}
397397

398398
bool isAtomicMessage() const;
399-
uint16_t getAtomicOp() const;
399+
uint16_t getHdcAtomicOp() const;
400400

401401
bool isSLMMessage() const;
402402

403-
bool isBarrierMsg() const
404-
{
405-
auto funcID = getFuncId();
406-
uint32_t funcCtrl = getFuncCtrl();
407-
return funcID == SFID::GATEWAY && (funcCtrl & 0xFF) == 0x4;
408-
}
403+
bool isBarrierMsg() const;
404+
bool isFence() const;
405+
409406
bool isSendBarrier() const {
410407
return isAtomicMessage() || isBarrierMsg(); // atomic write or explicit barrier
411408
}
@@ -1357,29 +1354,9 @@ class G4_InstSend : public G4_INST
13571354
return canEOT;
13581355
}
13591356

1360-
bool isFence() const
1361-
{
1362-
G4_SendMsgDescriptor *MD = getMsgDesc();
1363-
SFID sfid = MD->getFuncId();
1364-
unsigned FC = MD->getFuncCtrl();
1365-
1366-
// Memory Fence
1367-
if (sfid == SFID::DP_DC && ((FC >> 14) & 0x1F) == DC_MEMORY_FENCE)
1368-
{
1369-
return true;
1370-
}
1357+
bool isFence() const {return getMsgDesc()->isFence();}
13711358

1372-
// Sampler cache flush
1373-
if (sfid == SFID::SAMPLER && ((FC >> 12) & 0x1F) == 0x1F)
1374-
{
1375-
return true;
1376-
}
1377-
1378-
return false;
1379-
}
1380-
1381-
bool isEOT() const override
1382-
{
1359+
bool isEOT() const override {
13831360
return msgDesc->isEOTInst();
13841361
}
13851362

visa/SendFusion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ bool SendFusion::isAtomicCandidate(G4_SendMsgDescriptor* msgDesc)
247247
}
248248

249249
// Had right atomic type, now check AtomicOp
250-
uint16_t atomicOp = msgDesc->getAtomicOp();
250+
uint16_t atomicOp = msgDesc->getHdcAtomicOp();
251251
if (intAtomic)
252252
{
253253
switch (atomicOp)

0 commit comments

Comments
 (0)