32#define DEBUG_TYPE "hexagon-disassembler"
35using namespace Hexagon;
44 std::unique_ptr<MCInstrInfo const>
const MCII;
45 std::unique_ptr<MCInst *> CurrentBundle;
46 mutable MCInst const *CurrentExtender;
51 CurrentExtender(
nullptr) {}
59 void remapInstruction(
MCInst &Instr)
const;
62static uint64_t fullValue(HexagonDisassembler
const &Disassembler,
MCInst &
MI,
65 if (!Disassembler.CurrentExtender ||
72 Disassembler.CurrentExtender->getOperand(0).getExpr()->evaluateAsAbsolute(
80static HexagonDisassembler
const &disassembler(
const MCDisassembler *Decoder) {
81 return *
static_cast<HexagonDisassembler
const *
>(Decoder);
84static void signedDecoder(
MCInst &
MI,
unsigned tmp,
86 HexagonDisassembler
const &Disassembler = disassembler(Decoder);
87 int64_t FullValue = fullValue(Disassembler,
MI, SignExtend64<T>(tmp));
88 int64_t Extended = SignExtend64<32>(FullValue);
159#include "HexagonGenDisassemblerTables.inc"
164 return new HexagonDisassembler(STI, Ctx,
T.createMCInstrInfo());
179 bool Complete =
false;
182 *CurrentBundle = &
MI;
183 MI.setOpcode(Hexagon::BUNDLE);
185 while (Result ==
Success && !Complete) {
188 MCInst *Inst = getContext().createMCInst();
189 Result = getSingleInstruction(*Inst,
MI, Bytes, Address, CS, Complete);
200 const auto STI_ = (ArchSTI !=
nullptr) ? *ArchSTI : STI;
202 *getContext().getRegisterInfo(),
false);
203 if (!Checker.check())
205 remapInstruction(
MI);
209void HexagonDisassembler::remapInstruction(
MCInst &Instr)
const {
211 auto &
MI =
const_cast<MCInst &
>(*
I.getInst());
212 switch (
MI.getOpcode()) {
213 case Hexagon::S2_allocframe:
214 if (
MI.getOperand(0).getReg() == Hexagon::R29) {
215 MI.setOpcode(Hexagon::S6_allocframe_to_raw);
216 MI.erase(
MI.begin () + 1);
217 MI.erase(
MI.begin ());
220 case Hexagon::L2_deallocframe:
221 if (
MI.getOperand(0).getReg() == Hexagon::D15 &&
222 MI.getOperand(1).getReg() == Hexagon::R30) {
223 MI.setOpcode(L6_deallocframe_map_to_raw);
224 MI.erase(
MI.begin () + 1);
225 MI.erase(
MI.begin ());
228 case Hexagon::L4_return:
229 if (
MI.getOperand(0).getReg() == Hexagon::D15 &&
230 MI.getOperand(1).getReg() == Hexagon::R30) {
231 MI.setOpcode(L6_return_map_to_raw);
232 MI.erase(
MI.begin () + 1);
233 MI.erase(
MI.begin ());
236 case Hexagon::L4_return_t:
237 if (
MI.getOperand(0).getReg() == Hexagon::D15 &&
238 MI.getOperand(2).getReg() == Hexagon::R30) {
239 MI.setOpcode(L4_return_map_to_raw_t);
240 MI.erase(
MI.begin () + 2);
241 MI.erase(
MI.begin ());
244 case Hexagon::L4_return_f:
245 if (
MI.getOperand(0).getReg() == Hexagon::D15 &&
246 MI.getOperand(2).getReg() == Hexagon::R30) {
247 MI.setOpcode(L4_return_map_to_raw_f);
248 MI.erase(
MI.begin () + 2);
249 MI.erase(
MI.begin ());
252 case Hexagon::L4_return_tnew_pt:
253 if (
MI.getOperand(0).getReg() == Hexagon::D15 &&
254 MI.getOperand(2).getReg() == Hexagon::R30) {
255 MI.setOpcode(L4_return_map_to_raw_tnew_pt);
256 MI.erase(
MI.begin () + 2);
257 MI.erase(
MI.begin ());
260 case Hexagon::L4_return_fnew_pt:
261 if (
MI.getOperand(0).getReg() == Hexagon::D15 &&
262 MI.getOperand(2).getReg() == Hexagon::R30) {
263 MI.setOpcode(L4_return_map_to_raw_fnew_pt);
264 MI.erase(
MI.begin () + 2);
265 MI.erase(
MI.begin ());
268 case Hexagon::L4_return_tnew_pnt:
269 if (
MI.getOperand(0).getReg() == Hexagon::D15 &&
270 MI.getOperand(2).getReg() == Hexagon::R30) {
271 MI.setOpcode(L4_return_map_to_raw_tnew_pnt);
272 MI.erase(
MI.begin () + 2);
273 MI.erase(
MI.begin ());
276 case Hexagon::L4_return_fnew_pnt:
277 if (
MI.getOperand(0).getReg() == Hexagon::D15 &&
278 MI.getOperand(2).getReg() == Hexagon::R30) {
279 MI.setOpcode(L4_return_map_to_raw_fnew_pnt);
280 MI.erase(
MI.begin () + 2);
281 MI.erase(
MI.begin ());
289 switch (
MI.getOpcode()) {
290 case Hexagon::SA1_setin1:
291 MI.insert(
MI.begin() + 1,
294 case Hexagon::SA1_dec:
295 MI.insert(
MI.begin() + 2,
307 bool &Complete)
const {
317 else if (BundleSize == 1)
320 return DecodeStatus::Fail;
329 unsigned duplexIClass;
330 uint8_t const *DecodeLow, *DecodeHigh;
332 switch (duplexIClass) {
336 DecodeLow = DecoderTableSUBINSN_L132;
337 DecodeHigh = DecoderTableSUBINSN_L132;
340 DecodeLow = DecoderTableSUBINSN_L232;
341 DecodeHigh = DecoderTableSUBINSN_L132;
344 DecodeLow = DecoderTableSUBINSN_L232;
345 DecodeHigh = DecoderTableSUBINSN_L232;
348 DecodeLow = DecoderTableSUBINSN_A32;
349 DecodeHigh = DecoderTableSUBINSN_A32;
352 DecodeLow = DecoderTableSUBINSN_L132;
353 DecodeHigh = DecoderTableSUBINSN_A32;
356 DecodeLow = DecoderTableSUBINSN_L232;
357 DecodeHigh = DecoderTableSUBINSN_A32;
360 DecodeLow = DecoderTableSUBINSN_S132;
361 DecodeHigh = DecoderTableSUBINSN_A32;
364 DecodeLow = DecoderTableSUBINSN_S232;
365 DecodeHigh = DecoderTableSUBINSN_A32;
368 DecodeLow = DecoderTableSUBINSN_S132;
369 DecodeHigh = DecoderTableSUBINSN_L132;
372 DecodeLow = DecoderTableSUBINSN_S132;
373 DecodeHigh = DecoderTableSUBINSN_L232;
376 DecodeLow = DecoderTableSUBINSN_S132;
377 DecodeHigh = DecoderTableSUBINSN_S132;
380 DecodeLow = DecoderTableSUBINSN_S232;
381 DecodeHigh = DecoderTableSUBINSN_S132;
384 DecodeLow = DecoderTableSUBINSN_S232;
385 DecodeHigh = DecoderTableSUBINSN_L132;
388 DecodeLow = DecoderTableSUBINSN_S232;
389 DecodeHigh = DecoderTableSUBINSN_L232;
392 DecodeLow = DecoderTableSUBINSN_S232;
393 DecodeHigh = DecoderTableSUBINSN_S232;
396 MI.setOpcode(Hexagon::DuplexIClass0 + duplexIClass);
397 MCInst *MILow = getContext().createMCInst();
398 MCInst *MIHigh = getContext().createMCInst();
399 auto TmpExtender = CurrentExtender;
404 CurrentExtender = TmpExtender;
405 if (Result != DecodeStatus::Success)
406 return DecodeStatus::Fail;
408 Result = decodeInstruction(
409 DecodeHigh, *MIHigh, (
Instruction >> 16) & 0x1fff, Address,
this, STI);
410 if (Result != DecodeStatus::Success)
411 return DecodeStatus::Fail;
415 MI.addOperand(OPLow);
416 MI.addOperand(OPHigh);
423 if (CurrentExtender !=
nullptr)
432 STI.hasFeature(Hexagon::ExtensionHVX))
438 switch (
MI.getOpcode()) {
439 case Hexagon::J4_cmpeqn1_f_jumpnv_nt:
440 case Hexagon::J4_cmpeqn1_f_jumpnv_t:
441 case Hexagon::J4_cmpeqn1_fp0_jump_nt:
442 case Hexagon::J4_cmpeqn1_fp0_jump_t:
443 case Hexagon::J4_cmpeqn1_fp1_jump_nt:
444 case Hexagon::J4_cmpeqn1_fp1_jump_t:
445 case Hexagon::J4_cmpeqn1_t_jumpnv_nt:
446 case Hexagon::J4_cmpeqn1_t_jumpnv_t:
447 case Hexagon::J4_cmpeqn1_tp0_jump_nt:
448 case Hexagon::J4_cmpeqn1_tp0_jump_t:
449 case Hexagon::J4_cmpeqn1_tp1_jump_nt:
450 case Hexagon::J4_cmpeqn1_tp1_jump_t:
451 case Hexagon::J4_cmpgtn1_f_jumpnv_nt:
452 case Hexagon::J4_cmpgtn1_f_jumpnv_t:
453 case Hexagon::J4_cmpgtn1_fp0_jump_nt:
454 case Hexagon::J4_cmpgtn1_fp0_jump_t:
455 case Hexagon::J4_cmpgtn1_fp1_jump_nt:
456 case Hexagon::J4_cmpgtn1_fp1_jump_t:
457 case Hexagon::J4_cmpgtn1_t_jumpnv_nt:
458 case Hexagon::J4_cmpgtn1_t_jumpnv_t:
459 case Hexagon::J4_cmpgtn1_tp0_jump_nt:
460 case Hexagon::J4_cmpgtn1_tp0_jump_t:
461 case Hexagon::J4_cmpgtn1_tp1_jump_nt:
462 case Hexagon::J4_cmpgtn1_tp1_jump_t:
463 MI.insert(
MI.begin() + 1,
473 assert(MCO.
isReg() &&
"New value consumers must be registers");
475 getContext().getRegisterInfo()->getEncodingValue(MCO.
getReg());
479 unsigned Lookback = (
Register & 0x6) >> 1;
482 bool PrevVector =
false;
490 if (
Vector && !CurrentVector)
495 PrevVector = CurrentVector;
499 auto const &Inst = *i->getInst();
500 bool SubregBit = (
Register & 0x1) != 0;
507 assert(Producer != Hexagon::NoRegister);
515 const unsigned ProdPairIndex =
518 SubregBit = !SubregBit;
519 Producer = (ProdPairIndex << 1) + SubregBit + Hexagon::V0;
520 }
else if (SubregBit)
524 assert(Producer != Hexagon::NoRegister);
530 if (CurrentExtender !=
nullptr) {
532 ? *
MI.getOperand(1).getInst()
543 if (RegNo < Table.
size()) {
561 Hexagon::R0, Hexagon::R1, Hexagon::R2, Hexagon::R3, Hexagon::R4,
562 Hexagon::R5, Hexagon::R6, Hexagon::R7, Hexagon::R8, Hexagon::R9,
563 Hexagon::R10, Hexagon::R11, Hexagon::R12, Hexagon::R13, Hexagon::R14,
564 Hexagon::R15, Hexagon::R16, Hexagon::R17, Hexagon::R18, Hexagon::R19,
565 Hexagon::R20, Hexagon::R21, Hexagon::R22, Hexagon::R23, Hexagon::R24,
566 Hexagon::R25, Hexagon::R26, Hexagon::R27, Hexagon::R28, Hexagon::R29,
567 Hexagon::R30, Hexagon::R31};
576 static const MCPhysReg GeneralSubRegDecoderTable[] = {
577 Hexagon::R0, Hexagon::R1, Hexagon::R2, Hexagon::R3,
578 Hexagon::R4, Hexagon::R5, Hexagon::R6, Hexagon::R7,
579 Hexagon::R16, Hexagon::R17, Hexagon::R18, Hexagon::R19,
580 Hexagon::R20, Hexagon::R21, Hexagon::R22, Hexagon::R23,
589 static const MCPhysReg HvxVRDecoderTable[] = {
590 Hexagon::V0, Hexagon::V1, Hexagon::V2, Hexagon::V3, Hexagon::V4,
591 Hexagon::V5, Hexagon::V6, Hexagon::V7, Hexagon::V8, Hexagon::V9,
592 Hexagon::V10, Hexagon::V11, Hexagon::V12, Hexagon::V13, Hexagon::V14,
593 Hexagon::V15, Hexagon::V16, Hexagon::V17, Hexagon::V18, Hexagon::V19,
594 Hexagon::V20, Hexagon::V21, Hexagon::V22, Hexagon::V23, Hexagon::V24,
595 Hexagon::V25, Hexagon::V26, Hexagon::V27, Hexagon::V28, Hexagon::V29,
596 Hexagon::V30, Hexagon::V31};
605 static const MCPhysReg DoubleRegDecoderTable[] = {
606 Hexagon::D0, Hexagon::D1, Hexagon::D2, Hexagon::D3,
607 Hexagon::D4, Hexagon::D5, Hexagon::D6, Hexagon::D7,
608 Hexagon::D8, Hexagon::D9, Hexagon::D10, Hexagon::D11,
609 Hexagon::D12, Hexagon::D13, Hexagon::D14, Hexagon::D15};
618 static const MCPhysReg GeneralDoubleLow8RegDecoderTable[] = {
619 Hexagon::D0, Hexagon::D1, Hexagon::D2, Hexagon::D3,
620 Hexagon::D8, Hexagon::D9, Hexagon::D10, Hexagon::D11};
628 static const MCPhysReg HvxWRDecoderTable[] = {
629 Hexagon::W0, Hexagon::WR0, Hexagon::W1, Hexagon::WR1, Hexagon::W2,
630 Hexagon::WR2, Hexagon::W3, Hexagon::WR3, Hexagon::W4, Hexagon::WR4,
631 Hexagon::W5, Hexagon::WR5, Hexagon::W6, Hexagon::WR6, Hexagon::W7,
632 Hexagon::WR7, Hexagon::W8, Hexagon::WR8, Hexagon::W9, Hexagon::WR9,
633 Hexagon::W10, Hexagon::WR10, Hexagon::W11, Hexagon::WR11, Hexagon::W12,
634 Hexagon::WR12, Hexagon::W13, Hexagon::WR13, Hexagon::W14, Hexagon::WR14,
635 Hexagon::W15, Hexagon::WR15,
646 static const MCPhysReg HvxVQRDecoderTable[] = {
647 Hexagon::VQ0, Hexagon::VQ1, Hexagon::VQ2, Hexagon::VQ3,
648 Hexagon::VQ4, Hexagon::VQ5, Hexagon::VQ6, Hexagon::VQ7};
656 static const MCPhysReg PredRegDecoderTable[] = {Hexagon::P0, Hexagon::P1,
657 Hexagon::P2, Hexagon::P3};
665 static const MCPhysReg HvxQRDecoderTable[] = {Hexagon::Q0, Hexagon::Q1,
666 Hexagon::Q2, Hexagon::Q3};
674 using namespace Hexagon;
676 static const MCPhysReg CtrlRegDecoderTable[] = {
680 CS0, CS1, UPCYCLELO, UPCYCLEHI,
681 FRAMELIMIT, FRAMEKEY, PKTCOUNTLO, PKTCOUNTHI,
684 0, 0, UTIMERLO, UTIMERHI
687 if (RegNo >= std::size(CtrlRegDecoderTable))
690 static_assert(NoRegister == 0,
"Expecting NoRegister to be 0");
691 if (CtrlRegDecoderTable[RegNo] == NoRegister)
694 unsigned Register = CtrlRegDecoderTable[RegNo];
702 using namespace Hexagon;
704 static const MCPhysReg CtrlReg64DecoderTable[] = {
709 C17_16, 0, PKTCOUNT, 0,
715 if (RegNo >= std::size(CtrlReg64DecoderTable))
718 static_assert(NoRegister == 0,
"Expecting NoRegister to be 0");
719 if (CtrlReg64DecoderTable[RegNo] == NoRegister)
722 unsigned Register = CtrlReg64DecoderTable[RegNo];
748 HexagonDisassembler
const &Disassembler = disassembler(Decoder);
749 int64_t FullValue = fullValue(Disassembler,
MI, tmp);
750 assert(FullValue >= 0 &&
"Negative in unsigned decoder");
758 HexagonDisassembler
const &Disassembler = disassembler(Decoder);
761 signedDecoder<32>(
MI, tmp, Decoder);
768 HexagonDisassembler
const &Disassembler = disassembler(Decoder);
775 if (!Disassembler.tryAddingSymbolicOperand(
MI, Extended,
Address,
true, 0, 0,
782 Hexagon::SGP0, Hexagon::SGP1, Hexagon::STID,
783 Hexagon::ELR, Hexagon::BADVA0, Hexagon::BADVA1,
784 Hexagon::SSR, Hexagon::CCR, Hexagon::HTID,
785 Hexagon::BADVA, Hexagon::IMASK, Hexagon::S11,
786 Hexagon::S12, Hexagon::S13, Hexagon::S14,
787 Hexagon::S15, Hexagon::EVB, Hexagon::MODECTL,
788 Hexagon::SYSCFG, Hexagon::S19, Hexagon::S20,
789 Hexagon::VID, Hexagon::S22, Hexagon::S23,
790 Hexagon::S24, Hexagon::S25, Hexagon::S26,
791 Hexagon::CFGBASE, Hexagon::DIAG, Hexagon::REV,
792 Hexagon::PCYCLELO, Hexagon::PCYCLEHI, Hexagon::ISDBST,
793 Hexagon::ISDBCFG0, Hexagon::ISDBCFG1, Hexagon::S35,
794 Hexagon::BRKPTPC0, Hexagon::BRKPTCFG0, Hexagon::BRKPTPC1,
795 Hexagon::BRKPTCFG1, Hexagon::ISDBMBXIN, Hexagon::ISDBMBXOUT,
796 Hexagon::ISDBEN, Hexagon::ISDBGPR, Hexagon::S44,
797 Hexagon::S45, Hexagon::S46, Hexagon::S47,
798 Hexagon::PMUCNT0, Hexagon::PMUCNT1, Hexagon::PMUCNT2,
799 Hexagon::PMUCNT3, Hexagon::PMUEVTCFG, Hexagon::PMUCFG,
800 Hexagon::S54, Hexagon::S55, Hexagon::S56,
801 Hexagon::S57, Hexagon::S58, Hexagon::S59,
802 Hexagon::S60, Hexagon::S61, Hexagon::S62,
803 Hexagon::S63, Hexagon::S64, Hexagon::S65,
804 Hexagon::S66, Hexagon::S67, Hexagon::S68,
805 Hexagon::S69, Hexagon::S70, Hexagon::S71,
806 Hexagon::S72, Hexagon::S73, Hexagon::S74,
807 Hexagon::S75, Hexagon::S76, Hexagon::S77,
808 Hexagon::S78, Hexagon::S79, Hexagon::S80,
826 Hexagon::SGP1_0, Hexagon::S3_2, Hexagon::S5_4, Hexagon::S7_6,
827 Hexagon::S9_8, Hexagon::S11_10, Hexagon::S13_12, Hexagon::S15_14,
828 Hexagon::S17_16, Hexagon::S19_18, Hexagon::S21_20, Hexagon::S23_22,
829 Hexagon::S25_24, Hexagon::S27_26, Hexagon::S29_28, Hexagon::S31_30,
830 Hexagon::S33_32, Hexagon::S35_34, Hexagon::S37_36, Hexagon::S39_38,
831 Hexagon::S41_40, Hexagon::S43_42, Hexagon::S45_44, Hexagon::S47_46,
832 Hexagon::S49_48, Hexagon::S51_50, Hexagon::S53_52, Hexagon::S55_54,
833 Hexagon::S57_56, Hexagon::S59_58, Hexagon::S61_60, Hexagon::S63_62,
834 Hexagon::S65_64, Hexagon::S67_66, Hexagon::S69_68, Hexagon::S71_70,
835 Hexagon::S73_72, Hexagon::S75_74, Hexagon::S77_76, Hexagon::S79_78,
856 using namespace Hexagon;
858 static const MCPhysReg GuestRegDecoderTable[] = {
863 GPMUCNT4, GPMUCNT5, GPMUCNT6, GPMUCNT7,
865 GPCYCLELO, GPCYCLEHI, GPMUCNT0, GPMUCNT1,
866 GPMUCNT2, GPMUCNT3, G30, G31
869 if (RegNo >= std::size(GuestRegDecoderTable))
871 if (GuestRegDecoderTable[RegNo] == Hexagon::NoRegister)
874 unsigned Register = GuestRegDecoderTable[RegNo];
883 using namespace Hexagon;
885 static const MCPhysReg GuestReg64DecoderTable[] = {
889 G13_12, 0, G15_14, 0,
890 G17_16, 0, G19_18, 0,
891 G21_20, 0, G23_22, 0,
892 G25_24, 0, G27_26, 0,
896 if (RegNo >= std::size(GuestReg64DecoderTable))
898 if (GuestReg64DecoderTable[RegNo] == Hexagon::NoRegister)
901 unsigned Register = GuestReg64DecoderTable[RegNo];
#define LLVM_ATTRIBUTE_UNUSED
#define LLVM_EXTERNAL_VISIBILITY
static DecodeStatus DecodeIntRegsLow8RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeGuestRegsRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeCtrRegsRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus brtargetDecoder(MCInst &MI, unsigned tmp, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodePredRegsRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus s32_0ImmDecoder(MCInst &MI, unsigned tmp, uint64_t, const MCDisassembler *Decoder)
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeHexagonDisassembler()
static DecodeStatus DecodeHvxVQRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus unsignedImmDecoder(MCInst &MI, unsigned tmp, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeHvxVRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static MCDisassembler * createHexagonDisassembler(const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
static DecodeStatus DecodeSysRegs64RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeModRegsRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static const uint16_t SysReg64DecoderTable[]
static void adjustDuplex(MCInst &MI, MCContext &Context)
static DecodeStatus DecodeRegisterClass(MCInst &Inst, unsigned RegNo, ArrayRef< MCPhysReg > Table)
static DecodeStatus DecodeSysRegsRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeDoubleRegsRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static const uint16_t SysRegDecoderTable[]
static DecodeStatus DecodeGeneralSubRegsRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeHvxWRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeIntRegsRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeHvxQRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeCtrRegs64RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeGeneralDoubleLow8RegsRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeGuestRegs64RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
#define HEXAGON_MAX_PACKET_SIZE
#define HEXAGON_INSTR_SIZE
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static const unsigned IntRegDecoderTable[]
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
ArrayRef< T > slice(size_t N, size_t M) const
slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.
Check for a valid bundle.
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Context object for machine code objects.
Superclass for all disassemblers.
DecodeStatus
Ternary decode status.
virtual DecodeStatus getInstruction(MCInst &Instr, uint64_t &Size, ArrayRef< uint8_t > Bytes, uint64_t Address, raw_ostream &CStream) const =0
Returns the disassembly of a single instruction.
Instances of this class represent a single low-level machine instruction.
void addOperand(const MCOperand Op)
Interface to description of machine instruction set.
Instances of this class represent operands of the MCInst class.
static MCOperand createExpr(const MCExpr *Val)
static MCOperand createReg(MCRegister Reg)
static MCOperand createImm(int64_t Val)
void setReg(MCRegister Reg)
Set the register number.
MCRegister getReg() const
Returns the register number.
static MCOperand createInst(const MCInst *Val)
Wrapper class representing physical registers. Should be passed by value.
Generic base class for all target subtargets.
Wrapper class representing virtual and physical registers.
Target - Wrapper for Target specific information.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
void setOuterLoop(MCInst &MCI)
void addConstant(MCInst &MI, uint64_t Value, MCContext &Context)
bool IsReverseVecRegPair(MCRegister VecReg)
size_t bundleSize(MCInst const &MCI)
bool isDuplex(MCInstrInfo const &MCII, MCInst const &MCI)
unsigned getExtentBits(MCInstrInfo const &MCII, MCInst const &MCI)
bool isNewValue(MCInstrInfo const &MCII, MCInst const &MCI)
Return whether the insn expects newly produced value.
void setInnerLoop(MCInst &MCI)
unsigned short getNewValueOp(MCInstrInfo const &MCII, MCInst const &MCI)
unsigned short getExtendableOp(MCInstrInfo const &MCII, MCInst const &MCI)
bool IsVecRegPair(MCRegister VecReg)
iterator_range< Hexagon::PacketIterator > bundleInstructions(MCInstrInfo const &MCII, MCInst const &MCI)
bool isExtendable(MCInstrInfo const &MCII, MCInst const &MCI)
MCInst const * extenderForIndex(MCInst const &MCB, size_t Index)
bool isImmext(MCInst const &MCI)
MCOperand const & getNewValueOperand(MCInstrInfo const &MCII, MCInst const &MCI)
bool hasNewValue2(MCInstrInfo const &MCII, MCInst const &MCI)
Return whether the insn produces a second value.
unsigned getExtentAlignment(MCInstrInfo const &MCII, MCInst const &MCI)
bool isVector(MCInstrInfo const &MCII, MCInst const &MCI)
MCOperand const & getNewValueOperand2(MCInstrInfo const &MCII, MCInst const &MCI)
bool isExtended(MCInstrInfo const &MCII, MCInst const &MCI)
bool hasNewValue(MCInstrInfo const &MCII, MCInst const &MCI)
Return whether the insn produces a value.
MCSubtargetInfo const * getArchSubtarget(MCSubtargetInfo const *STI)
uint32_t read32le(const void *P)
This is an optimization pass for GlobalISel generic memory operations.
Target & getTheHexagonTarget()
unsigned M1(unsigned Val)
unsigned M0(unsigned Val)
constexpr int64_t SignExtend64(uint64_t x)
Sign-extend the number in the bottom B bits of X to a 64-bit integer.
static void RegisterMCDisassembler(Target &T, Target::MCDisassemblerCtorTy Fn)
RegisterMCDisassembler - Register a MCDisassembler implementation for the given target.