33 printInstruction(MI, Address, STI, OS);
34 printAnnotation(OS, Annot);
37 void AMDGPUInstPrinter::printU4ImmOperand(
const MCInst *
MI,
unsigned OpNo,
43 void AMDGPUInstPrinter::printU8ImmOperand(
const MCInst *MI,
unsigned OpNo,
48 void AMDGPUInstPrinter::printU16ImmOperand(
const MCInst *MI,
unsigned OpNo,
55 O << formatHex(static_cast<uint64_t>(Imm & 0xffff));
57 printU32ImmOperand(MI, OpNo, STI, O);
60 void AMDGPUInstPrinter::printU4ImmDecOperand(
const MCInst *MI,
unsigned OpNo,
65 void AMDGPUInstPrinter::printU8ImmDecOperand(
const MCInst *MI,
unsigned OpNo,
70 void AMDGPUInstPrinter::printU16ImmDecOperand(
const MCInst *MI,
unsigned OpNo,
75 void AMDGPUInstPrinter::printU32ImmOperand(
const MCInst *MI,
unsigned OpNo,
81 void AMDGPUInstPrinter::printNamedBit(
const MCInst *MI,
unsigned OpNo,
88 void AMDGPUInstPrinter::printOffen(
const MCInst *MI,
unsigned OpNo,
90 printNamedBit(MI, OpNo, O,
"offen");
93 void AMDGPUInstPrinter::printIdxen(
const MCInst *MI,
unsigned OpNo,
95 printNamedBit(MI, OpNo, O,
"idxen");
98 void AMDGPUInstPrinter::printAddr64(
const MCInst *MI,
unsigned OpNo,
100 printNamedBit(MI, OpNo, O,
"addr64");
103 void AMDGPUInstPrinter::printMBUFOffset(
const MCInst *MI,
unsigned OpNo,
107 printU16ImmDecOperand(MI, OpNo, O);
111 void AMDGPUInstPrinter::printOffset(
const MCInst *MI,
unsigned OpNo,
116 O << ((OpNo == 0)?
"offset:" :
" offset:");
117 printU16ImmDecOperand(MI, OpNo, O);
121 void AMDGPUInstPrinter::printFlatOffset(
const MCInst *MI,
unsigned OpNo,
126 O << ((OpNo == 0)?
"offset:" :
" offset:");
132 printU16ImmDecOperand(MI, OpNo, O);
143 void AMDGPUInstPrinter::printOffset0(
const MCInst *MI,
unsigned OpNo,
148 printU8ImmDecOperand(MI, OpNo, O);
152 void AMDGPUInstPrinter::printOffset1(
const MCInst *MI,
unsigned OpNo,
157 printU8ImmDecOperand(MI, OpNo, O);
161 void AMDGPUInstPrinter::printSMRDOffset8(
const MCInst *MI,
unsigned OpNo,
164 printU32ImmOperand(MI, OpNo, STI, O);
167 void AMDGPUInstPrinter::printSMRDOffset20(
const MCInst *MI,
unsigned OpNo,
170 printU32ImmOperand(MI, OpNo, STI, O);
173 void AMDGPUInstPrinter::printSMRDLiteralOffset(
const MCInst *MI,
unsigned OpNo,
176 printU32ImmOperand(MI, OpNo, STI, O);
179 void AMDGPUInstPrinter::printGDS(
const MCInst *MI,
unsigned OpNo,
181 printNamedBit(MI, OpNo, O,
"gds");
184 void AMDGPUInstPrinter::printDLC(
const MCInst *MI,
unsigned OpNo,
187 printNamedBit(MI, OpNo, O,
"dlc");
190 void AMDGPUInstPrinter::printGLC(
const MCInst *MI,
unsigned OpNo,
192 printNamedBit(MI, OpNo, O,
"glc");
195 void AMDGPUInstPrinter::printSLC(
const MCInst *MI,
unsigned OpNo,
197 printNamedBit(MI, OpNo, O,
"slc");
200 void AMDGPUInstPrinter::printSWZ(
const MCInst *MI,
unsigned OpNo,
204 void AMDGPUInstPrinter::printTFE(
const MCInst *MI,
unsigned OpNo,
206 printNamedBit(MI, OpNo, O,
"tfe");
209 void AMDGPUInstPrinter::printDMask(
const MCInst *MI,
unsigned OpNo,
213 printU16ImmOperand(MI, OpNo, STI, O);
217 void AMDGPUInstPrinter::printDim(
const MCInst *MI,
unsigned OpNo,
220 O <<
" dim:SQ_RSRC_IMG_";
229 void AMDGPUInstPrinter::printUNorm(
const MCInst *MI,
unsigned OpNo,
231 printNamedBit(MI, OpNo, O,
"unorm");
234 void AMDGPUInstPrinter::printDA(
const MCInst *MI,
unsigned OpNo,
236 printNamedBit(MI, OpNo, O,
"da");
239 void AMDGPUInstPrinter::printR128A16(
const MCInst *MI,
unsigned OpNo,
242 printNamedBit(MI, OpNo, O,
"a16");
244 printNamedBit(MI, OpNo, O,
"r128");
247 void AMDGPUInstPrinter::printLWE(
const MCInst *MI,
unsigned OpNo,
249 printNamedBit(MI, OpNo, O,
"lwe");
252 void AMDGPUInstPrinter::printD16(
const MCInst *MI,
unsigned OpNo,
254 printNamedBit(MI, OpNo, O,
"d16");
257 void AMDGPUInstPrinter::printExpCompr(
const MCInst *MI,
unsigned OpNo,
264 void AMDGPUInstPrinter::printExpVM(
const MCInst *MI,
unsigned OpNo,
271 void AMDGPUInstPrinter::printFORMAT(
const MCInst *MI,
unsigned OpNo,
276 O <<
" format:" << Val;
278 O <<
" dfmt:" << (Val & 15);
279 O <<
", nfmt:" << (Val >> 4);
290 case AMDGPU::SCRATCH_WAVE_OFFSET_REG:
291 case AMDGPU::PRIVATE_RSRC_REG:
303 void AMDGPUInstPrinter::printVOPDst(
const MCInst *MI,
unsigned OpNo,
322 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx10:
323 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx10:
324 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx10:
325 case AMDGPU::V_ADD_CO_CI_U32_sdwa_gfx10:
326 case AMDGPU::V_SUB_CO_CI_U32_sdwa_gfx10:
327 case AMDGPU::V_SUBREV_CO_CI_U32_sdwa_gfx10:
328 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx10:
329 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx10:
330 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx10:
331 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx10:
332 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx10:
333 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx10:
334 printDefaultVccOperand(1, STI, O);
339 void AMDGPUInstPrinter::printVINTRPDst(
const MCInst *MI,
unsigned OpNo,
349 void AMDGPUInstPrinter::printImmediate16(
uint32_t Imm,
352 int16_t SImm =
static_cast<int16_t
>(Imm);
353 if (SImm >= -16 && SImm <= 64) {
360 else if (Imm == 0xBC00)
362 else if (Imm == 0x3800)
364 else if (Imm == 0xB800)
366 else if (Imm == 0x4000)
368 else if (Imm == 0xC000)
370 else if (Imm == 0x4400)
372 else if (Imm == 0xC400)
374 else if (Imm == 0x3118) {
378 O << formatHex(static_cast<uint64_t>(Imm));
381 void AMDGPUInstPrinter::printImmediateV216(
uint32_t Imm,
385 printImmediate16(Lo16, STI, O);
388 void AMDGPUInstPrinter::printImmediate32(
uint32_t Imm,
391 int32_t SImm =
static_cast<int32_t
>(Imm);
392 if (SImm >= -16 && SImm <= 64) {
415 else if (Imm == 0x3e22f983 &&
419 O << formatHex(static_cast<uint64_t>(Imm));
422 void AMDGPUInstPrinter::printImmediate64(uint64_t Imm,
425 int64_t SImm =
static_cast<int64_t
>(Imm);
426 if (SImm >= -16 && SImm <= 64) {
449 else if (Imm == 0x3fc45f306dc9c882 &&
451 O <<
"0.15915494309189532";
457 O << formatHex(static_cast<uint64_t>(Imm));
461 void AMDGPUInstPrinter::printBLGP(
const MCInst *MI,
unsigned OpNo,
468 O <<
" blgp:" << Imm;
471 void AMDGPUInstPrinter::printCBSZ(
const MCInst *MI,
unsigned OpNo,
478 O <<
" cbsz:" << Imm;
481 void AMDGPUInstPrinter::printABID(
const MCInst *MI,
unsigned OpNo,
488 O <<
" abid:" << Imm;
491 void AMDGPUInstPrinter::printDefaultVccOperand(
unsigned OpNo,
496 printRegOperand(STI.
getFeatureBits()[AMDGPU::FeatureWavefrontSize64] ?
497 AMDGPU::VCC : AMDGPU::VCC_LO,
O,
MRI);
502 void AMDGPUInstPrinter::printOperand(
const MCInst *MI,
unsigned OpNo,
510 printDefaultVccOperand(OpNo, STI, O);
513 O <<
"/*Missing OP" << OpNo <<
"*/";
520 }
else if (Op.
isImm()) {
529 printImmediate32(Op.
getImm(), STI,
O);
535 printImmediate64(Op.
getImm(), STI,
O);
543 printImmediate16(Op.
getImm(), STI,
O);
549 printImmediate32(Op.
getImm(), STI,
O);
557 printImmediateV216(Op.
getImm(), STI,
O);
561 O << formatDec(Op.
getImm());
566 O <<
"/*invalid immediate*/";
583 else if (RCBits == 64)
599 case AMDGPU::V_CNDMASK_B32_e32_gfx10:
600 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx10:
601 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx10:
602 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx10:
603 case AMDGPU::V_CNDMASK_B32_dpp_gfx10:
604 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx10:
605 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx10:
606 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx10:
607 case AMDGPU::V_CNDMASK_B32_dpp8_gfx10:
608 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx10:
609 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx10:
610 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx10:
612 case AMDGPU::V_CNDMASK_B32_e32_gfx6_gfx7:
613 case AMDGPU::V_CNDMASK_B32_e32_vi:
615 AMDGPU::OpName::src1))
616 printDefaultVccOperand(OpNo, STI, O);
621 void AMDGPUInstPrinter::printOperandAndFPInputMods(
const MCInst *MI,
630 bool NegMnemo =
false;
648 if (InputModifiers & SISrcMods::ABS)
656 void AMDGPUInstPrinter::printOperandAndIntInputMods(
const MCInst *MI,
664 if (InputModifiers & SISrcMods::SEXT)
671 case AMDGPU::V_CNDMASK_B32_sdwa_gfx10:
672 case AMDGPU::V_ADD_CO_CI_U32_sdwa_gfx10:
673 case AMDGPU::V_SUB_CO_CI_U32_sdwa_gfx10:
674 case AMDGPU::V_SUBREV_CO_CI_U32_sdwa_gfx10:
676 AMDGPU::OpName::src1))
677 printDefaultVccOperand(OpNo, STI, O);
682 void AMDGPUInstPrinter::printDPP8(
const MCInst *MI,
unsigned OpNo,
689 O <<
" dpp8:[" << formatDec(Imm & 0x7);
690 for (
size_t i = 1; i < 8; ++i) {
691 O << ',' << formatDec((Imm >> (3 * i)) & 0x7);
696 void AMDGPUInstPrinter::printDPPCtrl(
const MCInst *MI,
unsigned OpNo,
704 O << formatDec(Imm & 0x3) <<
',';
705 O << formatDec((Imm & 0xc) >> 2) <<
',';
706 O << formatDec((Imm & 0x30) >> 4) <<
',';
707 O << formatDec((Imm & 0xc0) >> 6) <<
']';
711 printU4ImmDecOperand(MI, OpNo, O);
715 printU4ImmDecOperand(MI, OpNo, O);
719 printU4ImmDecOperand(MI, OpNo, O);
722 O <<
" /* wave_shl is not supported starting from GFX10 */";
728 O <<
" /* wave_rol is not supported starting from GFX10 */";
734 O <<
" /* wave_shr is not supported starting from GFX10 */";
740 O <<
" /* wave_ror is not supported starting from GFX10 */";
747 O <<
" row_half_mirror";
750 O <<
" /* row_bcast is not supported starting from GFX10 */";
753 O <<
" row_bcast:15";
756 O <<
" /* row_bcast is not supported starting from GFX10 */";
759 O <<
" row_bcast:31";
763 O <<
" /* row_share is not supported on ASICs earlier than GFX10 */";
767 printU4ImmDecOperand(MI, OpNo, O);
771 O <<
" /* row_xmask is not supported on ASICs earlier than GFX10 */";
775 printU4ImmDecOperand(MI, OpNo, O);
777 O <<
" /* Invalid dpp_ctrl value */";
781 void AMDGPUInstPrinter::printRowMask(
const MCInst *MI,
unsigned OpNo,
785 printU4ImmOperand(MI, OpNo, STI, O);
788 void AMDGPUInstPrinter::printBankMask(
const MCInst *MI,
unsigned OpNo,
792 printU4ImmOperand(MI, OpNo, STI, O);
795 void AMDGPUInstPrinter::printBoundCtrl(
const MCInst *MI,
unsigned OpNo,
800 O <<
" bound_ctrl:0";
804 void AMDGPUInstPrinter::printFI(
const MCInst *MI,
unsigned OpNo,
814 void AMDGPUInstPrinter::printSDWASel(
const MCInst *MI,
unsigned OpNo,
831 void AMDGPUInstPrinter::printSDWADstSel(
const MCInst *MI,
unsigned OpNo,
835 printSDWASel(MI, OpNo, O);
838 void AMDGPUInstPrinter::printSDWASrc0Sel(
const MCInst *MI,
unsigned OpNo,
842 printSDWASel(MI, OpNo, O);
845 void AMDGPUInstPrinter::printSDWASrc1Sel(
const MCInst *MI,
unsigned OpNo,
849 printSDWASel(MI, OpNo, O);
852 void AMDGPUInstPrinter::printSDWADstUnused(
const MCInst *MI,
unsigned OpNo,
867 template <
unsigned N>
868 void AMDGPUInstPrinter::printExpSrcN(
const MCInst *MI,
unsigned OpNo,
879 if (
N == 1 ||
N == 2)
891 void AMDGPUInstPrinter::printExpSrc0(
const MCInst *MI,
unsigned OpNo,
894 printExpSrcN<0>(
MI, OpNo, STI,
O);
897 void AMDGPUInstPrinter::printExpSrc1(
const MCInst *MI,
unsigned OpNo,
900 printExpSrcN<1>(
MI, OpNo, STI,
O);
903 void AMDGPUInstPrinter::printExpSrc2(
const MCInst *MI,
unsigned OpNo,
906 printExpSrcN<2>(
MI, OpNo, STI,
O);
909 void AMDGPUInstPrinter::printExpSrc3(
const MCInst *MI,
unsigned OpNo,
912 printExpSrcN<3>(
MI, OpNo, STI,
O);
915 void AMDGPUInstPrinter::printExpTgt(
const MCInst *MI,
unsigned OpNo,
927 else if ((Tgt >= 12 && Tgt <= 15) || (Tgt == 16 &&
AMDGPU::isGFX10(STI)))
928 O <<
" pos" << Tgt - 12;
931 else if (Tgt >= 32 && Tgt <= 63)
932 O <<
" param" << Tgt - 32;
935 O <<
" invalid_target_" << Tgt;
943 for (
int I = 0;
I < NumOps; ++
I) {
944 if (!!(Ops[
I] & Mod) != DefaultValue)
954 void AMDGPUInstPrinter::printPackedModifier(
const MCInst *MI,
962 for (
int OpName : { AMDGPU::OpName::src0_modifiers,
963 AMDGPU::OpName::src1_modifiers,
964 AMDGPU::OpName::src2_modifiers }) {
972 const bool HasDstSel =
984 for (
int I = 0;
I < NumOps; ++
I) {
988 O << !!(Ops[
I] & Mod);
998 void AMDGPUInstPrinter::printOpSel(
const MCInst *MI,
unsigned,
1002 if (Opc == AMDGPU::V_PERMLANE16_B32_gfx10 ||
1003 Opc == AMDGPU::V_PERMLANEX16_B32_gfx10) {
1009 O <<
" op_sel:[" << FI <<
',' << BC <<
']';
1016 void AMDGPUInstPrinter::printOpSelHi(
const MCInst *MI,
unsigned OpNo,
1022 void AMDGPUInstPrinter::printNegLo(
const MCInst *MI,
unsigned OpNo,
1028 void AMDGPUInstPrinter::printNegHi(
const MCInst *MI,
unsigned OpNo,
1034 void AMDGPUInstPrinter::printInterpSlot(
const MCInst *MI,
unsigned OpNum,
1049 O <<
"invalid_param_" << Imm;
1053 void AMDGPUInstPrinter::printInterpAttr(
const MCInst *MI,
unsigned OpNum,
1057 O <<
"attr" << Attr;
1060 void AMDGPUInstPrinter::printInterpAttrChan(
const MCInst *MI,
unsigned OpNum,
1064 O <<
'.' <<
"xyzw"[Chan & 0x3];
1067 void AMDGPUInstPrinter::printVGPRIndexMode(
const MCInst *MI,
unsigned OpNo,
1074 O <<
" " << formatHex(static_cast<uint64_t>(Val));
1077 bool NeedComma =
false;
1078 for (
unsigned ModeId =
ID_MIN; ModeId <=
ID_MAX; ++ModeId) {
1079 if (Val & (1 << ModeId)) {
1090 void AMDGPUInstPrinter::printMemOperand(
const MCInst *MI,
unsigned OpNo,
1154 decodeMsg(Imm16, MsgId, OpId, StreamId);
1167 }
else if (
encodeMsg(MsgId, OpId, StreamId) == Imm16) {
1168 O <<
"sendmsg(" << MsgId <<
", " << OpId <<
", " << StreamId <<
')';
1180 uint16_t Probe0 = ((0 & AndMask) | OrMask) ^ XorMask;
1241 O << formatDec(XorMask);
1245 OrMask == 0 && XorMask > 0 &&
1250 O << formatDec(XorMask + 1);
1256 if (GroupSize > 1 &&
1258 OrMask < GroupSize &&
1263 O << formatDec(GroupSize);
1265 O << formatDec(OrMask);
1276 printU16ImmDecOperand(MI, OpNo, O);
1286 unsigned Vmcnt, Expcnt, Lgkmcnt;
1289 bool NeedSpace =
false;
1292 O <<
"vmcnt(" << Vmcnt <<
')';
1299 O <<
"expcnt(" << Expcnt <<
')';
1306 O <<
"lgkmcnt(" << Lgkmcnt <<
')';
1322 if (!HwRegName.
empty()) {
1328 O <<
", " << Offset <<
", " <<
Width;
1341 O <<
' ' << formatDec(Imm);
1344 #include "AMDGPUGenAsmWriter.inc" 1350 printInstruction(MI, Address, O);
1351 printAnnotation(O, Annot);
1362 switch (BankSwizzle) {
1364 O <<
"BS:VEC_021/SCL_122";
1367 O <<
"BS:VEC_120/SCL_212";
1370 O <<
"BS:VEC_102/SCL_221";
1406 if (KCacheMode > 0) {
1408 O <<
"CB" << KCacheBank <<
':';
1410 int LineSize = (KCacheMode == 1) ? 16 : 32;
1411 O << KCacheAddr * 16 <<
'-' << KCacheAddr * 16 + LineSize;
1425 int64_t Imm = Op.
getImm();
1464 O <<
"/*Missing OP" << OpNo <<
"*/";
1472 case R600::PRED_SEL_OFF:
1479 }
else if (Op.
isImm()) {
1488 }
else if (Op.
isExpr()) {
1490 Exp->
print(O, &MAI);
1549 #include "R600GenAsmWriter.inc"
constexpr bool isUInt< 32 >(uint64_t x)
void printUpdatePred(const MCInst *MI, unsigned OpNo, raw_ostream &O)
This class represents lattice values for constants.
unsigned getExpcntBitMask(const IsaVersion &Version)
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
Describe properties that are true of each instruction in the target description file.
static bool allOpsDefaultValue(const int *Ops, int NumOps, int Mod, bool IsPacked, bool HasDstSel)
void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &O) override
Print the specified MCInst to the specified raw_ostream.
uint64_t encodeMsg(uint64_t MsgId, uint64_t OpId, uint64_t StreamId)
unsigned getRegBitWidth(unsigned RCID)
Get the size in bits of a register from the register class RC.
float BitsToFloat(uint32_t Bits)
This function takes a 32-bit integer and returns the bit equivalent float.
Instruction set architecture version.
static void printIfSet(const MCInst *MI, unsigned OpNo, raw_ostream &O, StringRef Asm, StringRef Default="")
void printUpdateExecMask(const MCInst *MI, unsigned OpNo, raw_ostream &O)
constexpr bool isInt< 16 >(int64_t x)
bool isValidMsgOp(int64_t MsgId, int64_t OpId, bool Strict)
LLVM_READONLY int16_t getNamedOperandIdx(uint16_t Opcode, uint16_t NamedIdx)
void printWaitFlag(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
const FeatureBitset & getFeatureBits() const
static void printRegOperand(unsigned RegNo, raw_ostream &O, const MCRegisterInfo &MRI)
Base class for the full range of assembler expressions which are needed for parsing.
void printEndpgm(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
LLVM_READONLY const MIMGDimInfo * getMIMGDimInfoByEncoding(uint8_t DimEnc)
StringRef getMsgOpName(int64_t MsgId, int64_t OpId)
void printOModSI(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
void printLast(const MCInst *MI, unsigned OpNo, raw_ostream &O)
unsigned getReg() const
Returns the register number.
void printRel(const MCInst *MI, unsigned OpNo, raw_ostream &O)
uint8_t OperandType
Information about the type of the operand.
static std::string getRegisterName(const TargetRegisterInfo *TRI, unsigned Reg)
void printKCache(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printCT(const MCInst *MI, unsigned OpNo, raw_ostream &O)
const MCExpr * getExpr() const
Instances of this class represent a single low-level machine instruction.
uint32_t FloatToBits(float Float)
This function takes a float and returns the bit equivalent 32-bit integer.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
void decodeHwreg(unsigned Val, unsigned &Id, unsigned &Offset, unsigned &Width)
void printBankSwizzle(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens=false) const
bool isSI(const MCSubtargetInfo &STI)
unsigned const MachineRegisterInfo * MRI
bool isGFX10(const MCSubtargetInfo &STI)
StringRef getHwreg(unsigned Id, const MCSubtargetInfo &STI)
void printNeg(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printAbs(const MCInst *MI, unsigned OpNo, raw_ostream &O)
const char *const IdSymbolic[]
void printHwreg(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
constexpr bool isPowerOf2_64(uint64_t Value)
Return true if the argument is a power of two > 0 (64 bit edition.)
void printMemOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printClampSI(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
unsigned getNumOperands() const
void printLiteral(const MCInst *MI, unsigned OpNo, raw_ostream &O)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
IsaVersion getIsaVersion(StringRef GPU)
void printWrite(const MCInst *MI, unsigned OpNo, raw_ostream &O)
unsigned countPopulation(T Value)
Count the number of set bits in a value.
void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)
Operands with register or 32-bit immediate.
const MCOperand & getOperand(unsigned i) const
void printClamp(const MCInst *MI, unsigned OpNo, raw_ostream &O)
bool isValidMsgStream(int64_t MsgId, int64_t OpId, int64_t StreamId, bool Strict)
uint64_t DoubleToBits(double Double)
This function takes a double and returns the bit equivalent 64-bit integer.
The access may modify the value stored in memory.
bool msgSupportsStream(int64_t MsgId, int64_t OpId)
bool msgRequiresOp(int64_t MsgId)
bool isCI(const MCSubtargetInfo &STI)
void printSwizzle(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
bool isGFX9(const MCSubtargetInfo &STI)
Provides AMDGPU specific target descriptions.
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &O) override
Print the specified MCInst to the specified raw_ostream.
bool isVI(const MCSubtargetInfo &STI)
int16_t RegClass
This specifies the register class enumeration of the operand if the operand is a register.
void printRSel(const MCInst *MI, unsigned OpNo, raw_ostream &O)
bool hasFeature(unsigned Feature) const
static void printSwizzleBitmask(const uint16_t AndMask, const uint16_t OrMask, const uint16_t XorMask, raw_ostream &O)
Generic base class for all target subtargets.
Operands with register or inline constant.
constexpr bool isUInt< 16 >(uint64_t x)
void printOMOD(const MCInst *MI, unsigned OpNo, raw_ostream &O)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void decodeMsg(unsigned Val, uint16_t &MsgId, uint16_t &OpId, uint16_t &StreamId)
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
const MCOperandInfo * OpInfo
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
static bool isValidMsgId(int64_t MsgId)
This class implements an extremely fast bulk output stream that can only output to a stream...
void printHigh(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
StringRef - Represent a constant reference to a string, i.e.
unsigned getLgkmcntBitMask(const IsaVersion &Version)
Operands with an AccVGPR register or inline constant.
unsigned getOpcode() const
bool hasImplicitDefOfPhysReg(unsigned Reg, const MCRegisterInfo *MRI=nullptr) const
Return true if this instruction implicitly defines the specified physical register.
Instances of this class represent operands of the MCInst class.
StringRef getMsgName(int64_t MsgId)
void printSendMsg(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
unsigned getVmcntBitMask(const IsaVersion &Version)
void decodeWaitcnt(const IsaVersion &Version, unsigned Waitcnt, unsigned &Vmcnt, unsigned &Expcnt, unsigned &Lgkmcnt)
Decodes Vmcnt, Expcnt and Lgkmcnt from given Waitcnt for given isa Version, and writes decoded values...