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);
187 O <<
" /* unexpected cache policy bit */";
190void AMDGPUInstPrinter::printTH(
const MCInst *
MI, int64_t TH, int64_t Scope,
196 const unsigned Opcode =
MI->getOpcode();
197 const MCInstrDesc &TID =
MII.get(Opcode);
220 O << (IsStore ?
"TH_STORE_" :
"TH_LOAD_");
230 : (IsStore ?
"WB" :
"LU"));
251void AMDGPUInstPrinter::printScope(int64_t Scope,
raw_ostream &O) {
267void AMDGPUInstPrinter::printDim(
const MCInst *
MI,
unsigned OpNo,
269 unsigned Dim =
MI->getOperand(OpNo).getImm();
270 O <<
" dim:SQ_RSRC_IMG_";
279void AMDGPUInstPrinter::printR128A16(
const MCInst *
MI,
unsigned OpNo,
282 printNamedBit(
MI, OpNo, O,
"a16");
284 printNamedBit(
MI, OpNo, O,
"r128");
287void AMDGPUInstPrinter::printFORMAT(
const MCInst *
MI,
unsigned OpNo,
292void AMDGPUInstPrinter::printSymbolicFormat(
const MCInst *
MI,
295 using namespace llvm::AMDGPU::MTBUFFormat;
298 AMDGPU::getNamedOperandIdx(
MI->getOpcode(), AMDGPU::OpName::format);
301 unsigned Val =
MI->getOperand(OpNo).getImm();
303 if (Val == UFMT_DEFAULT)
308 O <<
" format:" << Val;
311 if (Val == DFMT_NFMT_DEFAULT)
318 if (Dfmt != DFMT_DEFAULT) {
320 if (Nfmt != NFMT_DEFAULT) {
324 if (Nfmt != NFMT_DEFAULT) {
329 O <<
" format:" << Val;
342 unsigned RegNo = Idx % 0x100;
344 if (RC->
getID() == AMDGPU::VGPR_16RegClassID) {
370 unsigned Opc =
Desc.getOpcode();
372 for (
I = 0;
I < 4; ++
I) {
373 if (
Ops.first[
I] != AMDGPU::OpName::NUM_OPERAND_NAMES &&
374 (
unsigned)AMDGPU::getNamedOperandIdx(
Opc,
Ops.first[
I]) == OpNo)
376 if (
Ops.second &&
Ops.second[
I] != AMDGPU::OpName::NUM_OPERAND_NAMES &&
377 (
unsigned)AMDGPU::getNamedOperandIdx(
Opc,
Ops.second[
I]) == OpNo)
382 unsigned OpMSBs = (VgprMSBs >> (
I * 2)) & 3;
396 case AMDGPU::PRIVATE_RSRC_REG:
419void AMDGPUInstPrinter::printVOPDst(
const MCInst *
MI,
unsigned OpNo,
421 auto Opcode =
MI->getOpcode();
438 printRegularOperand(
MI, OpNo, STI, O);
444 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx10:
445 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx10:
446 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx10:
447 case AMDGPU::V_ADD_CO_CI_U32_sdwa_gfx10:
448 case AMDGPU::V_SUB_CO_CI_U32_sdwa_gfx10:
449 case AMDGPU::V_SUBREV_CO_CI_U32_sdwa_gfx10:
450 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx10:
451 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx10:
452 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx10:
453 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx10:
454 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx10:
455 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx10:
456 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx11:
457 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx11:
458 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx11:
459 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx11:
460 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx11:
461 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx11:
462 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx11:
463 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx11:
464 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx11:
465 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx12:
466 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx12:
467 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx12:
468 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx12:
469 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx12:
470 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx12:
471 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx12:
472 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx12:
473 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx12:
474 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx13:
475 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx13:
476 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx13:
477 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx13:
478 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx13:
479 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx13:
480 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx13:
481 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx13:
482 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx13:
483 printDefaultVccOperand(
false, STI, O);
488void AMDGPUInstPrinter::printVINTRPDst(
const MCInst *
MI,
unsigned OpNo,
495 printRegularOperand(
MI, OpNo, STI, O);
498void AMDGPUInstPrinter::printAVLdSt32Align2RegOp(
const MCInst *
MI,
502 MCRegister
Reg =
MI->getOperand(OpNo).getReg();
505 if (MCRegister SubReg =
MRI.getSubReg(
Reg, AMDGPU::sub0))
510void AMDGPUInstPrinter::printImmediateInt16(uint32_t
Imm,
513 int32_t SImm =
static_cast<int32_t
>(
Imm);
519 if (printImmediateFloat32(
Imm, STI, O))
522 O << formatHex(static_cast<uint64_t>(
Imm & 0xffff));
529 else if (
Imm == 0xBC00)
531 else if (
Imm == 0x3800)
533 else if (
Imm == 0xB800)
535 else if (
Imm == 0x4000)
537 else if (
Imm == 0xC000)
539 else if (
Imm == 0x4400)
541 else if (
Imm == 0xC400)
543 else if (
Imm == 0x3118 && STI.
hasFeature(AMDGPU::FeatureInv2PiInlineImm))
555 else if (
Imm == 0xBF80)
557 else if (
Imm == 0x3F00)
559 else if (
Imm == 0xBF00)
561 else if (
Imm == 0x4000)
563 else if (
Imm == 0xC000)
565 else if (
Imm == 0x4080)
567 else if (
Imm == 0xC080)
569 else if (
Imm == 0x3E22 && STI.
hasFeature(AMDGPU::FeatureInv2PiInlineImm))
577void AMDGPUInstPrinter::printImmediateBF16(uint32_t
Imm,
580 int16_t SImm =
static_cast<int16_t
>(
Imm);
589 O << formatHex(static_cast<uint64_t>(
Imm));
592void AMDGPUInstPrinter::printImmediateF16(uint32_t
Imm,
595 int16_t SImm =
static_cast<int16_t
>(
Imm);
601 uint16_t HImm =
static_cast<uint16_t
>(
Imm);
605 uint64_t
Imm16 =
static_cast<uint16_t
>(
Imm);
609void AMDGPUInstPrinter::printImmediateV216(uint32_t
Imm, uint8_t OpType,
612 int32_t SImm =
static_cast<int32_t
>(
Imm);
621 if (printImmediateFloat32(
Imm, STI, O))
635 uint16_t Lo16 =
static_cast<uint16_t
>(
Imm & 0xFFFF);
636 uint16_t Hi16 =
static_cast<uint16_t
>((
Imm >> 16) & 0xFFFF);
661 O << formatHex(static_cast<uint64_t>(
Imm));
664bool AMDGPUInstPrinter::printImmediateFloat32(uint32_t
Imm,
685 else if (
Imm == 0x3e22f983 &&
686 STI.
hasFeature(AMDGPU::FeatureInv2PiInlineImm))
694void AMDGPUInstPrinter::printImmediate32(uint32_t
Imm,
697 int32_t SImm =
static_cast<int32_t
>(
Imm);
703 if (printImmediateFloat32(
Imm, STI, O))
706 O << formatHex(static_cast<uint64_t>(
Imm));
709void AMDGPUInstPrinter::printImmediate64(uint64_t
Imm,
712 int64_t SImm =
static_cast<int64_t
>(
Imm);
713 if (SImm >= -16 && SImm <= 64) {
736 else if (
Imm == 0x3fc45f306dc9c882 &&
737 STI.
hasFeature(AMDGPU::FeatureInv2PiInlineImm))
738 O <<
"0.15915494309189532";
740 printLiteral64(
Imm, O, IsFP);
743void AMDGPUInstPrinter::printLiteral64(uint64_t
Imm,
raw_ostream &O,
746 O << formatHex(static_cast<uint64_t>(
Hi_32(
Imm)));
751void AMDGPUInstPrinter::printBLGP(
const MCInst *
MI,
unsigned OpNo,
754 unsigned Imm =
MI->getOperand(OpNo).getImm();
759 switch (
MI->getOpcode()) {
760 case AMDGPU::V_MFMA_F64_16X16X4F64_gfx940_acd:
761 case AMDGPU::V_MFMA_F64_16X16X4F64_gfx940_vcd:
762 case AMDGPU::V_MFMA_F64_4X4X4F64_gfx940_acd:
763 case AMDGPU::V_MFMA_F64_4X4X4F64_gfx940_vcd:
764 O <<
" neg:[" << (
Imm & 1) <<
',' << ((
Imm >> 1) & 1) <<
','
765 << ((
Imm >> 2) & 1) <<
']';
770 O <<
" blgp:" <<
Imm;
773void AMDGPUInstPrinter::printDefaultVccOperand(
bool FirstOperand,
787 unsigned OpNo)
const {
790 (
Desc.hasImplicitDefOfPhysReg(AMDGPU::VCC) ||
791 Desc.hasImplicitDefOfPhysReg(AMDGPU::VCC_LO));
795void AMDGPUInstPrinter::printOperand(
const MCInst *
MI,
unsigned OpNo,
798 unsigned Opc =
MI->getOpcode();
800 int ModIdx = AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::src0_modifiers);
806 (
Desc.hasImplicitDefOfPhysReg(AMDGPU::VCC) ||
807 Desc.hasImplicitDefOfPhysReg(AMDGPU::VCC_LO)))
808 printDefaultVccOperand(
true, STI, O);
810 printRegularOperand(
MI, OpNo, STI, O);
814void AMDGPUInstPrinter::printRegularOperand(
const MCInst *
MI,
unsigned OpNo,
817 const MCInstrDesc &
Desc =
MII.get(
MI->getOpcode());
819 if (OpNo >=
MI->getNumOperands()) {
820 O <<
"/*Missing OP" << OpNo <<
"*/";
824 const MCOperand &
Op =
MI->getOperand(OpNo);
831 const MCOperandInfo &OpInfo =
Desc.operands()[OpNo];
833 int16_t RCID =
MII.getOpRegClassID(
835 const MCRegisterClass &RC =
MRI.getRegClass(RCID);
839 (OpInfo.
RegClass == AMDGPU::SReg_1 ||
840 OpInfo.
RegClass == AMDGPU::SReg_1_XEXEC);
847 O <<
"/*Invalid register, operand has \'" <<
MRI.getRegClassName(&RC)
848 <<
"\' register class*/";
852 }
else if (
Op.isImm()) {
853 const uint8_t OpTy =
Desc.operands()[OpNo].OperandType;
865 printImmediate32(
Op.getImm(), STI, O);
870 printImmediate64(
Op.getImm(), STI, O,
false);
876 printImmediate64(
Op.getImm(), STI, O,
true);
880 printImmediateInt16(
Op.getImm(), STI, O);
884 printImmediateF16(
Op.getImm(), STI, O);
888 printImmediateBF16(
Op.getImm(), STI, O);
898 printImmediateV216(
Op.getImm(), OpTy, STI, O);
907 printImmediate32(
Op.getImm(), STI, O);
908 O <<
"/*Invalid immediate*/";
915 }
else if (
Op.isExpr()) {
916 const MCExpr *
Exp =
Op.getExpr();
917 MAI.printExpr(O, *Exp);
923 switch (
MI->getOpcode()) {
926 case AMDGPU::V_CNDMASK_B32_e32_gfx10:
927 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx10:
928 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx10:
929 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx10:
930 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx10:
931 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx10:
932 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx10:
933 case AMDGPU::V_CNDMASK_B32_dpp8_gfx10:
934 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx10:
935 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx10:
936 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx10:
937 case AMDGPU::V_CNDMASK_B32_e32_gfx11:
938 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx11:
939 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx11:
940 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx11:
941 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx11:
942 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx11:
943 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx11:
944 case AMDGPU::V_CNDMASK_B32_dpp8_gfx11:
945 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx11:
946 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx11:
947 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx11:
948 case AMDGPU::V_CNDMASK_B32_e32_gfx12:
949 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx12:
950 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx12:
951 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx12:
952 case AMDGPU::V_CNDMASK_B32_dpp_gfx12:
953 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx12:
954 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx12:
955 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx12:
956 case AMDGPU::V_CNDMASK_B32_dpp8_gfx12:
957 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx12:
958 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx12:
959 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx12:
960 case AMDGPU::V_CNDMASK_B32_e32_gfx13:
961 case AMDGPU::V_ADD_CO_CI_U32_e32_gfx13:
962 case AMDGPU::V_SUB_CO_CI_U32_e32_gfx13:
963 case AMDGPU::V_SUBREV_CO_CI_U32_e32_gfx13:
964 case AMDGPU::V_CNDMASK_B32_dpp_gfx13:
965 case AMDGPU::V_ADD_CO_CI_U32_dpp_gfx13:
966 case AMDGPU::V_SUB_CO_CI_U32_dpp_gfx13:
967 case AMDGPU::V_SUBREV_CO_CI_U32_dpp_gfx13:
968 case AMDGPU::V_CNDMASK_B32_dpp8_gfx13:
969 case AMDGPU::V_ADD_CO_CI_U32_dpp8_gfx13:
970 case AMDGPU::V_SUB_CO_CI_U32_dpp8_gfx13:
971 case AMDGPU::V_SUBREV_CO_CI_U32_dpp8_gfx13:
973 case AMDGPU::V_CNDMASK_B32_e32_gfx6_gfx7:
974 case AMDGPU::V_CNDMASK_B32_e32_vi:
975 if ((
int)OpNo == AMDGPU::getNamedOperandIdx(
MI->getOpcode(),
976 AMDGPU::OpName::src1))
977 printDefaultVccOperand(OpNo == 0, STI, O);
983 AMDGPU::getNamedOperandIdx(
MI->getOpcode(), AMDGPU::OpName::soffset);
985 if ((
int)OpNo == SOffsetIdx)
986 printSymbolicFormat(
MI, STI, O);
990void AMDGPUInstPrinter::printOperandAndFPInputMods(
const MCInst *
MI,
994 const MCInstrDesc &
Desc =
MII.get(
MI->getOpcode());
995 if (needsImpliedVcc(
Desc, OpNo))
996 printDefaultVccOperand(
true, STI, O);
998 unsigned InputModifiers =
MI->getOperand(OpNo).getImm();
1003 bool NegMnemo =
false;
1006 if (OpNo + 1 <
MI->getNumOperands() &&
1008 const MCOperand &
Op =
MI->getOperand(OpNo + 1);
1009 NegMnemo =
Op.isImm();
1020 printRegularOperand(
MI, OpNo + 1, STI, O);
1029 switch (
MI->getOpcode()) {
1033 case AMDGPU::V_CNDMASK_B32_sdwa_gfx10:
1034 case AMDGPU::V_CNDMASK_B32_dpp_gfx10:
1035 case AMDGPU::V_CNDMASK_B32_dpp_gfx11:
1036 if ((
int)OpNo + 1 ==
1037 AMDGPU::getNamedOperandIdx(
MI->getOpcode(), AMDGPU::OpName::src1))
1038 printDefaultVccOperand(OpNo == 0, STI, O);
1043void AMDGPUInstPrinter::printOperandAndIntInputMods(
const MCInst *
MI,
1047 const MCInstrDesc &
Desc =
MII.get(
MI->getOpcode());
1048 if (needsImpliedVcc(
Desc, OpNo))
1049 printDefaultVccOperand(
true, STI, O);
1051 unsigned InputModifiers =
MI->getOperand(OpNo).getImm();
1054 printRegularOperand(
MI, OpNo + 1, STI, O);
1059 switch (
MI->getOpcode()) {
1062 case AMDGPU::V_ADD_CO_CI_U32_sdwa_gfx10:
1063 case AMDGPU::V_SUB_CO_CI_U32_sdwa_gfx10:
1064 case AMDGPU::V_SUBREV_CO_CI_U32_sdwa_gfx10:
1065 if ((
int)OpNo + 1 == AMDGPU::getNamedOperandIdx(
MI->getOpcode(),
1066 AMDGPU::OpName::src1))
1067 printDefaultVccOperand(OpNo == 0, STI, O);
1072void AMDGPUInstPrinter::printDPP8(
const MCInst *
MI,
unsigned OpNo,
1078 unsigned Imm =
MI->getOperand(OpNo).getImm();
1080 for (
size_t i = 1; i < 8; ++i) {
1086void AMDGPUInstPrinter::printDPPCtrl(
const MCInst *
MI,
unsigned OpNo,
1089 using namespace AMDGPU::DPP;
1091 unsigned Imm =
MI->getOperand(OpNo).getImm();
1092 const MCInstrDesc &
Desc =
MII.get(
MI->getOpcode());
1096 O <<
" /* DP ALU dpp only supports "
1097 << (
isGFX12(STI) ?
"row_share" :
"row_newbcast") <<
" */";
1100 if (
Imm <= DppCtrl::QUAD_PERM_LAST) {
1106 }
else if ((
Imm >= DppCtrl::ROW_SHL_FIRST) &&
1107 (
Imm <= DppCtrl::ROW_SHL_LAST)) {
1109 }
else if ((
Imm >= DppCtrl::ROW_SHR_FIRST) &&
1110 (
Imm <= DppCtrl::ROW_SHR_LAST)) {
1112 }
else if ((
Imm >= DppCtrl::ROW_ROR_FIRST) &&
1113 (
Imm <= DppCtrl::ROW_ROR_LAST)) {
1115 }
else if (
Imm == DppCtrl::WAVE_SHL1) {
1117 O <<
"/* wave_shl is not supported starting from GFX10 */";
1121 }
else if (
Imm == DppCtrl::WAVE_ROL1) {
1123 O <<
"/* wave_rol is not supported starting from GFX10 */";
1127 }
else if (
Imm == DppCtrl::WAVE_SHR1) {
1129 O <<
"/* wave_shr is not supported starting from GFX10 */";
1133 }
else if (
Imm == DppCtrl::WAVE_ROR1) {
1135 O <<
"/* wave_ror is not supported starting from GFX10 */";
1139 }
else if (
Imm == DppCtrl::ROW_MIRROR) {
1141 }
else if (
Imm == DppCtrl::ROW_HALF_MIRROR) {
1142 O <<
"row_half_mirror";
1143 }
else if (
Imm == DppCtrl::BCAST15) {
1145 O <<
"/* row_bcast is not supported starting from GFX10 */";
1148 O <<
"row_bcast:15";
1149 }
else if (
Imm == DppCtrl::BCAST31) {
1151 O <<
"/* row_bcast is not supported starting from GFX10 */";
1154 O <<
"row_bcast:31";
1155 }
else if ((
Imm >= DppCtrl::ROW_SHARE_FIRST) &&
1156 (
Imm <= DppCtrl::ROW_SHARE_LAST)) {
1158 O <<
"row_newbcast:";
1162 O <<
" /* row_newbcast/row_share is not supported on ASICs earlier "
1163 "than GFX90A/GFX10 */";
1167 }
else if ((
Imm >= DppCtrl::ROW_XMASK_FIRST) &&
1168 (
Imm <= DppCtrl::ROW_XMASK_LAST)) {
1170 O <<
"/* row_xmask is not supported on ASICs earlier than GFX10 */";
1173 O <<
"row_xmask:" <<
formatDec(
Imm - DppCtrl::ROW_XMASK_FIRST);
1175 O <<
"/* Invalid dpp_ctrl value */";
1179void AMDGPUInstPrinter::printDppBoundCtrl(
const MCInst *
MI,
unsigned OpNo,
1182 unsigned Imm =
MI->getOperand(OpNo).getImm();
1184 O <<
" bound_ctrl:1";
1188void AMDGPUInstPrinter::printDppFI(
const MCInst *
MI,
unsigned OpNo,
1190 using namespace llvm::AMDGPU::DPP;
1191 unsigned Imm =
MI->getOperand(OpNo).getImm();
1192 if (
Imm == DPP_FI_1 ||
Imm == DPP8_FI_1) {
1197void AMDGPUInstPrinter::printSDWASel(
const MCInst *
MI,
unsigned OpNo,
1199 using namespace llvm::AMDGPU::SDWA;
1201 unsigned Imm =
MI->getOperand(OpNo).getImm();
1203 case SdwaSel::BYTE_0:
O <<
"BYTE_0";
break;
1204 case SdwaSel::BYTE_1:
O <<
"BYTE_1";
break;
1205 case SdwaSel::BYTE_2:
O <<
"BYTE_2";
break;
1206 case SdwaSel::BYTE_3:
O <<
"BYTE_3";
break;
1207 case SdwaSel::WORD_0:
O <<
"WORD_0";
break;
1208 case SdwaSel::WORD_1:
O <<
"WORD_1";
break;
1209 case SdwaSel::DWORD:
O <<
"DWORD";
break;
1214void AMDGPUInstPrinter::printSDWADstSel(
const MCInst *
MI,
unsigned OpNo,
1218 printSDWASel(
MI, OpNo, O);
1221void AMDGPUInstPrinter::printSDWASrc0Sel(
const MCInst *
MI,
unsigned OpNo,
1225 printSDWASel(
MI, OpNo, O);
1228void AMDGPUInstPrinter::printSDWASrc1Sel(
const MCInst *
MI,
unsigned OpNo,
1232 printSDWASel(
MI, OpNo, O);
1235void AMDGPUInstPrinter::printSDWADstUnused(
const MCInst *
MI,
unsigned OpNo,
1238 using namespace llvm::AMDGPU::SDWA;
1241 unsigned Imm =
MI->getOperand(OpNo).getImm();
1243 case DstUnused::UNUSED_PAD:
O <<
"UNUSED_PAD";
break;
1244 case DstUnused::UNUSED_SEXT:
O <<
"UNUSED_SEXT";
break;
1245 case DstUnused::UNUSED_PRESERVE:
O <<
"UNUSED_PRESERVE";
break;
1250void AMDGPUInstPrinter::printExpSrcN(
const MCInst *
MI,
unsigned OpNo,
1253 unsigned Opc =
MI->getOpcode();
1254 int EnIdx = AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::en);
1255 unsigned En =
MI->getOperand(EnIdx).getImm();
1257 int ComprIdx = AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::compr);
1260 if (
MI->getOperand(ComprIdx).getImm())
1261 OpNo = OpNo -
N +
N / 2;
1269void AMDGPUInstPrinter::printExpSrc0(
const MCInst *
MI,
unsigned OpNo,
1272 printExpSrcN(
MI, OpNo, STI, O, 0);
1275void AMDGPUInstPrinter::printExpSrc1(
const MCInst *
MI,
unsigned OpNo,
1278 printExpSrcN(
MI, OpNo, STI, O, 1);
1281void AMDGPUInstPrinter::printExpSrc2(
const MCInst *
MI,
unsigned OpNo,
1284 printExpSrcN(
MI, OpNo, STI, O, 2);
1287void AMDGPUInstPrinter::printExpSrc3(
const MCInst *
MI,
unsigned OpNo,
1290 printExpSrcN(
MI, OpNo, STI, O, 3);
1293void AMDGPUInstPrinter::printExpTgt(
const MCInst *
MI,
unsigned OpNo,
1296 using namespace llvm::AMDGPU::Exp;
1299 unsigned Id =
MI->getOperand(OpNo).getImm() & ((1 << 6) - 1);
1304 O <<
' ' << TgtName;
1308 O <<
" invalid_target_" <<
Id;
1313 bool IsPacked,
bool HasDstSel) {
1317 if (!!(
Ops[
I] &
Mod) != DefaultValue)
1327void AMDGPUInstPrinter::printPackedModifier(
const MCInst *
MI,
1331 unsigned Opc =
MI->getOpcode();
1335 std::pair<AMDGPU::OpName, AMDGPU::OpName> MOps[] = {
1336 {AMDGPU::OpName::src0_modifiers, AMDGPU::OpName::src0},
1337 {AMDGPU::OpName::src1_modifiers, AMDGPU::OpName::src1},
1338 {AMDGPU::OpName::src2_modifiers, AMDGPU::OpName::src2}};
1341 for (
auto [SrcMod, Src] : MOps) {
1345 int ModIdx = AMDGPU::getNamedOperandIdx(
Opc, SrcMod);
1347 (ModIdx != -1) ?
MI->getOperand(ModIdx).getImm() : DefaultValue;
1356 AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::src2_modifiers);
1362 (AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::vdst) != -1) ||
1363 (AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::sdst) != -1);
1370 for (AMDGPU::OpName OpName :
1371 {AMDGPU::OpName::src0_modifiers, AMDGPU::OpName::src1_modifiers,
1372 AMDGPU::OpName::src2_modifiers}) {
1373 int Idx = AMDGPU::getNamedOperandIdx(
Opc, OpName);
1390 ListSeparator Sep(
",");
1401void AMDGPUInstPrinter::printOpSel(
const MCInst *
MI,
unsigned,
1404 unsigned Opc =
MI->getOpcode();
1407 AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::src0_modifiers);
1408 unsigned Mod =
MI->getOperand(SrcMod).getImm();
1411 if (Index0 || Index1)
1412 O <<
" op_sel:[" << Index0 <<
',' << Index1 <<
']';
1416 auto FIN = AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::src0_modifiers);
1417 auto BCN = AMDGPU::getNamedOperandIdx(
Opc, AMDGPU::OpName::src1_modifiers);
1421 O <<
" op_sel:[" << FI <<
',' << BC <<
']';
1428void AMDGPUInstPrinter::printOpSelHi(
const MCInst *
MI,
unsigned OpNo,
1434void AMDGPUInstPrinter::printNegLo(
const MCInst *
MI,
unsigned OpNo,
1440void AMDGPUInstPrinter::printNegHi(
const MCInst *
MI,
unsigned OpNo,
1446void AMDGPUInstPrinter::printIndexKey8bit(
const MCInst *
MI,
unsigned OpNo,
1449 auto Imm =
MI->getOperand(OpNo).getImm() & 0x7;
1453 O <<
" index_key:" <<
Imm;
1456void AMDGPUInstPrinter::printIndexKey16bit(
const MCInst *
MI,
unsigned OpNo,
1459 auto Imm =
MI->getOperand(OpNo).getImm() & 0x7;
1463 O <<
" index_key:" <<
Imm;
1466void AMDGPUInstPrinter::printIndexKey32bit(
const MCInst *
MI,
unsigned OpNo,
1469 auto Imm =
MI->getOperand(OpNo).getImm() & 0x7;
1473 O <<
" index_key:" <<
Imm;
1476void AMDGPUInstPrinter::printMatrixFMT(
const MCInst *
MI,
unsigned OpNo,
1479 auto Imm =
MI->getOperand(OpNo).getImm() & 0x7;
1483 O <<
" matrix_" << AorB <<
"_fmt:";
1490void AMDGPUInstPrinter::printMatrixAFMT(
const MCInst *
MI,
unsigned OpNo,
1493 printMatrixFMT(
MI, OpNo, STI, O,
'a');
1496void AMDGPUInstPrinter::printMatrixBFMT(
const MCInst *
MI,
unsigned OpNo,
1499 printMatrixFMT(
MI, OpNo, STI, O,
'b');
1502void AMDGPUInstPrinter::printMatrixScale(
const MCInst *
MI,
unsigned OpNo,
1505 auto Imm =
MI->getOperand(OpNo).getImm() & 1;
1509 O <<
" matrix_" << AorB <<
"_scale:";
1516void AMDGPUInstPrinter::printMatrixAScale(
const MCInst *
MI,
unsigned OpNo,
1519 printMatrixScale(
MI, OpNo, STI, O,
'a');
1522void AMDGPUInstPrinter::printMatrixBScale(
const MCInst *
MI,
unsigned OpNo,
1525 printMatrixScale(
MI, OpNo, STI, O,
'b');
1528void AMDGPUInstPrinter::printMatrixScaleFmt(
const MCInst *
MI,
unsigned OpNo,
1531 auto Imm =
MI->getOperand(OpNo).getImm() & 3;
1535 O <<
" matrix_" << AorB <<
"_scale_fmt:";
1542void AMDGPUInstPrinter::printMatrixAScaleFmt(
const MCInst *
MI,
unsigned OpNo,
1545 printMatrixScaleFmt(
MI, OpNo, STI, O,
'a');
1548void AMDGPUInstPrinter::printMatrixBScaleFmt(
const MCInst *
MI,
unsigned OpNo,
1551 printMatrixScaleFmt(
MI, OpNo, STI, O,
'b');
1554void AMDGPUInstPrinter::printInterpSlot(
const MCInst *
MI,
unsigned OpNum,
1557 unsigned Imm =
MI->getOperand(OpNum).getImm();
1569 O <<
"invalid_param_" <<
Imm;
1573void AMDGPUInstPrinter::printInterpAttr(
const MCInst *
MI,
unsigned OpNum,
1576 unsigned Attr =
MI->getOperand(OpNum).getImm();
1577 O <<
"attr" << Attr;
1580void AMDGPUInstPrinter::printInterpAttrChan(
const MCInst *
MI,
unsigned OpNum,
1583 unsigned Chan =
MI->getOperand(OpNum).getImm();
1584 O <<
'.' <<
"xyzw"[Chan & 0x3];
1587void AMDGPUInstPrinter::printGPRIdxMode(
const MCInst *
MI,
unsigned OpNo,
1590 using namespace llvm::AMDGPU::VGPRIndexMode;
1591 unsigned Val =
MI->getOperand(OpNo).getImm();
1593 if ((Val & ~ENABLE_MASK) != 0) {
1594 O << formatHex(static_cast<uint64_t>(Val));
1597 ListSeparator Sep(
",");
1598 for (
unsigned ModeId = ID_MIN; ModeId <=
ID_MAX; ++ModeId) {
1599 if (Val & (1 << ModeId))
1606void AMDGPUInstPrinter::printMemOperand(
const MCInst *
MI,
unsigned OpNo,
1609 printRegularOperand(
MI, OpNo, STI, O);
1611 printRegularOperand(
MI, OpNo + 1, STI, O);
1619 if (
Op.getImm() == 1) {
1630 if (
Op.getImm() == 1)
1637 int Imm =
MI->getOperand(OpNo).getImm();
1651 const unsigned Imm16 =
MI->getOperand(OpNo).getImm();
1662 O <<
"sendmsg(" << MsgName;
1671 O <<
"sendmsg(" << MsgId <<
", " << OpId <<
", " <<
StreamId <<
')';
1684 if (EventName.
empty())
1685 O << formatHex(static_cast<uint64_t>(Imm16));
1696 uint16_t Probe0 = ((0 & AndMask) | OrMask) ^ XorMask;
1701 for (
unsigned Mask = 1 << (
BITMASK_WIDTH - 1); Mask > 0; Mask >>= 1) {
1771 }
else if (AndMask ==
BITMASK_MAX && OrMask == 0 && XorMask > 0 &&
1782 if (GroupSize > 1 &&
1784 OrMask < GroupSize &&
1802 printU16ImmDecOperand(
MI, OpNo, O);
1811 unsigned SImm16 =
MI->getOperand(OpNo).getImm();
1812 unsigned Vmcnt, Expcnt, Lgkmcnt;
1818 bool PrintAll = IsDefaultVmcnt && IsDefaultExpcnt && IsDefaultLgkmcnt;
1822 if (!IsDefaultVmcnt || PrintAll)
1823 O << Sep <<
"vmcnt(" << Vmcnt <<
')';
1825 if (!IsDefaultExpcnt || PrintAll)
1826 O << Sep <<
"expcnt(" << Expcnt <<
')';
1828 if (!IsDefaultLgkmcnt || PrintAll)
1829 O << Sep <<
"lgkmcnt(" << Lgkmcnt <<
')';
1837 uint64_t Imm16 =
MI->getOperand(OpNo).getImm() & 0xffff;
1839 bool HasNonDefaultVal =
false;
1847 if (!IsDefault || !HasNonDefaultVal)
1848 O << Sep << Name <<
'(' << Val <<
')';
1858 const char *BadInstId =
"/* invalid instid value */";
1859 static const std::array<const char *, 12> InstIds = {
1860 "NO_DEP",
"VALU_DEP_1",
"VALU_DEP_2",
1861 "VALU_DEP_3",
"VALU_DEP_4",
"TRANS32_DEP_1",
1862 "TRANS32_DEP_2",
"TRANS32_DEP_3",
"FMA_ACCUM_CYCLE_1",
1863 "SALU_CYCLE_1",
"SALU_CYCLE_2",
"SALU_CYCLE_3"};
1865 const char *BadInstSkip =
"/* invalid instskip value */";
1866 static const std::array<const char *, 6> InstSkips = {
1867 "SAME",
"NEXT",
"SKIP_1",
"SKIP_2",
"SKIP_3",
"SKIP_4"};
1869 unsigned SImm16 =
MI->getOperand(OpNo).getImm();
1870 const char *Prefix =
"";
1872 unsigned Value = SImm16 & 0xF;
1874 const char *Name =
Value < InstIds.size() ? InstIds[
Value] : BadInstId;
1875 O << Prefix <<
"instid0(" << Name <<
')';
1879 Value = (SImm16 >> 4) & 7;
1882 Value < InstSkips.size() ? InstSkips[
Value] : BadInstSkip;
1883 O << Prefix <<
"instskip(" << Name <<
')';
1887 Value = (SImm16 >> 7) & 0xF;
1889 const char *Name =
Value < InstIds.size() ? InstIds[
Value] : BadInstId;
1890 O << Prefix <<
"instid1(" << Name <<
')';
1901 unsigned Val =
MI->getOperand(OpNo).getImm();
1906 if (!HwRegName.
empty()) {
1912 O <<
", " <<
Offset <<
", " << Width;
1927void AMDGPUInstPrinter::printNamedInt(
const MCInst *
MI,
unsigned OpNo,
1930 bool PrintInHex,
bool AlwaysPrint) {
1931 int64_t V =
MI->getOperand(OpNo).getImm();
1932 if (AlwaysPrint || V != 0)
1936void AMDGPUInstPrinter::printBitOp3(
const MCInst *
MI,
unsigned OpNo,
1947 O << formatHex(static_cast<uint64_t>(
Imm));
1950void AMDGPUInstPrinter::printScaleSel(
const MCInst *
MI,
unsigned OpNo,
1953 uint8_t
Imm =
MI->getOperand(OpNo).getImm();
1960#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
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...
uint16_t getEncodingValue(MCRegister Reg) const
Returns the encoding for Reg.
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)
LLVM_READONLY bool hasNamedOperand(uint64_t Opcode, OpName NamedIdx)
bool getVOP3IsSingle(unsigned Opc)
bool getVOP1IsSingle(unsigned Opc)
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_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 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 isMTBUF(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)
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.
@ Default
The result value is uniform if and only if all operands are uniform.
static constexpr ValueType Default
static std::tuple< typename Fields::ValueType... > decode(uint64_t Encoded)
Instruction set architecture version.
StringTable::Offset AsmSuffix