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::printSMRDLiteralOffset(
const MCInst *
MI,
unsigned OpNo,
154 printU32ImmOperand(
MI, OpNo, STI, O);
157void AMDGPUInstPrinter::printCPol(
const MCInst *
MI,
unsigned OpNo,
159 auto Imm =
MI->getOperand(OpNo).getImm();
166 O <<
" scale_offset";
168 printTH(
MI, TH, Scope, O);
169 printScope(Scope, O);
174 if (STI.
hasFeature(AMDGPU::FeatureCacheFillSize)) {
192 O <<
" /* unexpected cache policy bit */";
195void AMDGPUInstPrinter::printTH(
const MCInst *
MI, int64_t TH, int64_t Scope,
201 const unsigned Opcode =
MI->getOpcode();
202 const MCInstrDesc &TID =
MII.get(Opcode);
225 O << (IsStore ?
"TH_STORE_" :
"TH_LOAD_");
235 : (IsStore ?
"WB" :
"LU"));
256void AMDGPUInstPrinter::printScope(int64_t Scope,
raw_ostream &O) {
272void AMDGPUInstPrinter::printCFS(int64_t CFS,
raw_ostream &O) {
293void AMDGPUInstPrinter::printDim(
const MCInst *
MI,
unsigned OpNo,
295 unsigned Dim =
MI->getOperand(OpNo).getImm();
296 O <<
" dim:SQ_RSRC_IMG_";
305void AMDGPUInstPrinter::printR128A16(
const MCInst *
MI,
unsigned OpNo,
308 printNamedBit(
MI, OpNo, O,
"a16");
310 printNamedBit(
MI, OpNo, O,
"r128");
313void AMDGPUInstPrinter::printFormat(
const MCInst *
MI,
unsigned OpNo,
316 using namespace llvm::AMDGPU::MTBUFFormat;
318 unsigned Val =
MI->getOperand(OpNo).getImm();
320 if (Val == UFMT_DEFAULT)
325 O <<
" format:" << Val;
328 if (Val == DFMT_NFMT_DEFAULT)
335 if (Dfmt != DFMT_DEFAULT) {
337 if (Nfmt != NFMT_DEFAULT) {
341 if (Nfmt != NFMT_DEFAULT) {
346 O <<
" format:" << Val;
354 unsigned Enc =
MRI.getEncodingValue(
Reg);
359 unsigned RegNo =
Idx % 0x100;
361 if (RC->
getID() == AMDGPU::VGPR_16RegClassID) {
380 unsigned Enc =
MRI.getEncodingValue(
Reg);
387 unsigned Opc =
Desc.getOpcode();
389 for (
I = 0;
I < 4; ++
I) {
390 if (
Ops.first[
I] != AMDGPU::OpName::NUM_OPERAND_NAMES &&
391 (
unsigned)AMDGPU::getNamedOperandIdx(
Opc,
Ops.first[
I]) == OpNo)
393 if (
Ops.second &&
Ops.second[
I] != AMDGPU::OpName::NUM_OPERAND_NAMES &&
394 (
unsigned)AMDGPU::getNamedOperandIdx(
Opc,
Ops.second[
I]) == OpNo)
399 unsigned OpMSBs = (VgprMSBs >> (
I * 2)) & 3;
407void AMDGPUInstPrinter::printRsrcReg(
const MCInst *
MI,
unsigned OpNo,
410 MCRegister
Reg =
MI->getOperand(OpNo).getReg();
425 case AMDGPU::PRIVATE_RSRC_REG:
448void AMDGPUInstPrinter::printVOPDst(
const MCInst *
MI,
unsigned OpNo,
450 auto Opcode =
MI->getOpcode();
467 printRegularOperand(
MI, OpNo, STI, O);
473 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx10:
474 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx10:
475 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx10:
476 case AMDGPU::V_ADD_CO_CI_U32_sdwa_gfx10:
477 case AMDGPU::V_SUB_CO_CI_U32_sdwa_gfx10:
478 case AMDGPU::V_SUBREV_CO_CI_U32_sdwa_gfx10:
479 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx10:
480 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx10:
481 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx10:
482 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx10:
483 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx10:
484 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx10:
485 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx11:
486 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx11:
487 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx11:
488 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx11:
489 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx11:
490 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx11:
491 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx11:
492 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx11:
493 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx11:
494 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx12:
495 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx12:
496 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx12:
497 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx12:
498 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx12:
499 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx12:
500 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx12:
501 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx12:
502 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx12:
503 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx13:
504 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx13:
505 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx13:
506 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx13:
507 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx13:
508 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx13:
509 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx13:
510 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx13:
511 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx13:
512 printDefaultVccOperand(
false, STI, O);
517void AMDGPUInstPrinter::printVINTRPDst(
const MCInst *
MI,
unsigned OpNo,
524 printRegularOperand(
MI, OpNo, STI, O);
527void AMDGPUInstPrinter::printAVLdSt32Align2RegOp(
const MCInst *
MI,
531 MCRegister
Reg =
MI->getOperand(OpNo).getReg();
534 if (MCRegister SubReg =
MRI.getSubReg(
Reg, AMDGPU::sub0))
539void AMDGPUInstPrinter::printImmediateInt16(uint32_t
Imm,
542 int32_t SImm =
static_cast<int32_t
>(
Imm);
548 if (printImmediateFloat32(
Imm, STI, O))
551 O << formatHex(static_cast<uint64_t>(
Imm & 0xffff));
558 else if (
Imm == 0xBC00)
560 else if (
Imm == 0x3800)
562 else if (
Imm == 0xB800)
564 else if (
Imm == 0x4000)
566 else if (
Imm == 0xC000)
568 else if (
Imm == 0x4400)
570 else if (
Imm == 0xC400)
572 else if (
Imm == 0x3118 && STI.
hasFeature(AMDGPU::FeatureInv2PiInlineImm))
584 else if (
Imm == 0xBF80)
586 else if (
Imm == 0x3F00)
588 else if (
Imm == 0xBF00)
590 else if (
Imm == 0x4000)
592 else if (
Imm == 0xC000)
594 else if (
Imm == 0x4080)
596 else if (
Imm == 0xC080)
598 else if (
Imm == 0x3E22 && STI.
hasFeature(AMDGPU::FeatureInv2PiInlineImm))
606void AMDGPUInstPrinter::printImmediateBF16(uint32_t
Imm,
609 int16_t SImm =
static_cast<int16_t
>(
Imm);
618 O << formatHex(static_cast<uint64_t>(
Imm & 0xffff));
621void AMDGPUInstPrinter::printImmediateF16(uint32_t
Imm,
624 int16_t SImm =
static_cast<int16_t
>(
Imm);
630 uint16_t HImm =
static_cast<uint16_t
>(
Imm);
638void AMDGPUInstPrinter::printImmediateV216(uint32_t
Imm, uint8_t OpType,
641 int32_t SImm =
static_cast<int32_t
>(
Imm);
650 if (printImmediateFloat32(
Imm, STI, O))
664 uint16_t
Lo16 =
static_cast<uint16_t
>(
Imm & 0xFFFF);
665 uint16_t
Hi16 =
static_cast<uint16_t
>((
Imm >> 16) & 0xFFFF);
690 O << formatHex(static_cast<uint64_t>(
Imm));
693bool AMDGPUInstPrinter::printImmediateFloat32(uint32_t
Imm,
714 else if (
Imm == 0x3e22f983 &&
715 STI.
hasFeature(AMDGPU::FeatureInv2PiInlineImm))
723void AMDGPUInstPrinter::printImmediate32(uint32_t
Imm,
726 int32_t SImm =
static_cast<int32_t
>(
Imm);
732 if (printImmediateFloat32(
Imm, STI, O))
735 O << formatHex(static_cast<uint64_t>(
Imm));
738void AMDGPUInstPrinter::printImmediate64(
uint64_t Imm,
741 int64_t SImm =
static_cast<int64_t
>(
Imm);
742 if (SImm >= -16 && SImm <= 64) {
765 else if (
Imm == 0x3fc45f306dc9c882 &&
766 STI.
hasFeature(AMDGPU::FeatureInv2PiInlineImm))
767 O <<
"0.15915494309189532";
769 printLiteral64(
Imm, O, IsFP);
775 O << formatHex(static_cast<uint64_t>(
Hi_32(
Imm)));
780void AMDGPUInstPrinter::printBLGP(
const MCInst *
MI,
unsigned OpNo,
783 unsigned Imm =
MI->getOperand(OpNo).getImm();
788 switch (
MI->getOpcode()) {
789 case AMDGPU::V_MFMA_F64_16X16X4F64_gfx940_acd:
790 case AMDGPU::V_MFMA_F64_16X16X4F64_gfx940_vcd:
791 case AMDGPU::V_MFMA_F64_4X4X4F64_gfx940_acd:
792 case AMDGPU::V_MFMA_F64_4X4X4F64_gfx940_vcd:
793 O <<
" neg:[" << (
Imm & 1) <<
',' << ((
Imm >> 1) & 1) <<
','
794 << ((
Imm >> 2) & 1) <<
']';
799 O <<
" blgp:" <<
Imm;
802void AMDGPUInstPrinter::printDefaultVccOperand(
bool FirstOperand,
816 unsigned OpNo)
const {
819 (
Desc.hasImplicitDefOfPhysReg(AMDGPU::VCC) ||
820 Desc.hasImplicitDefOfPhysReg(AMDGPU::VCC_LO));
824void AMDGPUInstPrinter::printOperand(
const MCInst *
MI,
unsigned OpNo,
827 unsigned Opc =
MI->getOpcode();
829 int ModIdx = AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::src0_modifiers);
835 (
Desc.hasImplicitDefOfPhysReg(AMDGPU::VCC) ||
836 Desc.hasImplicitDefOfPhysReg(AMDGPU::VCC_LO)))
837 printDefaultVccOperand(
true, STI, O);
839 printRegularOperand(
MI, OpNo, STI, O);
843void AMDGPUInstPrinter::printRegularOperand(
const MCInst *
MI,
unsigned OpNo,
846 const MCInstrDesc &
Desc =
MII.get(
MI->getOpcode());
848 if (OpNo >=
MI->getNumOperands()) {
849 O <<
"/*Missing OP" << OpNo <<
"*/";
853 const MCOperand &
Op =
MI->getOperand(OpNo);
860 const MCOperandInfo &OpInfo =
Desc.operands()[OpNo];
862 int16_t RCID =
MII.getOpRegClassID(
864 const MCRegisterClass &RC =
MRI.getRegClass(RCID);
868 (OpInfo.
RegClass == AMDGPU::SReg_1 ||
869 OpInfo.
RegClass == AMDGPU::SReg_1_XEXEC);
876 O <<
"/*Invalid register, operand has \'" <<
MRI.getRegClassName(&RC)
877 <<
"\' register class*/";
881 }
else if (
Op.isImm()) {
882 const uint8_t OpTy =
Desc.operands()[OpNo].OperandType;
894 printImmediate32(
Op.getImm(), STI, O);
899 printImmediate64(
Op.getImm(), STI, O,
false);
905 printImmediate64(
Op.getImm(), STI, O,
true);
909 printImmediateInt16(
Op.getImm(), STI, O);
914 printImmediateF16(
Op.getImm(), STI, O);
918 printImmediateBF16(
Op.getImm(), STI, O);
928 printImmediateV216(
Op.getImm(), OpTy, STI, O);
937 printImmediate32(
Op.getImm(), STI, O);
938 O <<
"/*Invalid immediate*/";
945 }
else if (
Op.isExpr()) {
946 const MCExpr *
Exp =
Op.getExpr();
947 MAI.printExpr(O, *Exp);
953 switch (
MI->getOpcode()) {
956 case AMDGPU::V_CNDMASK_B32_e32_gfx10:
957 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx10:
958 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx10:
959 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx10:
960 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx10:
961 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx10:
962 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx10:
963 case AMDGPU::V_CNDMASK_B32_dpp8_gfx10:
964 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx10:
965 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx10:
966 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx10:
967 case AMDGPU::V_CNDMASK_B32_e32_gfx11:
968 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx11:
969 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx11:
970 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx11:
971 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx11:
972 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx11:
973 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx11:
974 case AMDGPU::V_CNDMASK_B32_dpp8_gfx11:
975 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx11:
976 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx11:
977 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx11:
978 case AMDGPU::V_CNDMASK_B32_e32_gfx12:
979 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx12:
980 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx12:
981 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx12:
982 case AMDGPU::V_CNDMASK_B32_dpp_gfx12:
983 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx12:
984 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx12:
985 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx12:
986 case AMDGPU::V_CNDMASK_B32_dpp8_gfx12:
987 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx12:
988 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx12:
989 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx12:
990 case AMDGPU::V_CNDMASK_B32_e32_gfx13:
991 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx13:
992 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx13:
993 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx13:
994 case AMDGPU::V_CNDMASK_B32_dpp_gfx13:
995 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx13:
996 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx13:
997 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx13:
998 case AMDGPU::V_CNDMASK_B32_dpp8_gfx13:
999 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx13:
1000 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx13:
1001 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx13:
1003 case AMDGPU::V_CNDMASK_B32_e32_gfx6_gfx7:
1004 case AMDGPU::V_CNDMASK_B32_e32_vi:
1005 if ((
int)OpNo == AMDGPU::getNamedOperandIdx(
MI->getOpcode(),
1006 AMDGPU::OpName::src1))
1007 printDefaultVccOperand(OpNo == 0, STI, O);
1012void AMDGPUInstPrinter::printOperandAndFPInputMods(
const MCInst *
MI,
1016 const MCInstrDesc &
Desc =
MII.get(
MI->getOpcode());
1017 if (needsImpliedVcc(
Desc, OpNo))
1018 printDefaultVccOperand(
true, STI, O);
1020 unsigned InputModifiers =
MI->getOperand(OpNo).getImm();
1025 bool NegMnemo =
false;
1028 if (OpNo + 1 <
MI->getNumOperands() &&
1030 const MCOperand &
Op =
MI->getOperand(OpNo + 1);
1031 NegMnemo =
Op.isImm();
1042 printRegularOperand(
MI, OpNo + 1, STI, O);
1051 switch (
MI->getOpcode()) {
1055 case AMDGPU::V_CNDMASK_B32_sdwa_gfx10:
1056 case AMDGPU::V_CNDMASK_B32_dpp_gfx10:
1057 case AMDGPU::V_CNDMASK_B32_dpp_gfx11:
1058 if ((
int)OpNo + 1 ==
1059 AMDGPU::getNamedOperandIdx(
MI->getOpcode(), AMDGPU::OpName::src1))
1060 printDefaultVccOperand(OpNo == 0, STI, O);
1065void AMDGPUInstPrinter::printOperandAndIntInputMods(
const MCInst *
MI,
1069 const MCInstrDesc &
Desc =
MII.get(
MI->getOpcode());
1070 if (needsImpliedVcc(
Desc, OpNo))
1071 printDefaultVccOperand(
true, STI, O);
1073 unsigned InputModifiers =
MI->getOperand(OpNo).getImm();
1076 printRegularOperand(
MI, OpNo + 1, STI, O);
1081 switch (
MI->getOpcode()) {
1084 case AMDGPU::V_ADD_CO_CI_U32_sdwa_gfx10:
1085 case AMDGPU::V_SUB_CO_CI_U32_sdwa_gfx10:
1086 case AMDGPU::V_SUBREV_CO_CI_U32_sdwa_gfx10:
1087 if ((
int)OpNo + 1 == AMDGPU::getNamedOperandIdx(
MI->getOpcode(),
1088 AMDGPU::OpName::src1))
1089 printDefaultVccOperand(OpNo == 0, STI, O);
1094void AMDGPUInstPrinter::printDPP8(
const MCInst *
MI,
unsigned OpNo,
1100 unsigned Imm =
MI->getOperand(OpNo).getImm();
1102 for (
size_t i = 1; i < 8; ++i) {
1108void AMDGPUInstPrinter::printDPPCtrl(
const MCInst *
MI,
unsigned OpNo,
1111 using namespace AMDGPU::DPP;
1113 unsigned Imm =
MI->getOperand(OpNo).getImm();
1114 const MCInstrDesc &
Desc =
MII.get(
MI->getOpcode());
1119 O <<
" /* DP ALU dpp only supports "
1120 << (
isGFX12(STI) ?
"row_share" :
"row_newbcast") <<
" */";
1123 if (
Imm <= DppCtrl::QUAD_PERM_LAST) {
1129 }
else if ((
Imm >= DppCtrl::ROW_SHL_FIRST) &&
1130 (
Imm <= DppCtrl::ROW_SHL_LAST)) {
1132 }
else if ((
Imm >= DppCtrl::ROW_SHR_FIRST) &&
1133 (
Imm <= DppCtrl::ROW_SHR_LAST)) {
1135 }
else if ((
Imm >= DppCtrl::ROW_ROR_FIRST) &&
1136 (
Imm <= DppCtrl::ROW_ROR_LAST)) {
1138 }
else if (
Imm == DppCtrl::WAVE_SHL1) {
1140 O <<
"/* wave_shl is not supported starting from GFX10 */";
1144 }
else if (
Imm == DppCtrl::WAVE_ROL1) {
1146 O <<
"/* wave_rol is not supported starting from GFX10 */";
1150 }
else if (
Imm == DppCtrl::WAVE_SHR1) {
1152 O <<
"/* wave_shr is not supported starting from GFX10 */";
1156 }
else if (
Imm == DppCtrl::WAVE_ROR1) {
1158 O <<
"/* wave_ror is not supported starting from GFX10 */";
1162 }
else if (
Imm == DppCtrl::ROW_MIRROR) {
1164 }
else if (
Imm == DppCtrl::ROW_HALF_MIRROR) {
1165 O <<
"row_half_mirror";
1166 }
else if (
Imm == DppCtrl::BCAST15) {
1168 O <<
"/* row_bcast is not supported starting from GFX10 */";
1171 O <<
"row_bcast:15";
1172 }
else if (
Imm == DppCtrl::BCAST31) {
1174 O <<
"/* row_bcast is not supported starting from GFX10 */";
1177 O <<
"row_bcast:31";
1178 }
else if ((
Imm >= DppCtrl::ROW_SHARE_FIRST) &&
1179 (
Imm <= DppCtrl::ROW_SHARE_LAST)) {
1181 O <<
"row_newbcast:";
1185 O <<
" /* row_newbcast/row_share is not supported on ASICs earlier "
1186 "than GFX90A/GFX10 */";
1190 }
else if ((
Imm >= DppCtrl::ROW_XMASK_FIRST) &&
1191 (
Imm <= DppCtrl::ROW_XMASK_LAST)) {
1193 O <<
"/* row_xmask is not supported on ASICs earlier than GFX10 */";
1196 O <<
"row_xmask:" <<
formatDec(
Imm - DppCtrl::ROW_XMASK_FIRST);
1198 O <<
"/* Invalid dpp_ctrl value */";
1202void AMDGPUInstPrinter::printDppBoundCtrl(
const MCInst *
MI,
unsigned OpNo,
1205 unsigned Imm =
MI->getOperand(OpNo).getImm();
1207 O <<
" bound_ctrl:1";
1211void AMDGPUInstPrinter::printDppFI(
const MCInst *
MI,
unsigned OpNo,
1213 using namespace llvm::AMDGPU::DPP;
1214 unsigned Imm =
MI->getOperand(OpNo).getImm();
1215 if (
Imm == DPP_FI_1 ||
Imm == DPP8_FI_1) {
1220void AMDGPUInstPrinter::printSDWASel(
const MCInst *
MI,
unsigned OpNo,
1222 using namespace llvm::AMDGPU::SDWA;
1224 unsigned Imm =
MI->getOperand(OpNo).getImm();
1226 case SdwaSel::BYTE_0:
O <<
"BYTE_0";
break;
1227 case SdwaSel::BYTE_1:
O <<
"BYTE_1";
break;
1228 case SdwaSel::BYTE_2:
O <<
"BYTE_2";
break;
1229 case SdwaSel::BYTE_3:
O <<
"BYTE_3";
break;
1230 case SdwaSel::WORD_0:
O <<
"WORD_0";
break;
1231 case SdwaSel::WORD_1:
O <<
"WORD_1";
break;
1232 case SdwaSel::DWORD:
O <<
"DWORD";
break;
1237void AMDGPUInstPrinter::printSDWADstSel(
const MCInst *
MI,
unsigned OpNo,
1241 printSDWASel(
MI, OpNo, O);
1244void AMDGPUInstPrinter::printSDWASrc0Sel(
const MCInst *
MI,
unsigned OpNo,
1248 printSDWASel(
MI, OpNo, O);
1251void AMDGPUInstPrinter::printSDWASrc1Sel(
const MCInst *
MI,
unsigned OpNo,
1255 printSDWASel(
MI, OpNo, O);
1258void AMDGPUInstPrinter::printSDWADstUnused(
const MCInst *
MI,
unsigned OpNo,
1261 using namespace llvm::AMDGPU::SDWA;
1264 unsigned Imm =
MI->getOperand(OpNo).getImm();
1266 case DstUnused::UNUSED_PAD:
O <<
"UNUSED_PAD";
break;
1267 case DstUnused::UNUSED_SEXT:
O <<
"UNUSED_SEXT";
break;
1268 case DstUnused::UNUSED_PRESERVE:
O <<
"UNUSED_PRESERVE";
break;
1273void AMDGPUInstPrinter::printExpSrcN(
const MCInst *
MI,
unsigned OpNo,
1276 unsigned Opc =
MI->getOpcode();
1277 int EnIdx = AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::en);
1278 unsigned En =
MI->getOperand(EnIdx).getImm();
1280 int ComprIdx = AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::compr);
1283 if (
MI->getOperand(ComprIdx).getImm())
1284 OpNo = OpNo -
N +
N / 2;
1292void AMDGPUInstPrinter::printExpSrc0(
const MCInst *
MI,
unsigned OpNo,
1295 printExpSrcN(
MI, OpNo, STI, O, 0);
1298void AMDGPUInstPrinter::printExpSrc1(
const MCInst *
MI,
unsigned OpNo,
1301 printExpSrcN(
MI, OpNo, STI, O, 1);
1304void AMDGPUInstPrinter::printExpSrc2(
const MCInst *
MI,
unsigned OpNo,
1307 printExpSrcN(
MI, OpNo, STI, O, 2);
1310void AMDGPUInstPrinter::printExpSrc3(
const MCInst *
MI,
unsigned OpNo,
1313 printExpSrcN(
MI, OpNo, STI, O, 3);
1316void AMDGPUInstPrinter::printExpTgt(
const MCInst *
MI,
unsigned OpNo,
1319 using namespace llvm::AMDGPU::Exp;
1322 unsigned Id =
MI->getOperand(OpNo).getImm() & ((1 << 6) - 1);
1327 O <<
' ' << TgtName;
1331 O <<
" invalid_target_" <<
Id;
1336 bool IsPacked,
bool HasDstSel) {
1340 if (!!(
Ops[
I] &
Mod) != DefaultValue)
1350void AMDGPUInstPrinter::printPackedModifier(
const MCInst *
MI,
1354 unsigned Opc =
MI->getOpcode();
1358 std::pair<AMDGPU::OpName, AMDGPU::OpName> MOps[] = {
1359 {AMDGPU::OpName::src0_modifiers, AMDGPU::OpName::src0},
1360 {AMDGPU::OpName::src1_modifiers, AMDGPU::OpName::src1},
1361 {AMDGPU::OpName::src2_modifiers, AMDGPU::OpName::src2}};
1364 for (
auto [SrcMod, Src] : MOps) {
1368 int ModIdx = AMDGPU::getNamedOperandIdx(
Opc, SrcMod);
1370 (ModIdx != -1) ?
MI->getOperand(ModIdx).getImm() : DefaultValue;
1379 AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::src2_modifiers);
1385 (AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::vdst) != -1) ||
1386 (AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::sdst) != -1);
1393 for (AMDGPU::OpName OpName :
1394 {AMDGPU::OpName::src0_modifiers, AMDGPU::OpName::src1_modifiers,
1395 AMDGPU::OpName::src2_modifiers}) {
1396 int Idx = AMDGPU::getNamedOperandIdx(
Opc, OpName);
1413 ListSeparator Sep(
",");
1424void AMDGPUInstPrinter::printOpSel(
const MCInst *
MI,
unsigned,
1427 unsigned Opc =
MI->getOpcode();
1430 AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::src0_modifiers);
1431 unsigned Mod =
MI->getOperand(SrcMod).getImm();
1434 if (Index0 || Index1)
1435 O <<
" op_sel:[" << Index0 <<
',' << Index1 <<
']';
1439 auto FIN = AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::src0_modifiers);
1440 auto BCN = AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::src1_modifiers);
1444 O <<
" op_sel:[" << FI <<
',' << BC <<
']';
1451void AMDGPUInstPrinter::printOpSelHi(
const MCInst *
MI,
unsigned OpNo,
1457void AMDGPUInstPrinter::printNegLo(
const MCInst *
MI,
unsigned OpNo,
1463void AMDGPUInstPrinter::printNegHi(
const MCInst *
MI,
unsigned OpNo,
1469void AMDGPUInstPrinter::printIndexKey8bit(
const MCInst *
MI,
unsigned OpNo,
1472 auto Imm =
MI->getOperand(OpNo).getImm() & 0x7;
1476 O <<
" index_key:" <<
Imm;
1479void AMDGPUInstPrinter::printIndexKey16bit(
const MCInst *
MI,
unsigned OpNo,
1482 auto Imm =
MI->getOperand(OpNo).getImm() & 0x7;
1486 O <<
" index_key:" <<
Imm;
1489void AMDGPUInstPrinter::printIndexKey32bit(
const MCInst *
MI,
unsigned OpNo,
1492 auto Imm =
MI->getOperand(OpNo).getImm() & 0x7;
1496 O <<
" index_key:" <<
Imm;
1499void AMDGPUInstPrinter::printMatrixFMT(
const MCInst *
MI,
unsigned OpNo,
1502 auto Imm =
MI->getOperand(OpNo).getImm() & 0x7;
1506 O <<
" matrix_" << AorB <<
"_fmt:";
1513void AMDGPUInstPrinter::printMatrixAFMT(
const MCInst *
MI,
unsigned OpNo,
1516 printMatrixFMT(
MI, OpNo, STI, O,
'a');
1519void AMDGPUInstPrinter::printMatrixBFMT(
const MCInst *
MI,
unsigned OpNo,
1522 printMatrixFMT(
MI, OpNo, STI, O,
'b');
1525void AMDGPUInstPrinter::printMatrixScale(
const MCInst *
MI,
unsigned OpNo,
1528 auto Imm =
MI->getOperand(OpNo).getImm() & 1;
1532 O <<
" matrix_" << AorB <<
"_scale:";
1539void AMDGPUInstPrinter::printMatrixAScale(
const MCInst *
MI,
unsigned OpNo,
1542 printMatrixScale(
MI, OpNo, STI, O,
'a');
1545void AMDGPUInstPrinter::printMatrixBScale(
const MCInst *
MI,
unsigned OpNo,
1548 printMatrixScale(
MI, OpNo, STI, O,
'b');
1551void AMDGPUInstPrinter::printMatrixScaleFmt(
const MCInst *
MI,
unsigned OpNo,
1554 auto Imm =
MI->getOperand(OpNo).getImm() & 3;
1558 O <<
" matrix_" << AorB <<
"_scale_fmt:";
1565void AMDGPUInstPrinter::printMatrixAScaleFmt(
const MCInst *
MI,
unsigned OpNo,
1568 printMatrixScaleFmt(
MI, OpNo, STI, O,
'a');
1571void AMDGPUInstPrinter::printMatrixBScaleFmt(
const MCInst *
MI,
unsigned OpNo,
1574 printMatrixScaleFmt(
MI, OpNo, STI, O,
'b');
1577void AMDGPUInstPrinter::printInterpSlot(
const MCInst *
MI,
unsigned OpNum,
1580 unsigned Imm =
MI->getOperand(OpNum).getImm();
1592 O <<
"invalid_param_" <<
Imm;
1596void AMDGPUInstPrinter::printInterpAttr(
const MCInst *
MI,
unsigned OpNum,
1599 unsigned Attr =
MI->getOperand(OpNum).getImm();
1600 O <<
"attr" << Attr;
1603void AMDGPUInstPrinter::printInterpAttrChan(
const MCInst *
MI,
unsigned OpNum,
1606 unsigned Chan =
MI->getOperand(OpNum).getImm();
1607 O <<
'.' <<
"xyzw"[Chan & 0x3];
1610void AMDGPUInstPrinter::printGPRIdxMode(
const MCInst *
MI,
unsigned OpNo,
1613 using namespace llvm::AMDGPU::VGPRIndexMode;
1614 unsigned Val =
MI->getOperand(OpNo).getImm();
1616 if ((Val & ~ENABLE_MASK) != 0) {
1617 O << formatHex(static_cast<uint64_t>(Val));
1620 ListSeparator Sep(
",");
1621 for (
unsigned ModeId = ID_MIN; ModeId <=
ID_MAX; ++ModeId) {
1622 if (Val & (1 << ModeId))
1629void AMDGPUInstPrinter::printMemOperand(
const MCInst *
MI,
unsigned OpNo,
1632 printRegularOperand(
MI, OpNo, STI, O);
1634 printRegularOperand(
MI, OpNo + 1, STI, O);
1642 if (
Op.getImm() == 1) {
1653 if (
Op.getImm() == 1)
1660 int Imm =
MI->getOperand(OpNo).getImm();
1674 const unsigned Imm16 =
MI->getOperand(OpNo).getImm();
1685 O <<
"sendmsg(" << MsgName;
1694 O <<
"sendmsg(" << MsgId <<
", " << OpId <<
", " <<
StreamId <<
')';
1704 const uint16_t Imm16 =
static_cast<uint16_t
>(
MI->getOperand(OpNo).
getImm());
1707 if (EventName.
empty())
1708 O << formatHex(static_cast<uint64_t>(Imm16));
1719 uint16_t Probe0 = ((0 & AndMask) | OrMask) ^ XorMask;
1724 for (
unsigned Mask = 1 << (
BITMASK_WIDTH - 1); Mask > 0; Mask >>= 1) {
1751 uint16_t
Imm =
MI->getOperand(OpNo).getImm();
1794 }
else if (AndMask ==
BITMASK_MAX && OrMask == 0 && XorMask > 0 &&
1805 if (GroupSize > 1 &&
1807 OrMask < GroupSize &&
1825 printU16ImmDecOperand(
MI, OpNo, O);
1834 unsigned SImm16 =
MI->getOperand(OpNo).getImm();
1835 unsigned Vmcnt, Expcnt, Lgkmcnt;
1841 bool PrintAll = IsDefaultVmcnt && IsDefaultExpcnt && IsDefaultLgkmcnt;
1845 if (!IsDefaultVmcnt || PrintAll)
1846 O << Sep <<
"vmcnt(" << Vmcnt <<
')';
1848 if (!IsDefaultExpcnt || PrintAll)
1849 O << Sep <<
"expcnt(" << Expcnt <<
')';
1851 if (!IsDefaultLgkmcnt || PrintAll)
1852 O << Sep <<
"lgkmcnt(" << Lgkmcnt <<
')';
1860 uint64_t Imm16 =
MI->getOperand(OpNo).getImm() & 0xffff;
1862 bool HasNonDefaultVal =
false;
1870 if (!IsDefault || !HasNonDefaultVal)
1871 O << Sep << Name <<
'(' << Val <<
')';
1881 const char *BadInstId =
"/* invalid instid value */";
1882 static const std::array<const char *, 12> InstIds = {
1883 "NO_DEP",
"VALU_DEP_1",
"VALU_DEP_2",
1884 "VALU_DEP_3",
"VALU_DEP_4",
"TRANS32_DEP_1",
1885 "TRANS32_DEP_2",
"TRANS32_DEP_3",
"FMA_ACCUM_CYCLE_1",
1886 "SALU_CYCLE_1",
"SALU_CYCLE_2",
"SALU_CYCLE_3"};
1888 const char *BadInstSkip =
"/* invalid instskip value */";
1889 static const std::array<const char *, 6> InstSkips = {
1890 "SAME",
"NEXT",
"SKIP_1",
"SKIP_2",
"SKIP_3",
"SKIP_4"};
1892 unsigned SImm16 =
MI->getOperand(OpNo).getImm();
1893 const char *Prefix =
"";
1895 unsigned Value = SImm16 & 0xF;
1897 const char *Name =
Value < InstIds.size() ? InstIds[
Value] : BadInstId;
1898 O << Prefix <<
"instid0(" << Name <<
')';
1902 Value = (SImm16 >> 4) & 7;
1905 Value < InstSkips.size() ? InstSkips[
Value] : BadInstSkip;
1906 O << Prefix <<
"instskip(" << Name <<
')';
1910 Value = (SImm16 >> 7) & 0xF;
1912 const char *Name =
Value < InstIds.size() ? InstIds[
Value] : BadInstId;
1913 O << Prefix <<
"instid1(" << Name <<
')';
1924 unsigned Val =
MI->getOperand(OpNo).getImm();
1929 if (!HwRegName.
empty()) {
1935 O <<
", " <<
Offset <<
", " << Width;
1942 uint16_t
Imm =
MI->getOperand(OpNo).getImm();
1950void AMDGPUInstPrinter::printNamedInt(
const MCInst *
MI,
unsigned OpNo,
1953 bool PrintInHex,
bool AlwaysPrint) {
1954 int64_t V =
MI->getOperand(OpNo).getImm();
1955 if (AlwaysPrint || V != 0)
1959void AMDGPUInstPrinter::printBitOp3(
const MCInst *
MI,
unsigned OpNo,
1970 O << formatHex(static_cast<uint64_t>(
Imm));
1973#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