LLVM 19.0.0git
Enumerations | Functions | Variables
llvm::AMDGPU::SendMsg Namespace Reference

Enumerations

enum  Id {
  ID_INTERRUPT = 1 , ID_GS_PreGFX11 = 2 , ID_GS_DONE_PreGFX11 = 3 , ID_HS_TESSFACTOR_GFX11Plus = 2 ,
  ID_DEALLOC_VGPRS_GFX11Plus = 3 , ID_SAVEWAVE = 4 , ID_STALL_WAVE_GEN = 5 , ID_HALT_WAVES = 6 ,
  ID_ORDERED_PS_DONE = 7 , ID_EARLY_PRIM_DEALLOC = 8 , ID_GS_ALLOC_REQ = 9 , ID_GET_DOORBELL = 10 ,
  ID_GET_DDID = 11 , ID_SYSMSG = 15 , ID_RTN_GET_DOORBELL = 128 , ID_RTN_GET_DDID = 129 ,
  ID_RTN_GET_TMA = 130 , ID_RTN_GET_REALTIME = 131 , ID_RTN_SAVE_WAVE = 132 , ID_RTN_GET_TBA = 133 ,
  ID_RTN_GET_TBA_TO_PC = 134 , ID_RTN_GET_SE_AID_ID = 135 , ID_MASK_PreGFX11_ = 0xF , ID_MASK_GFX11Plus_ = 0xFF
}
 
enum  Op {
  OP_SHIFT_ = 4 , OP_NONE_ = 0 , OP_WIDTH_ = 3 , OP_MASK_ = (((1 << OP_WIDTH_) - 1) << OP_SHIFT_) ,
  OP_GS_NOP = 0 , OP_GS_CUT = 1 , OP_GS_EMIT = 2 , OP_GS_EMIT_CUT = 3 ,
  OP_GS_FIRST_ = OP_GS_NOP , OP_SYS_ECC_ERR_INTERRUPT = 1 , OP_SYS_REG_RD = 2 , OP_SYS_HOST_TRAP_ACK = 3 ,
  OP_SYS_TTRACE_PC = 4 , OP_SYS_FIRST_ = OP_SYS_ECC_ERR_INTERRUPT
}
 
enum  StreamId : unsigned {
  STREAM_ID_NONE_ = 0 , STREAM_ID_DEFAULT_ = 0 , STREAM_ID_LAST_ = 4 , STREAM_ID_FIRST_ = STREAM_ID_DEFAULT_ ,
  STREAM_ID_SHIFT_ = 8 , STREAM_ID_WIDTH_ = 2 , STREAM_ID_MASK_ = (((1 << STREAM_ID_WIDTH_) - 1) << STREAM_ID_SHIFT_)
}
 

Functions

int64_t getMsgId (StringRef Name, const MCSubtargetInfo &STI)
 Map from a symbolic name for a msg_id to the message portion of the immediate encoding.
 
StringRef getMsgName (uint64_t Encoding, const MCSubtargetInfo &STI)
 Map from an encoding to the symbolic name for a msg_id immediate.
 
int64_t getMsgOpId (int64_t MsgId, StringRef Name, const MCSubtargetInfo &STI)
 Map from a symbolic name for a sendmsg operation to the operation portion of the immediate encoding.
 
StringRef getMsgOpName (int64_t MsgId, uint64_t Encoding, const MCSubtargetInfo &STI)
 Map from an encoding to the symbolic name for a sendmsg operation.
 
static uint64_t getMsgIdMask (const MCSubtargetInfo &STI)
 
bool isValidMsgId (int64_t MsgId, const MCSubtargetInfo &STI)
 
bool isValidMsgOp (int64_t MsgId, int64_t OpId, const MCSubtargetInfo &STI, bool Strict)
 
bool isValidMsgStream (int64_t MsgId, int64_t OpId, int64_t StreamId, const MCSubtargetInfo &STI, bool Strict)
 
bool msgRequiresOp (int64_t MsgId, const MCSubtargetInfo &STI)
 
bool msgSupportsStream (int64_t MsgId, int64_t OpId, const MCSubtargetInfo &STI)
 
void decodeMsg (unsigned Val, uint16_t &MsgId, uint16_t &OpId, uint16_t &StreamId, const MCSubtargetInfo &STI)
 
uint64_t encodeMsg (uint64_t MsgId, uint64_t OpId, uint64_t StreamId)
 

Variables

static constexpr CustomOperand MsgOperands []
 
static constexpr CustomOperand SysMsgOperands []
 
static constexpr CustomOperand StreamMsgOperands []
 

Enumeration Type Documentation

◆ Id

Enumerator
ID_INTERRUPT 
ID_GS_PreGFX11 
ID_GS_DONE_PreGFX11 
ID_HS_TESSFACTOR_GFX11Plus 
ID_DEALLOC_VGPRS_GFX11Plus 
ID_SAVEWAVE 
ID_STALL_WAVE_GEN 
ID_HALT_WAVES 
ID_ORDERED_PS_DONE 
ID_EARLY_PRIM_DEALLOC 
ID_GS_ALLOC_REQ 
ID_GET_DOORBELL 
ID_GET_DDID 
ID_SYSMSG 
ID_RTN_GET_DOORBELL 
ID_RTN_GET_DDID 
ID_RTN_GET_TMA 
ID_RTN_GET_REALTIME 
ID_RTN_SAVE_WAVE 
ID_RTN_GET_TBA 
ID_RTN_GET_TBA_TO_PC 
ID_RTN_GET_SE_AID_ID 
ID_MASK_PreGFX11_ 
ID_MASK_GFX11Plus_ 

Definition at line 438 of file SIDefines.h.

◆ Op

Enumerator
OP_SHIFT_ 
OP_NONE_ 
OP_WIDTH_ 
OP_MASK_ 
OP_GS_NOP 
OP_GS_CUT 
OP_GS_EMIT 
OP_GS_EMIT_CUT 
OP_GS_FIRST_ 
OP_SYS_ECC_ERR_INTERRUPT 
OP_SYS_REG_RD 
OP_SYS_HOST_TRAP_ACK 
OP_SYS_TTRACE_PC 
OP_SYS_FIRST_ 

Definition at line 470 of file SIDefines.h.

◆ StreamId

Enumerator
STREAM_ID_NONE_ 
STREAM_ID_DEFAULT_ 
STREAM_ID_LAST_ 
STREAM_ID_FIRST_ 
STREAM_ID_SHIFT_ 
STREAM_ID_WIDTH_ 
STREAM_ID_MASK_ 

Definition at line 490 of file SIDefines.h.

Function Documentation

◆ decodeMsg()

void llvm::AMDGPU::SendMsg::decodeMsg ( unsigned  Val,
uint16_t MsgId,
uint16_t OpId,
uint16_t StreamId,
const MCSubtargetInfo STI 
)

◆ encodeMsg()

LLVM_READNONE uint64_t llvm::AMDGPU::SendMsg::encodeMsg ( uint64_t  MsgId,
uint64_t  OpId,
uint64_t  StreamId 
)

Definition at line 1947 of file AMDGPUBaseInfo.cpp.

References OP_SHIFT_, and STREAM_ID_SHIFT_.

◆ getMsgId()

int64_t llvm::AMDGPU::SendMsg::getMsgId ( StringRef  Name,
const MCSubtargetInfo STI 
)

Map from a symbolic name for a msg_id to the message portion of the immediate encoding.

A negative return value indicates that the Name was unknown or unsupported on this target.

Definition at line 140 of file AMDGPUAsmUtils.cpp.

References llvm::AMDGPU::getEncodingFromOperandTable(), MsgOperands, and Name.

◆ getMsgIdMask()

static uint64_t llvm::AMDGPU::SendMsg::getMsgIdMask ( const MCSubtargetInfo STI)
static

Definition at line 1877 of file AMDGPUBaseInfo.cpp.

References ID_MASK_GFX11Plus_, ID_MASK_PreGFX11_, and llvm::AMDGPU::isGFX11Plus().

Referenced by decodeMsg(), and isValidMsgId().

◆ getMsgName()

StringRef llvm::AMDGPU::SendMsg::getMsgName ( uint64_t  Encoding,
const MCSubtargetInfo STI 
)

Map from an encoding to the symbolic name for a msg_id immediate.

This is doing opposite of getMsgId().

Definition at line 144 of file AMDGPUAsmUtils.cpp.

References llvm::AMDGPU::getNameFromOperandTable(), and MsgOperands.

◆ getMsgOpId()

int64_t llvm::AMDGPU::SendMsg::getMsgOpId ( int64_t  MsgId,
StringRef  Name,
const MCSubtargetInfo STI 
)

Map from a symbolic name for a sendmsg operation to the operation portion of the immediate encoding.

A negative return value indicates that the Name was unknown or unsupported on this target.

Definition at line 148 of file AMDGPUAsmUtils.cpp.

References llvm::AMDGPU::getEncodingFromOperandTable(), ID_SYSMSG, Name, StreamMsgOperands, and SysMsgOperands.

◆ getMsgOpName()

StringRef llvm::AMDGPU::SendMsg::getMsgOpName ( int64_t  MsgId,
uint64_t  Encoding,
const MCSubtargetInfo STI 
)

Map from an encoding to the symbolic name for a sendmsg operation.

This is doing opposite of getMsgOpId().

Definition at line 154 of file AMDGPUAsmUtils.cpp.

References assert(), llvm::AMDGPU::getNameFromOperandTable(), ID_SYSMSG, msgRequiresOp(), StreamMsgOperands, and SysMsgOperands.

Referenced by isValidMsgOp().

◆ isValidMsgId()

LLVM_READNONE bool llvm::AMDGPU::SendMsg::isValidMsgId ( int64_t  MsgId,
const MCSubtargetInfo STI 
)

Definition at line 1881 of file AMDGPUBaseInfo.cpp.

References getMsgIdMask().

Referenced by isValidMsgOp().

◆ isValidMsgOp()

LLVM_READNONE bool llvm::AMDGPU::SendMsg::isValidMsgOp ( int64_t  MsgId,
int64_t  OpId,
const MCSubtargetInfo STI,
bool  Strict 
)

◆ isValidMsgStream()

LLVM_READNONE bool llvm::AMDGPU::SendMsg::isValidMsgStream ( int64_t  MsgId,
int64_t  OpId,
int64_t  StreamId,
const MCSubtargetInfo STI,
bool  Strict 
)

◆ msgRequiresOp()

LLVM_READNONE bool llvm::AMDGPU::SendMsg::msgRequiresOp ( int64_t  MsgId,
const MCSubtargetInfo STI 
)

◆ msgSupportsStream()

LLVM_READNONE bool llvm::AMDGPU::SendMsg::msgSupportsStream ( int64_t  MsgId,
int64_t  OpId,
const MCSubtargetInfo STI 
)

Variable Documentation

◆ MsgOperands

constexpr CustomOperand llvm::AMDGPU::SendMsg::MsgOperands[]
staticconstexpr
Initial value:
= {
{{""}},
{{"MSG_INTERRUPT"}, ID_INTERRUPT},
{{"MSG_GS_DONE"}, ID_GS_DONE_PreGFX11, isNotGFX11Plus},
{{"MSG_SAVEWAVE"}, ID_SAVEWAVE, isGFX8_GFX9_GFX10},
{{"MSG_STALL_WAVE_GEN"}, ID_STALL_WAVE_GEN, isGFX9_GFX10_GFX11},
{{"MSG_HALT_WAVES"}, ID_HALT_WAVES, isGFX9_GFX10_GFX11},
{{"MSG_ORDERED_PS_DONE"}, ID_ORDERED_PS_DONE, isGFX9_GFX10},
{{"MSG_EARLY_PRIM_DEALLOC"}, ID_EARLY_PRIM_DEALLOC, isGFX9_GFX10},
{{"MSG_GS_ALLOC_REQ"}, ID_GS_ALLOC_REQ, isGFX9Plus},
{{"MSG_GET_DOORBELL"}, ID_GET_DOORBELL, isGFX9_GFX10},
{{"MSG_GET_DDID"}, ID_GET_DDID, isGFX10},
{{"MSG_HS_TESSFACTOR"}, ID_HS_TESSFACTOR_GFX11Plus, isGFX11Plus},
{{"MSG_DEALLOC_VGPRS"}, ID_DEALLOC_VGPRS_GFX11Plus, isGFX11Plus},
{{""}},
{{"MSG_SYSMSG"}, ID_SYSMSG},
{{"MSG_RTN_GET_DOORBELL"}, ID_RTN_GET_DOORBELL, isGFX11Plus},
{{"MSG_RTN_GET_DDID"}, ID_RTN_GET_DDID, isGFX11Plus},
{{"MSG_RTN_GET_TMA"}, ID_RTN_GET_TMA, isGFX11Plus},
{{"MSG_RTN_GET_REALTIME"}, ID_RTN_GET_REALTIME, isGFX11Plus},
{{"MSG_RTN_SAVE_WAVE"}, ID_RTN_SAVE_WAVE, isGFX11Plus},
{{"MSG_RTN_GET_TBA"}, ID_RTN_GET_TBA, isGFX11Plus},
{{"MSG_RTN_GET_TBA_TO_PC"}, ID_RTN_GET_TBA_TO_PC, isGFX11Plus},
{{"MSG_RTN_GET_SE_AID_ID"}, ID_RTN_GET_SE_AID_ID, isGFX12Plus},
}
bool isGFX10(const MCSubtargetInfo &STI)
bool isGFX12Plus(const MCSubtargetInfo &STI)
bool isGFX8_GFX9_GFX10(const MCSubtargetInfo &STI)
bool isNotGFX11Plus(const MCSubtargetInfo &STI)
bool isGFX11Plus(const MCSubtargetInfo &STI)
bool isGFX9Plus(const MCSubtargetInfo &STI)
bool isGFX9_GFX10_GFX11(const MCSubtargetInfo &STI)
bool isGFX9_GFX10(const MCSubtargetInfo &STI)

Definition at line 95 of file AMDGPUAsmUtils.cpp.

Referenced by getMsgId(), and getMsgName().

◆ StreamMsgOperands

constexpr CustomOperand llvm::AMDGPU::SendMsg::StreamMsgOperands[]
staticconstexpr
Initial value:
= {
{{"GS_OP_NOP"}, OP_GS_NOP},
{{"GS_OP_CUT"}, OP_GS_CUT},
{{"GS_OP_EMIT"}, OP_GS_EMIT},
{{"GS_OP_EMIT_CUT"}, OP_GS_EMIT_CUT},
}

Definition at line 130 of file AMDGPUAsmUtils.cpp.

Referenced by getMsgOpId(), and getMsgOpName().

◆ SysMsgOperands

constexpr CustomOperand llvm::AMDGPU::SendMsg::SysMsgOperands[]
staticconstexpr
Initial value:
= {
{{""}},
{{"SYSMSG_OP_ECC_ERR_INTERRUPT"}, OP_SYS_ECC_ERR_INTERRUPT},
{{"SYSMSG_OP_REG_RD"}, OP_SYS_REG_RD},
{{"SYSMSG_OP_HOST_TRAP_ACK"}, OP_SYS_HOST_TRAP_ACK, isNotGFX9Plus},
{{"SYSMSG_OP_TTRACE_PC"}, OP_SYS_TTRACE_PC},
}
bool isNotGFX9Plus(const MCSubtargetInfo &STI)

Definition at line 122 of file AMDGPUAsmUtils.cpp.

Referenced by getMsgOpId(), and getMsgOpName().