51void AMDGPUInstPrinter::printU16ImmOperand(
const MCInst *
MI,
unsigned OpNo,
62 int64_t
Imm =
Op.getImm();
64 O << formatHex(static_cast<uint64_t>(
Imm & 0xffff));
66 printU32ImmOperand(
MI, OpNo, STI, O);
69void AMDGPUInstPrinter::printU16ImmDecOperand(
const MCInst *
MI,
unsigned OpNo,
74void AMDGPUInstPrinter::printU32ImmOperand(
const MCInst *
MI,
unsigned OpNo,
77 const MCOperand &
Op =
MI->getOperand(OpNo);
79 MAI.printExpr(O, *
Op.getExpr());
86void AMDGPUInstPrinter::printFP64ImmOperand(
const MCInst *
MI,
unsigned OpNo,
90 const MCOperand &
Op =
MI->getOperand(OpNo);
92 MAI.printExpr(O, *
Op.getExpr());
96 printLiteral64(
Op.getImm(), O,
true);
99void AMDGPUInstPrinter::printNamedBit(
const MCInst *
MI,
unsigned OpNo,
101 if (
MI->getOperand(OpNo).getImm()) {
106void AMDGPUInstPrinter::printOffset(
const MCInst *
MI,
unsigned OpNo,
109 uint32_t
Imm =
MI->getOperand(OpNo).getImm();
116 O << formatDec(SignExtend32<24>(
Imm));
118 printU16ImmDecOperand(
MI, OpNo, O);
122void AMDGPUInstPrinter::printFlatOffset(
const MCInst *
MI,
unsigned OpNo,
125 uint32_t
Imm =
MI->getOperand(OpNo).getImm();
130 STI.
hasFeature(AMDGPU::FeatureFlatSignedOffset);
135 printU16ImmDecOperand(
MI, OpNo, O);
139void AMDGPUInstPrinter::printSMRDOffset8(
const MCInst *
MI,
unsigned OpNo,
142 printU32ImmOperand(
MI, OpNo, STI, O);
145void AMDGPUInstPrinter::printSMEMOffset(
const MCInst *
MI,
unsigned OpNo,
151void AMDGPUInstPrinter::printSMEMOffsetPCRel(
const MCInst *
MI,
unsigned OpNo,
154 const MCOperand &
Op =
MI->getOperand(OpNo);
156 MAI.printExpr(O, *
Op.getExpr());
162void AMDGPUInstPrinter::printSMRDLiteralOffset(
const MCInst *
MI,
unsigned OpNo,
165 printU32ImmOperand(
MI, OpNo, STI, O);
168void AMDGPUInstPrinter::printCPol(
const MCInst *
MI,
unsigned OpNo,
170 auto Imm =
MI->getOperand(OpNo).getImm();
177 O <<
" scale_offset";
179 printTH(
MI, TH, Scope, O);
180 printScope(Scope, O);
185 if (STI.
hasFeature(AMDGPU::FeatureCacheFillSize)) {
203 O <<
" /* unexpected cache policy bit */";
206void AMDGPUInstPrinter::printTH(
const MCInst *
MI, int64_t TH, int64_t Scope,
212 const unsigned Opcode =
MI->getOpcode();
213 const MCInstrDesc &TID =
MII.get(Opcode);
236 O << (IsStore ?
"TH_STORE_" :
"TH_LOAD_");
246 : (IsStore ?
"WB" :
"LU"));
267void AMDGPUInstPrinter::printScope(int64_t Scope,
raw_ostream &O) {
283void AMDGPUInstPrinter::printCFS(int64_t CFS,
raw_ostream &O) {
304void AMDGPUInstPrinter::printDim(
const MCInst *
MI,
unsigned OpNo,
306 unsigned Dim =
MI->getOperand(OpNo).getImm();
307 O <<
" dim:SQ_RSRC_IMG_";
316void AMDGPUInstPrinter::printR128A16(
const MCInst *
MI,
unsigned OpNo,
319 printNamedBit(
MI, OpNo, O,
"a16");
321 printNamedBit(
MI, OpNo, O,
"r128");
324void AMDGPUInstPrinter::printFormat(
const MCInst *
MI,
unsigned OpNo,
327 using namespace llvm::AMDGPU::MTBUFFormat;
329 unsigned Val =
MI->getOperand(OpNo).getImm();
331 if (Val == UFMT_DEFAULT)
336 O <<
" format:" << Val;
339 if (Val == DFMT_NFMT_DEFAULT)
346 if (Dfmt != DFMT_DEFAULT) {
348 if (Nfmt != NFMT_DEFAULT) {
352 if (Nfmt != NFMT_DEFAULT) {
357 O <<
" format:" << Val;
365 unsigned Enc =
MRI.getEncodingValue(
Reg);
370 unsigned RegNo =
Idx % 0x100;
372 if (RC->
getID() == AMDGPU::VGPR_16RegClassID) {
391 unsigned Enc =
MRI.getEncodingValue(
Reg);
398 unsigned Opc =
Desc.getOpcode();
400 for (
I = 0;
I < 4; ++
I) {
401 if (
Ops.first[
I] != AMDGPU::OpName::NUM_OPERAND_NAMES &&
402 (
unsigned)AMDGPU::getNamedOperandIdx(
Opc,
Ops.first[
I]) == OpNo)
404 if (
Ops.second &&
Ops.second[
I] != AMDGPU::OpName::NUM_OPERAND_NAMES &&
405 (
unsigned)AMDGPU::getNamedOperandIdx(
Opc,
Ops.second[
I]) == OpNo)
410 unsigned OpMSBs = (VgprMSBs >> (
I * 2)) & 3;
418void AMDGPUInstPrinter::printRsrcReg(
const MCInst *
MI,
unsigned OpNo,
421 MCRegister
Reg =
MI->getOperand(OpNo).getReg();
436 case AMDGPU::PRIVATE_RSRC_REG:
459void AMDGPUInstPrinter::printVOPDst(
const MCInst *
MI,
unsigned OpNo,
461 auto Opcode =
MI->getOpcode();
478 printRegularOperand(
MI, OpNo, STI, O);
484 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx10:
485 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx10:
486 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx10:
487 case AMDGPU::V_ADD_CO_CI_U32_sdwa_gfx10:
488 case AMDGPU::V_SUB_CO_CI_U32_sdwa_gfx10:
489 case AMDGPU::V_SUBREV_CO_CI_U32_sdwa_gfx10:
490 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx10:
491 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx10:
492 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx10:
493 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx10:
494 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx10:
495 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx10:
496 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx11:
497 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx11:
498 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx11:
499 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx11:
500 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx11:
501 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx11:
502 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx11:
503 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx11:
504 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx11:
505 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx12:
506 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx12:
507 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx12:
508 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx12:
509 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx12:
510 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx12:
511 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx12:
512 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx12:
513 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx12:
514 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx13:
515 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx13:
516 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx13:
517 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx13:
518 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx13:
519 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx13:
520 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx13:
521 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx13:
522 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx13:
523 printDefaultVccOperand(
false, STI, O);
528void AMDGPUInstPrinter::printVINTRPDst(
const MCInst *
MI,
unsigned OpNo,
535 printRegularOperand(
MI, OpNo, STI, O);
538void AMDGPUInstPrinter::printAVLdSt32Align2RegOp(
const MCInst *
MI,
542 MCRegister
Reg =
MI->getOperand(OpNo).getReg();
545 if (MCRegister SubReg =
MRI.getSubReg(
Reg, AMDGPU::sub0))
550void AMDGPUInstPrinter::printImmediateInt16(uint32_t
Imm,
553 int32_t SImm =
static_cast<int32_t
>(
Imm);
559 if (printImmediateFloat32(
Imm, STI, O))
562 O << formatHex(static_cast<uint64_t>(
Imm & 0xffff));
569 else if (
Imm == 0xBC00)
571 else if (
Imm == 0x3800)
573 else if (
Imm == 0xB800)
575 else if (
Imm == 0x4000)
577 else if (
Imm == 0xC000)
579 else if (
Imm == 0x4400)
581 else if (
Imm == 0xC400)
583 else if (
Imm == 0x3118 && STI.
hasFeature(AMDGPU::FeatureInv2PiInlineImm))
595 else if (
Imm == 0xBF80)
597 else if (
Imm == 0x3F00)
599 else if (
Imm == 0xBF00)
601 else if (
Imm == 0x4000)
603 else if (
Imm == 0xC000)
605 else if (
Imm == 0x4080)
607 else if (
Imm == 0xC080)
609 else if (
Imm == 0x3E22 && STI.
hasFeature(AMDGPU::FeatureInv2PiInlineImm))
617void AMDGPUInstPrinter::printImmediateBF16(uint32_t
Imm,
620 int16_t SImm =
static_cast<int16_t
>(
Imm);
629 O << formatHex(static_cast<uint64_t>(
Imm & 0xffff));
632void AMDGPUInstPrinter::printImmediateF16(uint32_t
Imm,
635 int16_t SImm =
static_cast<int16_t
>(
Imm);
641 uint16_t HImm =
static_cast<uint16_t
>(
Imm);
649void AMDGPUInstPrinter::printImmediateV216(uint32_t
Imm, uint8_t OpType,
652 int32_t SImm =
static_cast<int32_t
>(
Imm);
661 if (printImmediateFloat32(
Imm, STI, O))
675 uint16_t
Lo16 =
static_cast<uint16_t
>(
Imm & 0xFFFF);
676 uint16_t
Hi16 =
static_cast<uint16_t
>((
Imm >> 16) & 0xFFFF);
701 O << formatHex(static_cast<uint64_t>(
Imm));
704bool AMDGPUInstPrinter::printImmediateFloat32(uint32_t
Imm,
725 else if (
Imm == 0x3e22f983 &&
726 STI.
hasFeature(AMDGPU::FeatureInv2PiInlineImm))
734void AMDGPUInstPrinter::printImmediate32(uint32_t
Imm,
737 int32_t SImm =
static_cast<int32_t
>(
Imm);
743 if (printImmediateFloat32(
Imm, STI, O))
746 O << formatHex(static_cast<uint64_t>(
Imm));
749void AMDGPUInstPrinter::printImmediate64(
uint64_t Imm,
752 int64_t SImm =
static_cast<int64_t
>(
Imm);
753 if (SImm >= -16 && SImm <= 64) {
776 else if (
Imm == 0x3fc45f306dc9c882 &&
777 STI.
hasFeature(AMDGPU::FeatureInv2PiInlineImm))
778 O <<
"0.15915494309189532";
780 printLiteral64(
Imm, O, IsFP);
786 O << formatHex(static_cast<uint64_t>(
Hi_32(
Imm)));
791void AMDGPUInstPrinter::printBLGP(
const MCInst *
MI,
unsigned OpNo,
794 unsigned Imm =
MI->getOperand(OpNo).getImm();
799 switch (
MI->getOpcode()) {
800 case AMDGPU::V_MFMA_F64_16X16X4F64_gfx940_acd:
801 case AMDGPU::V_MFMA_F64_16X16X4F64_gfx940_vcd:
802 case AMDGPU::V_MFMA_F64_4X4X4F64_gfx940_acd:
803 case AMDGPU::V_MFMA_F64_4X4X4F64_gfx940_vcd:
804 O <<
" neg:[" << (
Imm & 1) <<
',' << ((
Imm >> 1) & 1) <<
','
805 << ((
Imm >> 2) & 1) <<
']';
810 O <<
" blgp:" <<
Imm;
813void AMDGPUInstPrinter::printDefaultVccOperand(
bool FirstOperand,
827 unsigned OpNo)
const {
830 (
Desc.hasImplicitDefOfPhysReg(AMDGPU::VCC) ||
831 Desc.hasImplicitDefOfPhysReg(AMDGPU::VCC_LO));
835void AMDGPUInstPrinter::printOperand(
const MCInst *
MI,
unsigned OpNo,
838 unsigned Opc =
MI->getOpcode();
840 int ModIdx = AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::src0_modifiers);
846 (
Desc.hasImplicitDefOfPhysReg(AMDGPU::VCC) ||
847 Desc.hasImplicitDefOfPhysReg(AMDGPU::VCC_LO)))
848 printDefaultVccOperand(
true, STI, O);
850 printRegularOperand(
MI, OpNo, STI, O);
854void AMDGPUInstPrinter::printRegularOperand(
const MCInst *
MI,
unsigned OpNo,
857 const MCInstrDesc &
Desc =
MII.get(
MI->getOpcode());
859 if (OpNo >=
MI->getNumOperands()) {
860 O <<
"/*Missing OP" << OpNo <<
"*/";
864 const MCOperand &
Op =
MI->getOperand(OpNo);
871 const MCOperandInfo &OpInfo =
Desc.operands()[OpNo];
873 int16_t RCID =
MII.getOpRegClassID(
875 const MCRegisterClass &RC =
MRI.getRegClass(RCID);
879 (OpInfo.
RegClass == AMDGPU::SReg_1 ||
880 OpInfo.
RegClass == AMDGPU::SReg_1_XEXEC);
887 O <<
"/*Invalid register, operand has \'" <<
MRI.getRegClassName(&RC)
888 <<
"\' register class*/";
892 }
else if (
Op.isImm()) {
893 const uint8_t OpTy =
Desc.operands()[OpNo].OperandType;
905 printImmediate32(
Op.getImm(), STI, O);
910 printImmediate64(
Op.getImm(), STI, O,
false);
916 printImmediate64(
Op.getImm(), STI, O,
true);
920 printImmediateInt16(
Op.getImm(), STI, O);
925 printImmediateF16(
Op.getImm(), STI, O);
929 printImmediateBF16(
Op.getImm(), STI, O);
939 printImmediateV216(
Op.getImm(), OpTy, STI, O);
948 printImmediate32(
Op.getImm(), STI, O);
949 O <<
"/*Invalid immediate*/";
956 }
else if (
Op.isExpr()) {
957 const MCExpr *
Exp =
Op.getExpr();
958 MAI.printExpr(O, *Exp);
964 switch (
MI->getOpcode()) {
967 case AMDGPU::V_CNDMASK_B32_e32_gfx10:
968 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx10:
969 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx10:
970 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx10:
971 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx10:
972 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx10:
973 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx10:
974 case AMDGPU::V_CNDMASK_B32_dpp8_gfx10:
975 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx10:
976 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx10:
977 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx10:
978 case AMDGPU::V_CNDMASK_B32_e32_gfx11:
979 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx11:
980 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx11:
981 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx11:
982 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx11:
983 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx11:
984 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx11:
985 case AMDGPU::V_CNDMASK_B32_dpp8_gfx11:
986 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx11:
987 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx11:
988 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx11:
989 case AMDGPU::V_CNDMASK_B32_e32_gfx12:
990 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx12:
991 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx12:
992 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx12:
993 case AMDGPU::V_CNDMASK_B32_dpp_gfx12:
994 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx12:
995 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx12:
996 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx12:
997 case AMDGPU::V_CNDMASK_B32_dpp8_gfx12:
998 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx12:
999 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx12:
1000 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx12:
1001 case AMDGPU::V_CNDMASK_B32_e32_gfx13:
1002 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx13:
1003 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx13:
1004 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx13:
1005 case AMDGPU::V_CNDMASK_B32_dpp_gfx13:
1006 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx13:
1007 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx13:
1008 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx13:
1009 case AMDGPU::V_CNDMASK_B32_dpp8_gfx13:
1010 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx13:
1011 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx13:
1012 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx13:
1014 case AMDGPU::V_CNDMASK_B32_e32_gfx6_gfx7:
1015 case AMDGPU::V_CNDMASK_B32_e32_vi:
1016 if ((
int)OpNo == AMDGPU::getNamedOperandIdx(
MI->getOpcode(),
1017 AMDGPU::OpName::src1))
1018 printDefaultVccOperand(OpNo == 0, STI, O);
1023void AMDGPUInstPrinter::printOperandAndFPInputMods(
const MCInst *
MI,
1027 const MCInstrDesc &
Desc =
MII.get(
MI->getOpcode());
1028 if (needsImpliedVcc(
Desc, OpNo))
1029 printDefaultVccOperand(
true, STI, O);
1031 unsigned InputModifiers =
MI->getOperand(OpNo).getImm();
1036 bool NegMnemo =
false;
1039 if (OpNo + 1 <
MI->getNumOperands() &&
1041 const MCOperand &
Op =
MI->getOperand(OpNo + 1);
1042 NegMnemo =
Op.isImm();
1053 printRegularOperand(
MI, OpNo + 1, STI, O);
1062 switch (
MI->getOpcode()) {
1066 case AMDGPU::V_CNDMASK_B32_sdwa_gfx10:
1067 case AMDGPU::V_CNDMASK_B32_dpp_gfx10:
1068 case AMDGPU::V_CNDMASK_B32_dpp_gfx11:
1069 if ((
int)OpNo + 1 ==
1070 AMDGPU::getNamedOperandIdx(
MI->getOpcode(), AMDGPU::OpName::src1))
1071 printDefaultVccOperand(OpNo == 0, STI, O);
1076void AMDGPUInstPrinter::printOperandAndIntInputMods(
const MCInst *
MI,
1080 const MCInstrDesc &
Desc =
MII.get(
MI->getOpcode());
1081 if (needsImpliedVcc(
Desc, OpNo))
1082 printDefaultVccOperand(
true, STI, O);
1084 unsigned InputModifiers =
MI->getOperand(OpNo).getImm();
1087 printRegularOperand(
MI, OpNo + 1, STI, O);
1092 switch (
MI->getOpcode()) {
1095 case AMDGPU::V_ADD_CO_CI_U32_sdwa_gfx10:
1096 case AMDGPU::V_SUB_CO_CI_U32_sdwa_gfx10:
1097 case AMDGPU::V_SUBREV_CO_CI_U32_sdwa_gfx10:
1098 if ((
int)OpNo + 1 == AMDGPU::getNamedOperandIdx(
MI->getOpcode(),
1099 AMDGPU::OpName::src1))
1100 printDefaultVccOperand(OpNo == 0, STI, O);
1105void AMDGPUInstPrinter::printDPP8(
const MCInst *
MI,
unsigned OpNo,
1111 unsigned Imm =
MI->getOperand(OpNo).getImm();
1113 for (
size_t i = 1; i < 8; ++i) {
1119void AMDGPUInstPrinter::printDPPCtrl(
const MCInst *
MI,
unsigned OpNo,
1122 using namespace AMDGPU::DPP;
1124 unsigned Imm =
MI->getOperand(OpNo).getImm();
1125 const MCInstrDesc &
Desc =
MII.get(
MI->getOpcode());
1130 O <<
" /* DP ALU dpp only supports "
1131 << (
isGFX12(STI) ?
"row_share" :
"row_newbcast") <<
" */";
1134 if (
Imm <= DppCtrl::QUAD_PERM_LAST) {
1140 }
else if ((
Imm >= DppCtrl::ROW_SHL_FIRST) &&
1141 (
Imm <= DppCtrl::ROW_SHL_LAST)) {
1143 }
else if ((
Imm >= DppCtrl::ROW_SHR_FIRST) &&
1144 (
Imm <= DppCtrl::ROW_SHR_LAST)) {
1146 }
else if ((
Imm >= DppCtrl::ROW_ROR_FIRST) &&
1147 (
Imm <= DppCtrl::ROW_ROR_LAST)) {
1149 }
else if (
Imm == DppCtrl::WAVE_SHL1) {
1151 O <<
"/* wave_shl is not supported starting from GFX10 */";
1155 }
else if (
Imm == DppCtrl::WAVE_ROL1) {
1157 O <<
"/* wave_rol is not supported starting from GFX10 */";
1161 }
else if (
Imm == DppCtrl::WAVE_SHR1) {
1163 O <<
"/* wave_shr is not supported starting from GFX10 */";
1167 }
else if (
Imm == DppCtrl::WAVE_ROR1) {
1169 O <<
"/* wave_ror is not supported starting from GFX10 */";
1173 }
else if (
Imm == DppCtrl::ROW_MIRROR) {
1175 }
else if (
Imm == DppCtrl::ROW_HALF_MIRROR) {
1176 O <<
"row_half_mirror";
1177 }
else if (
Imm == DppCtrl::BCAST15) {
1179 O <<
"/* row_bcast is not supported starting from GFX10 */";
1182 O <<
"row_bcast:15";
1183 }
else if (
Imm == DppCtrl::BCAST31) {
1185 O <<
"/* row_bcast is not supported starting from GFX10 */";
1188 O <<
"row_bcast:31";
1189 }
else if ((
Imm >= DppCtrl::ROW_SHARE_FIRST) &&
1190 (
Imm <= DppCtrl::ROW_SHARE_LAST)) {
1192 O <<
"row_newbcast:";
1196 O <<
" /* row_newbcast/row_share is not supported on ASICs earlier "
1197 "than GFX90A/GFX10 */";
1201 }
else if ((
Imm >= DppCtrl::ROW_XMASK_FIRST) &&
1202 (
Imm <= DppCtrl::ROW_XMASK_LAST)) {
1204 O <<
"/* row_xmask is not supported on ASICs earlier than GFX10 */";
1207 O <<
"row_xmask:" <<
formatDec(
Imm - DppCtrl::ROW_XMASK_FIRST);
1209 O <<
"/* Invalid dpp_ctrl value */";
1213void AMDGPUInstPrinter::printDppBoundCtrl(
const MCInst *
MI,
unsigned OpNo,
1216 unsigned Imm =
MI->getOperand(OpNo).getImm();
1218 O <<
" bound_ctrl:1";
1222void AMDGPUInstPrinter::printDppFI(
const MCInst *
MI,
unsigned OpNo,
1224 using namespace llvm::AMDGPU::DPP;
1225 unsigned Imm =
MI->getOperand(OpNo).getImm();
1226 if (
Imm == DPP_FI_1 ||
Imm == DPP8_FI_1) {
1231void AMDGPUInstPrinter::printSDWASel(
const MCInst *
MI,
unsigned OpNo,
1233 using namespace llvm::AMDGPU::SDWA;
1235 unsigned Imm =
MI->getOperand(OpNo).getImm();
1237 case SdwaSel::BYTE_0:
O <<
"BYTE_0";
break;
1238 case SdwaSel::BYTE_1:
O <<
"BYTE_1";
break;
1239 case SdwaSel::BYTE_2:
O <<
"BYTE_2";
break;
1240 case SdwaSel::BYTE_3:
O <<
"BYTE_3";
break;
1241 case SdwaSel::WORD_0:
O <<
"WORD_0";
break;
1242 case SdwaSel::WORD_1:
O <<
"WORD_1";
break;
1243 case SdwaSel::DWORD:
O <<
"DWORD";
break;
1248void AMDGPUInstPrinter::printSDWADstSel(
const MCInst *
MI,
unsigned OpNo,
1252 printSDWASel(
MI, OpNo, O);
1255void AMDGPUInstPrinter::printSDWASrc0Sel(
const MCInst *
MI,
unsigned OpNo,
1259 printSDWASel(
MI, OpNo, O);
1262void AMDGPUInstPrinter::printSDWASrc1Sel(
const MCInst *
MI,
unsigned OpNo,
1266 printSDWASel(
MI, OpNo, O);
1269void AMDGPUInstPrinter::printSDWADstUnused(
const MCInst *
MI,
unsigned OpNo,
1272 using namespace llvm::AMDGPU::SDWA;
1275 unsigned Imm =
MI->getOperand(OpNo).getImm();
1277 case DstUnused::UNUSED_PAD:
O <<
"UNUSED_PAD";
break;
1278 case DstUnused::UNUSED_SEXT:
O <<
"UNUSED_SEXT";
break;
1279 case DstUnused::UNUSED_PRESERVE:
O <<
"UNUSED_PRESERVE";
break;
1284void AMDGPUInstPrinter::printExpSrcN(
const MCInst *
MI,
unsigned OpNo,
1287 unsigned Opc =
MI->getOpcode();
1288 int EnIdx = AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::en);
1289 unsigned En =
MI->getOperand(EnIdx).getImm();
1291 int ComprIdx = AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::compr);
1294 if (
MI->getOperand(ComprIdx).getImm())
1295 OpNo = OpNo -
N +
N / 2;
1303void AMDGPUInstPrinter::printExpSrc0(
const MCInst *
MI,
unsigned OpNo,
1306 printExpSrcN(
MI, OpNo, STI, O, 0);
1309void AMDGPUInstPrinter::printExpSrc1(
const MCInst *
MI,
unsigned OpNo,
1312 printExpSrcN(
MI, OpNo, STI, O, 1);
1315void AMDGPUInstPrinter::printExpSrc2(
const MCInst *
MI,
unsigned OpNo,
1318 printExpSrcN(
MI, OpNo, STI, O, 2);
1321void AMDGPUInstPrinter::printExpSrc3(
const MCInst *
MI,
unsigned OpNo,
1324 printExpSrcN(
MI, OpNo, STI, O, 3);
1327void AMDGPUInstPrinter::printExpTgt(
const MCInst *
MI,
unsigned OpNo,
1330 using namespace llvm::AMDGPU::Exp;
1333 unsigned Id =
MI->getOperand(OpNo).getImm() & ((1 << 6) - 1);
1338 O <<
' ' << TgtName;
1342 O <<
" invalid_target_" <<
Id;
1347 bool IsPacked,
bool HasDstSel) {
1351 if (!!(
Ops[
I] &
Mod) != DefaultValue)
1361void AMDGPUInstPrinter::printPackedModifier(
const MCInst *
MI,
1365 unsigned Opc =
MI->getOpcode();
1369 std::pair<AMDGPU::OpName, AMDGPU::OpName> MOps[] = {
1370 {AMDGPU::OpName::src0_modifiers, AMDGPU::OpName::src0},
1371 {AMDGPU::OpName::src1_modifiers, AMDGPU::OpName::src1},
1372 {AMDGPU::OpName::src2_modifiers, AMDGPU::OpName::src2}};
1375 for (
auto [SrcMod, Src] : MOps) {
1379 int ModIdx = AMDGPU::getNamedOperandIdx(
Opc, SrcMod);
1381 (ModIdx != -1) ?
MI->getOperand(ModIdx).getImm() : DefaultValue;
1390 AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::src2_modifiers);
1396 (AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::vdst) != -1) ||
1397 (AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::sdst) != -1);
1404 for (AMDGPU::OpName OpName :
1405 {AMDGPU::OpName::src0_modifiers, AMDGPU::OpName::src1_modifiers,
1406 AMDGPU::OpName::src2_modifiers}) {
1407 int Idx = AMDGPU::getNamedOperandIdx(
Opc, OpName);
1424 ListSeparator Sep(
",");
1435void AMDGPUInstPrinter::printOpSel(
const MCInst *
MI,
unsigned,
1438 unsigned Opc =
MI->getOpcode();
1441 AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::src0_modifiers);
1442 unsigned Mod =
MI->getOperand(SrcMod).getImm();
1445 if (Index0 || Index1)
1446 O <<
" op_sel:[" << Index0 <<
',' << Index1 <<
']';
1450 auto FIN = AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::src0_modifiers);
1451 auto BCN = AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::src1_modifiers);
1455 O <<
" op_sel:[" << FI <<
',' << BC <<
']';
1462void AMDGPUInstPrinter::printOpSelHi(
const MCInst *
MI,
unsigned OpNo,
1468void AMDGPUInstPrinter::printNegLo(
const MCInst *
MI,
unsigned OpNo,
1474void AMDGPUInstPrinter::printNegHi(
const MCInst *
MI,
unsigned OpNo,
1480void AMDGPUInstPrinter::printIndexKey8bit(
const MCInst *
MI,
unsigned OpNo,
1483 auto Imm =
MI->getOperand(OpNo).getImm() & 0x7;
1487 O <<
" index_key:" <<
Imm;
1490void AMDGPUInstPrinter::printIndexKey16bit(
const MCInst *
MI,
unsigned OpNo,
1493 auto Imm =
MI->getOperand(OpNo).getImm() & 0x7;
1497 O <<
" index_key:" <<
Imm;
1500void AMDGPUInstPrinter::printIndexKey32bit(
const MCInst *
MI,
unsigned OpNo,
1503 auto Imm =
MI->getOperand(OpNo).getImm() & 0x7;
1507 O <<
" index_key:" <<
Imm;
1510void AMDGPUInstPrinter::printMatrixFMT(
const MCInst *
MI,
unsigned OpNo,
1513 auto Imm =
MI->getOperand(OpNo).getImm() & 0x7;
1517 O <<
" matrix_" << AorB <<
"_fmt:";
1524void AMDGPUInstPrinter::printMatrixAFMT(
const MCInst *
MI,
unsigned OpNo,
1527 printMatrixFMT(
MI, OpNo, STI, O,
'a');
1530void AMDGPUInstPrinter::printMatrixBFMT(
const MCInst *
MI,
unsigned OpNo,
1533 printMatrixFMT(
MI, OpNo, STI, O,
'b');
1536void AMDGPUInstPrinter::printMatrixScale(
const MCInst *
MI,
unsigned OpNo,
1539 auto Imm =
MI->getOperand(OpNo).getImm() & 1;
1543 O <<
" matrix_" << AorB <<
"_scale:";
1550void AMDGPUInstPrinter::printMatrixAScale(
const MCInst *
MI,
unsigned OpNo,
1553 printMatrixScale(
MI, OpNo, STI, O,
'a');
1556void AMDGPUInstPrinter::printMatrixBScale(
const MCInst *
MI,
unsigned OpNo,
1559 printMatrixScale(
MI, OpNo, STI, O,
'b');
1562void AMDGPUInstPrinter::printMatrixScaleFmt(
const MCInst *
MI,
unsigned OpNo,
1565 auto Imm =
MI->getOperand(OpNo).getImm() & 3;
1569 O <<
" matrix_" << AorB <<
"_scale_fmt:";
1576void AMDGPUInstPrinter::printMatrixAScaleFmt(
const MCInst *
MI,
unsigned OpNo,
1579 printMatrixScaleFmt(
MI, OpNo, STI, O,
'a');
1582void AMDGPUInstPrinter::printMatrixBScaleFmt(
const MCInst *
MI,
unsigned OpNo,
1585 printMatrixScaleFmt(
MI, OpNo, STI, O,
'b');
1588void AMDGPUInstPrinter::printInterpSlot(
const MCInst *
MI,
unsigned OpNum,
1591 unsigned Imm =
MI->getOperand(OpNum).getImm();
1603 O <<
"invalid_param_" <<
Imm;
1607void AMDGPUInstPrinter::printInterpAttr(
const MCInst *
MI,
unsigned OpNum,
1610 unsigned Attr =
MI->getOperand(OpNum).getImm();
1611 O <<
"attr" << Attr;
1614void AMDGPUInstPrinter::printInterpAttrChan(
const MCInst *
MI,
unsigned OpNum,
1617 unsigned Chan =
MI->getOperand(OpNum).getImm();
1618 O <<
'.' <<
"xyzw"[Chan & 0x3];
1621void AMDGPUInstPrinter::printGPRIdxMode(
const MCInst *
MI,
unsigned OpNo,
1624 using namespace llvm::AMDGPU::VGPRIndexMode;
1625 unsigned Val =
MI->getOperand(OpNo).getImm();
1627 if ((Val & ~ENABLE_MASK) != 0) {
1628 O << formatHex(static_cast<uint64_t>(Val));
1631 ListSeparator Sep(
",");
1632 for (
unsigned ModeId = ID_MIN; ModeId <=
ID_MAX; ++ModeId) {
1633 if (Val & (1 << ModeId))
1640void AMDGPUInstPrinter::printMemOperand(
const MCInst *
MI,
unsigned OpNo,
1643 printRegularOperand(
MI, OpNo, STI, O);
1645 printRegularOperand(
MI, OpNo + 1, STI, O);
1653 if (
Op.getImm() == 1) {
1664 if (
Op.getImm() == 1)
1671 int Imm =
MI->getOperand(OpNo).getImm();
1685 const unsigned Imm16 =
MI->getOperand(OpNo).getImm();
1696 O <<
"sendmsg(" << MsgName;
1705 O <<
"sendmsg(" << MsgId <<
", " << OpId <<
", " <<
StreamId <<
')';
1715 const uint16_t Imm16 =
static_cast<uint16_t
>(
MI->getOperand(OpNo).
getImm());
1718 if (EventName.
empty())
1719 O << formatHex(static_cast<uint64_t>(Imm16));
1730 uint16_t Probe0 = ((0 & AndMask) | OrMask) ^ XorMask;
1735 for (
unsigned Mask = 1 << (
BITMASK_WIDTH - 1); Mask > 0; Mask >>= 1) {
1762 uint16_t
Imm =
MI->getOperand(OpNo).getImm();
1805 }
else if (AndMask ==
BITMASK_MAX && OrMask == 0 && XorMask > 0 &&
1816 if (GroupSize > 1 &&
1818 OrMask < GroupSize &&
1836 printU16ImmDecOperand(
MI, OpNo, O);
1845 unsigned SImm16 =
MI->getOperand(OpNo).getImm();
1846 unsigned Vmcnt, Expcnt, Lgkmcnt;
1852 bool PrintAll = IsDefaultVmcnt && IsDefaultExpcnt && IsDefaultLgkmcnt;
1856 if (!IsDefaultVmcnt || PrintAll)
1857 O << Sep <<
"vmcnt(" << Vmcnt <<
')';
1859 if (!IsDefaultExpcnt || PrintAll)
1860 O << Sep <<
"expcnt(" << Expcnt <<
')';
1862 if (!IsDefaultLgkmcnt || PrintAll)
1863 O << Sep <<
"lgkmcnt(" << Lgkmcnt <<
')';
1871 uint64_t Imm16 =
MI->getOperand(OpNo).getImm() & 0xffff;
1873 bool HasNonDefaultVal =
false;
1881 if (!IsDefault || !HasNonDefaultVal)
1882 O << Sep << Name <<
'(' << Val <<
')';
1892 const char *BadInstId =
"/* invalid instid value */";
1893 static const std::array<const char *, 12> InstIds = {
1894 "NO_DEP",
"VALU_DEP_1",
"VALU_DEP_2",
1895 "VALU_DEP_3",
"VALU_DEP_4",
"TRANS32_DEP_1",
1896 "TRANS32_DEP_2",
"TRANS32_DEP_3",
"FMA_ACCUM_CYCLE_1",
1897 "SALU_CYCLE_1",
"SALU_CYCLE_2",
"SALU_CYCLE_3"};
1899 const char *BadInstSkip =
"/* invalid instskip value */";
1900 static const std::array<const char *, 6> InstSkips = {
1901 "SAME",
"NEXT",
"SKIP_1",
"SKIP_2",
"SKIP_3",
"SKIP_4"};
1903 unsigned SImm16 =
MI->getOperand(OpNo).getImm();
1904 const char *Prefix =
"";
1906 unsigned Value = SImm16 & 0xF;
1908 const char *Name =
Value < InstIds.size() ? InstIds[
Value] : BadInstId;
1909 O << Prefix <<
"instid0(" << Name <<
')';
1913 Value = (SImm16 >> 4) & 7;
1916 Value < InstSkips.size() ? InstSkips[
Value] : BadInstSkip;
1917 O << Prefix <<
"instskip(" << Name <<
')';
1921 Value = (SImm16 >> 7) & 0xF;
1923 const char *Name =
Value < InstIds.size() ? InstIds[
Value] : BadInstId;
1924 O << Prefix <<
"instid1(" << Name <<
')';
1935 unsigned Val =
MI->getOperand(OpNo).getImm();
1940 if (!HwRegName.
empty()) {
1946 O <<
", " <<
Offset <<
", " << Width;
1953 uint16_t
Imm =
MI->getOperand(OpNo).getImm();
1961void AMDGPUInstPrinter::printNamedInt(
const MCInst *
MI,
unsigned OpNo,
1964 bool PrintInHex,
bool AlwaysPrint) {
1965 int64_t V =
MI->getOperand(OpNo).getImm();
1966 if (AlwaysPrint || V != 0)
1970void AMDGPUInstPrinter::printBitOp3(
const MCInst *
MI,
unsigned OpNo,
1981 O << formatHex(static_cast<uint64_t>(
Imm));
1984#include "AMDGPUGenAsmWriter.inc"
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static void printSwizzleBitmask(const uint16_t AndMask, const uint16_t OrMask, const uint16_t XorMask, raw_ostream &O)
static bool printImmediateBFloat16(uint32_t Imm, const MCSubtargetInfo &STI, raw_ostream &O)
static bool allOpsDefaultValue(const int *Ops, int NumOps, int Mod, bool IsPacked, bool HasDstSel)
static MCRegister getRegForPrinting(MCRegister Reg, const MCRegisterInfo &MRI)
static MCRegister getRegFromMIA(MCRegister Reg, unsigned OpNo, const MCInstrDesc &Desc, const MCRegisterInfo &MRI, const AMDGPUMCInstrAnalysis &MIA)
static bool printImmediateFP16(uint32_t Imm, const MCSubtargetInfo &STI, raw_ostream &O)
Provides AMDGPU specific target descriptions.
const size_t AbstractManglingParser< Derived, Alloc >::NumOps
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
if(auto Err=PB.parsePassPipeline(MPM, Passes)) return wrap(std MPM run * Mod
MachineRegisterInfo & MRI
void printSwizzle(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
void printWaitEvent(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
void printEndpgm(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
static const char * getRegisterName(MCRegister Reg)
static void printIfSet(const MCInst *MI, unsigned OpNo, raw_ostream &O, StringRef Asm, StringRef Default="")
void printDepCtr(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
void printHwreg(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
void printSendMsg(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
static void printRegOperand(MCRegister Reg, raw_ostream &O, const MCRegisterInfo &MRI)
void printRegName(raw_ostream &OS, MCRegister Reg) override
Print the assembler register name.
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.
void printInstruction(const MCInst *MI, uint64_t Address, const MCSubtargetInfo &STI, raw_ostream &O)
void printSWaitCnt(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
void printOModSI(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
void printSDelayALU(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O)
unsigned getVgprMSBs() const
A helper class to return the specified delimiter string after the first invocation of operator String...
void printExpr(raw_ostream &, const MCExpr &) const
format_object< int64_t > formatHex(int64_t Value) const
format_object< int64_t > formatDec(int64_t Value) const
Utility functions to print decimal/hexadecimal values.
const MCRegisterInfo & MRI
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
const MCInstrAnalysis * MIA
Instances of this class represent a single low-level machine instruction.
Describe properties that are true of each instruction in the target description file.
bool isLookupRegClassByHwMode() const
Set if this operand is a value that requires the current hwmode to look up its register class.
int16_t RegClass
This specifies the register class enumeration of the operand if the operand is a register.
Instances of this class represent operands of the MCInst class.
MCRegisterClass - Base class of TargetRegisterClass.
unsigned getID() const
getID() - Return the register class ID number.
MCRegister getRegister(unsigned i) const
getRegister - Return the specified register in the class.
bool contains(MCRegister Reg) const
contains - Return true if the specified register is included in this register class.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Wrapper class representing physical registers. Should be passed by value.
Generic base class for all target subtargets.
bool hasFeature(unsigned Feature) const
virtual unsigned getHwMode(enum HwModeType type=HwMode_Default) const
HwMode ID corresponding to the 'type' parameter is retrieved from the HwMode bit set of the current s...
Represent a constant reference to a string, i.e.
constexpr bool empty() const
Check if the string is empty.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
bool decodeDepCtr(unsigned Code, int &Id, StringRef &Name, unsigned &Val, bool &IsDefault, const MCSubtargetInfo &STI)
bool isSymbolicDepCtrEncoding(unsigned Code, bool &HasNonDefaultVal, const MCSubtargetInfo &STI)
bool isSupportedTgtId(unsigned Id, const MCSubtargetInfo &STI)
bool getTgtName(unsigned Id, StringRef &Name, int &Index)
StringRef getHwreg(uint64_t Encoding, const MCSubtargetInfo &STI)
uint64_t encodeMsg(uint64_t MsgId, uint64_t OpId, uint64_t StreamId)
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)
StringRef getMsgName(uint64_t Encoding, const MCSubtargetInfo &STI)
Map from an encoding to the symbolic name for a msg_id immediate.
bool isValidMsgStream(int64_t MsgId, int64_t OpId, int64_t StreamId, const MCSubtargetInfo &STI, bool Strict)
StringRef getMsgOpName(int64_t MsgId, uint64_t Encoding, const MCSubtargetInfo &STI)
Map from an encoding to the symbolic name for a sendmsg operation.
bool msgRequiresOp(int64_t MsgId, const MCSubtargetInfo &STI)
bool isValidMsgOp(int64_t MsgId, int64_t OpId, const MCSubtargetInfo &STI, bool Strict)
const char *const IdSymbolic[]
constexpr const char *const ModMatrixFmt[]
constexpr const char *const ModMatrixScaleFmt[]
constexpr const char *const ModMatrixScale[]
StringRef getWaitEventMaskName(uint64_t Encoding, const MCSubtargetInfo &STI)
bool isInlineValue(MCRegister Reg)
bool isVOPCAsmOnly(unsigned Opc)
unsigned getTemporalHintType(const MCInstrDesc TID)
unsigned getNumFlatOffsetBits(const MCSubtargetInfo &ST)
For pre-GFX12 FLAT instructions the offset must be positive; MSB is ignored and forced to zero.
bool isGFX12Plus(const MCSubtargetInfo &STI)
const MCRegisterClass * getVGPRPhysRegClass(MCRegister Reg, const MCRegisterInfo &MRI)
bool isGFX940(const MCSubtargetInfo &STI)
LLVM_ABI IsaVersion getIsaVersion(StringRef GPU)
LLVM_READNONE bool isLegalDPALU_DPPControl(const MCSubtargetInfo &ST, unsigned DC)
bool isSI(const MCSubtargetInfo &STI)
Waitcnt decodeWaitcnt(const IsaVersion &Version, unsigned Encoded)
bool getVOP3IsSingle(unsigned Opc)
bool getVOP1IsSingle(unsigned Opc)
LLVM_READONLY bool hasNamedOperand(uint32_t Opcode, OpName NamedIdx)
bool isGFX90A(const MCSubtargetInfo &STI)
LLVM_READONLY const MIMGDimInfo * getMIMGDimInfoByEncoding(uint8_t DimEnc)
bool isGFX12(const MCSubtargetInfo &STI)
MCRegister getVGPRWithMSBs(MCRegister Reg, unsigned MSBs, const MCRegisterInfo &MRI)
If Reg is a low VGPR return a corresponding high VGPR with MSBs set.
unsigned getVmcntBitMask(const IsaVersion &Version)
LLVM_READNONE bool isInlinableIntLiteral(int64_t Literal)
Is this literal inlinable, and not one of the values intended for floating point values.
unsigned getLgkmcntBitMask(const IsaVersion &Version)
std::pair< const AMDGPU::OpName *, const AMDGPU::OpName * > getVGPRLoweringOperandTables(const MCInstrDesc &Desc)
unsigned getExpcntBitMask(const IsaVersion &Version)
bool isGFX11Plus(const MCSubtargetInfo &STI)
bool isGFX10Plus(const MCSubtargetInfo &STI)
@ OPERAND_REG_INLINE_C_FP64
@ OPERAND_REG_IMM_NOINLINE_FP16
@ OPERAND_REG_INLINE_C_BF16
@ OPERAND_REG_INLINE_C_V2BF16
@ OPERAND_REG_IMM_V2INT64
@ OPERAND_REG_IMM_V2INT16
@ OPERAND_REG_IMM_INT32
Operands with register, 32-bit, or 64-bit immediate.
@ OPERAND_REG_IMM_V2FP16_SPLAT
@ OPERAND_REG_INLINE_C_INT64
@ OPERAND_REG_INLINE_C_INT16
Operands with register or inline constant.
@ OPERAND_REG_IMM_NOINLINE_V2FP16
@ OPERAND_REG_INLINE_C_V2FP16
@ OPERAND_REG_INLINE_AC_INT32
Operands with an AccVGPR register or inline constant.
@ OPERAND_REG_INLINE_AC_FP32
@ OPERAND_REG_IMM_V2INT32
@ OPERAND_REG_INLINE_C_FP32
@ OPERAND_REG_INLINE_C_INT32
@ OPERAND_REG_INLINE_C_V2INT16
@ OPERAND_REG_INLINE_AC_FP64
@ OPERAND_REG_INLINE_C_FP16
@ OPERAND_INLINE_SPLIT_BARRIER_INT32
bool isDPALU_DPP(const MCInstrDesc &OpDesc, const MCInstrInfo &MII, const MCSubtargetInfo &ST)
bool isGFX9Plus(const MCSubtargetInfo &STI)
bool isRsrcIndexReg(MCRegister Reg, const MCRegisterInfo &MRI)
bool isCvt_F32_Fp8_Bf8_e64(unsigned Opc)
MCRegister mc2PseudoReg(MCRegister Reg)
Convert hardware register Reg to a pseudo register.
bool isCI(const MCSubtargetInfo &STI)
bool getVOP2IsSingle(unsigned Opc)
LLVM_READONLY StringRef getMIMGDimInfoStr(StringTable::Offset)
bool isPermlane16(unsigned Opc)
constexpr bool isVOPC(const T &...O)
constexpr bool isVOP3(const T &...O)
constexpr bool hasVOP3OpSel(const T &...O)
constexpr bool isVOP1(const T &...O)
constexpr bool isVOP2(const T &...O)
constexpr bool isSWMMAC(const T &...O)
constexpr bool isBuffer(const T &...O)
constexpr bool isSMRD(const T &...O)
constexpr bool isWMMA(const T &...O)
constexpr bool isSDWA(const T &...O)
constexpr bool isPacked(const T &...O)
constexpr bool isDPP(const T &...O)
constexpr bool isSegmentSpecificFLAT(const T &...O)
@ Lo16
Fixup[15:0] <- Target + Addend.
@ Hi16
Fixup[15:0] <- (Target + Addend + 0x8000) >> 16.
Scope
Defines the scope in which this symbol should be visible: Default – Visible in the public interface o...
This is an optimization pass for GlobalISel generic memory operations.
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
constexpr bool isPowerOf2_64(uint64_t Value)
Return true if the argument is a power of two > 0 (64 bit edition.)
constexpr int popcount(T Value) noexcept
Count the number of set bits in a value.
MachineInstr * getImm(const MachineOperand &MO, const MachineRegisterInfo *MRI)
constexpr uint32_t Hi_32(uint64_t Value)
Return the high 32 bits of a 64 bit value.
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.
constexpr uint32_t Lo_32(uint64_t Value)
Return the low 32 bits of a 64 bit value.
@ Mod
The access may modify the value stored in memory.
To bit_cast(const From &from) noexcept
DWARFExpression::Operation Op
constexpr int32_t SignExtend32(uint32_t X)
Sign-extend the number in the bottom B bits of X to a 32-bit integer.
static constexpr ValueType Default
static std::tuple< typename Fields::ValueType... > decode(uint64_t Encoded)
Instruction set architecture version.
StringTable::Offset AsmSuffix