Skip to content

Commit a82c091

Browse files
jgu222igcbot
authored andcommitted
Changed based on review feedback
Minor change
1 parent d4aa5c2 commit a82c091

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

visa/G4_SendDescs.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,6 +1745,35 @@ bool G4_SendDescRaw::isBarrier() const {
17451745
return funcID == SFID::GATEWAY && (funcCtrl & 0xFF) == 0x4;
17461746
}
17471747

1748+
bool G4_SendDescRaw::isBTS() const {
1749+
if (isLscOp()) {
1750+
switch (getLscAddrType()) {
1751+
case LSC_ADDR_TYPE_BSS:
1752+
case LSC_ADDR_TYPE_SS:
1753+
case LSC_ADDR_TYPE_BTI:
1754+
return true;
1755+
default:
1756+
break;
1757+
}
1758+
} else {
1759+
const G4_Operand *BTI = getBti();
1760+
uint32_t BTIImm = 0;
1761+
if (BTI && !BTI->isImm()) {
1762+
// Desc in reg, should be stateful.
1763+
return true;
1764+
} else if (BTI) {
1765+
BTIImm = (BTI->asImm()->getInt() & 0xFF);
1766+
} else {
1767+
BTIImm = (getDesc() & 0xFF);
1768+
}
1769+
constexpr uint32_t BSS_BTI = 252;
1770+
constexpr uint32_t BTI_MAX = 240;
1771+
if (BTIImm <= BTI_MAX || BTIImm == BSS_BTI)
1772+
return true;
1773+
}
1774+
return false;
1775+
}
1776+
17481777
std::optional<ImmOff> G4_SendDescRaw::getOffset() const {
17491778
if (isLscOp()) {
17501779
// technically unavailable until XE2, but this is binary compatible,

visa/G4_SendDescs.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ class G4_SendDesc {
297297
bool isGTWY() const {return getSFID() == SFID::GATEWAY;}
298298
//
299299
virtual bool isSLM() const = 0;
300+
virtual bool isBTS() const = 0; // BTS stateful
300301
virtual bool isTyped() const = 0;
301302
virtual bool isAtomic() const = 0;
302303
virtual bool isBarrier() const = 0;
@@ -680,6 +681,7 @@ class G4_SendDescRaw : public G4_SendDesc {
680681
virtual std::optional<ImmOff> getOffset() const override;
681682

682683
virtual bool isSLM() const override { return isSLMMessage(); }
684+
virtual bool isBTS() const override;
683685
virtual bool isAtomic() const override { return isAtomicMessage(); }
684686
virtual bool isBarrier() const override;
685687
virtual bool isFence() const override;

0 commit comments

Comments
 (0)