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());
177 bool Complete =
false;
180 *CurrentBundle = &
MI;
181 MI.setOpcode(Hexagon::BUNDLE);
183 while (Result ==
Success && !Complete) {
186 MCInst *Inst = getContext().createMCInst();
187 Result = getSingleInstruction(*Inst,
MI, Bytes, Address, cs, Complete);
198 const auto STI_ = (ArchSTI !=
nullptr) ? *ArchSTI : STI;
200 *getContext().getRegisterInfo(),
false);
201 if (!Checker.check())
203 remapInstruction(
MI);
207void HexagonDisassembler::remapInstruction(
MCInst &Instr)
const {
209 auto &
MI =
const_cast<MCInst &
>(*
I.getInst());
210 switch (
MI.getOpcode()) {
211 case Hexagon::S2_allocframe:
212 if (
MI.getOperand(0).getReg() == Hexagon::R29) {
213 MI.setOpcode(Hexagon::S6_allocframe_to_raw);
214 MI.erase(
MI.begin () + 1);
215 MI.erase(
MI.begin ());
218 case Hexagon::L2_deallocframe:
219 if (
MI.getOperand(0).getReg() == Hexagon::D15 &&
220 MI.getOperand(1).getReg() == Hexagon::R30) {
221 MI.setOpcode(L6_deallocframe_map_to_raw);
222 MI.erase(
MI.begin () + 1);
223 MI.erase(
MI.begin ());
226 case Hexagon::L4_return:
227 if (
MI.getOperand(0).getReg() == Hexagon::D15 &&
228 MI.getOperand(1).getReg() == Hexagon::R30) {
229 MI.setOpcode(L6_return_map_to_raw);
230 MI.erase(
MI.begin () + 1);
231 MI.erase(
MI.begin ());
234 case Hexagon::L4_return_t:
235 if (
MI.getOperand(0).getReg() == Hexagon::D15 &&
236 MI.getOperand(2).getReg() == Hexagon::R30) {
237 MI.setOpcode(L4_return_map_to_raw_t);
238 MI.erase(
MI.begin () + 2);
239 MI.erase(
MI.begin ());
242 case Hexagon::L4_return_f:
243 if (
MI.getOperand(0).getReg() == Hexagon::D15 &&
244 MI.getOperand(2).getReg() == Hexagon::R30) {
245 MI.setOpcode(L4_return_map_to_raw_f);
246 MI.erase(
MI.begin () + 2);
247 MI.erase(
MI.begin ());
250 case Hexagon::L4_return_tnew_pt:
251 if (
MI.getOperand(0).getReg() == Hexagon::D15 &&
252 MI.getOperand(2).getReg() == Hexagon::R30) {
253 MI.setOpcode(L4_return_map_to_raw_tnew_pt);
254 MI.erase(
MI.begin () + 2);
255 MI.erase(
MI.begin ());
258 case Hexagon::L4_return_fnew_pt:
259 if (
MI.getOperand(0).getReg() == Hexagon::D15 &&
260 MI.getOperand(2).getReg() == Hexagon::R30) {
261 MI.setOpcode(L4_return_map_to_raw_fnew_pt);
262 MI.erase(
MI.begin () + 2);
263 MI.erase(
MI.begin ());
266 case Hexagon::L4_return_tnew_pnt:
267 if (
MI.getOperand(0).getReg() == Hexagon::D15 &&
268 MI.getOperand(2).getReg() == Hexagon::R30) {
269 MI.setOpcode(L4_return_map_to_raw_tnew_pnt);
270 MI.erase(
MI.begin () + 2);
271 MI.erase(
MI.begin ());
274 case Hexagon::L4_return_fnew_pnt:
275 if (
MI.getOperand(0).getReg() == Hexagon::D15 &&
276 MI.getOperand(2).getReg() == Hexagon::R30) {
277 MI.setOpcode(L4_return_map_to_raw_fnew_pnt);
278 MI.erase(
MI.begin () + 2);
279 MI.erase(
MI.begin ());
287 switch (
MI.getOpcode()) {
288 case Hexagon::SA1_setin1:
289 MI.insert(
MI.begin() + 1,
292 case Hexagon::SA1_dec:
293 MI.insert(
MI.begin() + 2,
305 bool &Complete)
const {
315 else if (BundleSize == 1)
318 return DecodeStatus::Fail;
327 unsigned duplexIClass;
328 uint8_t const *DecodeLow, *DecodeHigh;
330 switch (duplexIClass) {
334 DecodeLow = DecoderTableSUBINSN_L132;
335 DecodeHigh = DecoderTableSUBINSN_L132;
338 DecodeLow = DecoderTableSUBINSN_L232;
339 DecodeHigh = DecoderTableSUBINSN_L132;
342 DecodeLow = DecoderTableSUBINSN_L232;
343 DecodeHigh = DecoderTableSUBINSN_L232;
346 DecodeLow = DecoderTableSUBINSN_A32;
347 DecodeHigh = DecoderTableSUBINSN_A32;
350 DecodeLow = DecoderTableSUBINSN_L132;
351 DecodeHigh = DecoderTableSUBINSN_A32;
354 DecodeLow = DecoderTableSUBINSN_L232;
355 DecodeHigh = DecoderTableSUBINSN_A32;
358 DecodeLow = DecoderTableSUBINSN_S132;
359 DecodeHigh = DecoderTableSUBINSN_A32;
362 DecodeLow = DecoderTableSUBINSN_S232;
363 DecodeHigh = DecoderTableSUBINSN_A32;
366 DecodeLow = DecoderTableSUBINSN_S132;
367 DecodeHigh = DecoderTableSUBINSN_L132;
370 DecodeLow = DecoderTableSUBINSN_S132;
371 DecodeHigh = DecoderTableSUBINSN_L232;
374 DecodeLow = DecoderTableSUBINSN_S132;
375 DecodeHigh = DecoderTableSUBINSN_S132;
378 DecodeLow = DecoderTableSUBINSN_S232;
379 DecodeHigh = DecoderTableSUBINSN_S132;
382 DecodeLow = DecoderTableSUBINSN_S232;
383 DecodeHigh = DecoderTableSUBINSN_L132;
386 DecodeLow = DecoderTableSUBINSN_S232;
387 DecodeHigh = DecoderTableSUBINSN_L232;
390 DecodeLow = DecoderTableSUBINSN_S232;
391 DecodeHigh = DecoderTableSUBINSN_S232;
394 MI.setOpcode(Hexagon::DuplexIClass0 + duplexIClass);
395 MCInst *MILow = getContext().createMCInst();
396 MCInst *MIHigh = getContext().createMCInst();
397 auto TmpExtender = CurrentExtender;
402 CurrentExtender = TmpExtender;
403 if (Result != DecodeStatus::Success)
404 return DecodeStatus::Fail;
406 Result = decodeInstruction(
407 DecodeHigh, *MIHigh, (
Instruction >> 16) & 0x1fff, Address,
this, STI);
408 if (Result != DecodeStatus::Success)
409 return DecodeStatus::Fail;
413 MI.addOperand(OPLow);
414 MI.addOperand(OPHigh);
421 if (CurrentExtender !=
nullptr)
430 STI.hasFeature(Hexagon::ExtensionHVX))
436 switch (
MI.getOpcode()) {
437 case Hexagon::J4_cmpeqn1_f_jumpnv_nt:
438 case Hexagon::J4_cmpeqn1_f_jumpnv_t:
439 case Hexagon::J4_cmpeqn1_fp0_jump_nt:
440 case Hexagon::J4_cmpeqn1_fp0_jump_t:
441 case Hexagon::J4_cmpeqn1_fp1_jump_nt:
442 case Hexagon::J4_cmpeqn1_fp1_jump_t:
443 case Hexagon::J4_cmpeqn1_t_jumpnv_nt:
444 case Hexagon::J4_cmpeqn1_t_jumpnv_t:
445 case Hexagon::J4_cmpeqn1_tp0_jump_nt:
446 case Hexagon::J4_cmpeqn1_tp0_jump_t:
447 case Hexagon::J4_cmpeqn1_tp1_jump_nt:
448 case Hexagon::J4_cmpeqn1_tp1_jump_t:
449 case Hexagon::J4_cmpgtn1_f_jumpnv_nt:
450 case Hexagon::J4_cmpgtn1_f_jumpnv_t:
451 case Hexagon::J4_cmpgtn1_fp0_jump_nt:
452 case Hexagon::J4_cmpgtn1_fp0_jump_t:
453 case Hexagon::J4_cmpgtn1_fp1_jump_nt:
454 case Hexagon::J4_cmpgtn1_fp1_jump_t:
455 case Hexagon::J4_cmpgtn1_t_jumpnv_nt:
456 case Hexagon::J4_cmpgtn1_t_jumpnv_t:
457 case Hexagon::J4_cmpgtn1_tp0_jump_nt:
458 case Hexagon::J4_cmpgtn1_tp0_jump_t:
459 case Hexagon::J4_cmpgtn1_tp1_jump_nt:
460 case Hexagon::J4_cmpgtn1_tp1_jump_t:
461 MI.insert(
MI.begin() + 1,
471 assert(MCO.
isReg() &&
"New value consumers must be registers");
473 getContext().getRegisterInfo()->getEncodingValue(MCO.
getReg());
477 unsigned Lookback = (
Register & 0x6) >> 1;
480 bool PrevVector =
false;
488 if (
Vector && !CurrentVector)
493 PrevVector = CurrentVector;
497 auto const &Inst = *i->getInst();
498 bool SubregBit = (
Register & 0x1) != 0;
505 assert(Producer != Hexagon::NoRegister);
513 const unsigned ProdPairIndex =
516 SubregBit = !SubregBit;
517 Producer = (ProdPairIndex << 1) + SubregBit + Hexagon::V0;
518 }
else if (SubregBit)
522 assert(Producer != Hexagon::NoRegister);
528 if (CurrentExtender !=
nullptr) {
530 ? *
MI.getOperand(1).getInst()
541 if (RegNo < Table.
size()) {
559 Hexagon::R0, Hexagon::R1, Hexagon::R2, Hexagon::R3, Hexagon::R4,
560 Hexagon::R5, Hexagon::R6, Hexagon::R7, Hexagon::R8, Hexagon::R9,
561 Hexagon::R10, Hexagon::R11, Hexagon::R12, Hexagon::R13, Hexagon::R14,
562 Hexagon::R15, Hexagon::R16, Hexagon::R17, Hexagon::R18, Hexagon::R19,
563 Hexagon::R20, Hexagon::R21, Hexagon::R22, Hexagon::R23, Hexagon::R24,
564 Hexagon::R25, Hexagon::R26, Hexagon::R27, Hexagon::R28, Hexagon::R29,
565 Hexagon::R30, Hexagon::R31};
574 static const MCPhysReg GeneralSubRegDecoderTable[] = {
575 Hexagon::R0, Hexagon::R1, Hexagon::R2, Hexagon::R3,
576 Hexagon::R4, Hexagon::R5, Hexagon::R6, Hexagon::R7,
577 Hexagon::R16, Hexagon::R17, Hexagon::R18, Hexagon::R19,
578 Hexagon::R20, Hexagon::R21, Hexagon::R22, Hexagon::R23,
587 static const MCPhysReg HvxVRDecoderTable[] = {
588 Hexagon::V0, Hexagon::V1, Hexagon::V2, Hexagon::V3, Hexagon::V4,
589 Hexagon::V5, Hexagon::V6, Hexagon::V7, Hexagon::V8, Hexagon::V9,
590 Hexagon::V10, Hexagon::V11, Hexagon::V12, Hexagon::V13, Hexagon::V14,
591 Hexagon::V15, Hexagon::V16, Hexagon::V17, Hexagon::V18, Hexagon::V19,
592 Hexagon::V20, Hexagon::V21, Hexagon::V22, Hexagon::V23, Hexagon::V24,
593 Hexagon::V25, Hexagon::V26, Hexagon::V27, Hexagon::V28, Hexagon::V29,
594 Hexagon::V30, Hexagon::V31};
603 static const MCPhysReg DoubleRegDecoderTable[] = {
604 Hexagon::D0, Hexagon::D1, Hexagon::D2, Hexagon::D3,
605 Hexagon::D4, Hexagon::D5, Hexagon::D6, Hexagon::D7,
606 Hexagon::D8, Hexagon::D9, Hexagon::D10, Hexagon::D11,
607 Hexagon::D12, Hexagon::D13, Hexagon::D14, Hexagon::D15};
616 static const MCPhysReg GeneralDoubleLow8RegDecoderTable[] = {
617 Hexagon::D0, Hexagon::D1, Hexagon::D2, Hexagon::D3,
618 Hexagon::D8, Hexagon::D9, Hexagon::D10, Hexagon::D11};
626 static const MCPhysReg HvxWRDecoderTable[] = {
627 Hexagon::W0, Hexagon::WR0, Hexagon::W1, Hexagon::WR1, Hexagon::W2,
628 Hexagon::WR2, Hexagon::W3, Hexagon::WR3, Hexagon::W4, Hexagon::WR4,
629 Hexagon::W5, Hexagon::WR5, Hexagon::W6, Hexagon::WR6, Hexagon::W7,
630 Hexagon::WR7, Hexagon::W8, Hexagon::WR8, Hexagon::W9, Hexagon::WR9,
631 Hexagon::W10, Hexagon::WR10, Hexagon::W11, Hexagon::WR11, Hexagon::W12,
632 Hexagon::WR12, Hexagon::W13, Hexagon::WR13, Hexagon::W14, Hexagon::WR14,
633 Hexagon::W15, Hexagon::WR15,
644 static const MCPhysReg HvxVQRDecoderTable[] = {
645 Hexagon::VQ0, Hexagon::VQ1, Hexagon::VQ2, Hexagon::VQ3,
646 Hexagon::VQ4, Hexagon::VQ5, Hexagon::VQ6, Hexagon::VQ7};
654 static const MCPhysReg PredRegDecoderTable[] = {Hexagon::P0, Hexagon::P1,
655 Hexagon::P2, Hexagon::P3};
663 static const MCPhysReg HvxQRDecoderTable[] = {Hexagon::Q0, Hexagon::Q1,
664 Hexagon::Q2, Hexagon::Q3};
672 using namespace Hexagon;
674 static const MCPhysReg CtrlRegDecoderTable[] = {
678 CS0, CS1, UPCYCLELO, UPCYCLEHI,
679 FRAMELIMIT, FRAMEKEY, PKTCOUNTLO, PKTCOUNTHI,
682 0, 0, UTIMERLO, UTIMERHI
685 if (RegNo >= std::size(CtrlRegDecoderTable))
688 static_assert(NoRegister == 0,
"Expecting NoRegister to be 0");
689 if (CtrlRegDecoderTable[RegNo] == NoRegister)
692 unsigned Register = CtrlRegDecoderTable[RegNo];
700 using namespace Hexagon;
702 static const MCPhysReg CtrlReg64DecoderTable[] = {
707 C17_16, 0, PKTCOUNT, 0,
713 if (RegNo >= std::size(CtrlReg64DecoderTable))
716 static_assert(NoRegister == 0,
"Expecting NoRegister to be 0");
717 if (CtrlReg64DecoderTable[RegNo] == NoRegister)
720 unsigned Register = CtrlReg64DecoderTable[RegNo];
746 HexagonDisassembler
const &Disassembler = disassembler(Decoder);
747 int64_t FullValue = fullValue(Disassembler,
MI, tmp);
748 assert(FullValue >= 0 &&
"Negative in unsigned decoder");
756 HexagonDisassembler
const &Disassembler = disassembler(Decoder);
759 signedDecoder<32>(
MI, tmp, Decoder);
766 HexagonDisassembler
const &Disassembler = disassembler(Decoder);
773 if (!Disassembler.tryAddingSymbolicOperand(
MI, Extended,
Address,
true, 0, 0,
780 Hexagon::SGP0, Hexagon::SGP1, Hexagon::STID,
781 Hexagon::ELR, Hexagon::BADVA0, Hexagon::BADVA1,
782 Hexagon::SSR, Hexagon::CCR, Hexagon::HTID,
783 Hexagon::BADVA, Hexagon::IMASK, Hexagon::S11,
784 Hexagon::S12, Hexagon::S13, Hexagon::S14,
785 Hexagon::S15, Hexagon::EVB, Hexagon::MODECTL,
786 Hexagon::SYSCFG, Hexagon::S19, Hexagon::S20,
787 Hexagon::VID, Hexagon::S22, Hexagon::S23,
788 Hexagon::S24, Hexagon::S25, Hexagon::S26,
789 Hexagon::CFGBASE, Hexagon::DIAG, Hexagon::REV,
790 Hexagon::PCYCLELO, Hexagon::PCYCLEHI, Hexagon::ISDBST,
791 Hexagon::ISDBCFG0, Hexagon::ISDBCFG1, Hexagon::S35,
792 Hexagon::BRKPTPC0, Hexagon::BRKPTCFG0, Hexagon::BRKPTPC1,
793 Hexagon::BRKPTCFG1, Hexagon::ISDBMBXIN, Hexagon::ISDBMBXOUT,
794 Hexagon::ISDBEN, Hexagon::ISDBGPR, Hexagon::S44,
795 Hexagon::S45, Hexagon::S46, Hexagon::S47,
796 Hexagon::PMUCNT0, Hexagon::PMUCNT1, Hexagon::PMUCNT2,
797 Hexagon::PMUCNT3, Hexagon::PMUEVTCFG, Hexagon::PMUCFG,
798 Hexagon::S54, Hexagon::S55, Hexagon::S56,
799 Hexagon::S57, Hexagon::S58, Hexagon::S59,
800 Hexagon::S60, Hexagon::S61, Hexagon::S62,
801 Hexagon::S63, Hexagon::S64, Hexagon::S65,
802 Hexagon::S66, Hexagon::S67, Hexagon::S68,
803 Hexagon::S69, Hexagon::S70, Hexagon::S71,
804 Hexagon::S72, Hexagon::S73, Hexagon::S74,
805 Hexagon::S75, Hexagon::S76, Hexagon::S77,
806 Hexagon::S78, Hexagon::S79, Hexagon::S80,
824 Hexagon::SGP1_0, Hexagon::S3_2, Hexagon::S5_4, Hexagon::S7_6,
825 Hexagon::S9_8, Hexagon::S11_10, Hexagon::S13_12, Hexagon::S15_14,
826 Hexagon::S17_16, Hexagon::S19_18, Hexagon::S21_20, Hexagon::S23_22,
827 Hexagon::S25_24, Hexagon::S27_26, Hexagon::S29_28, Hexagon::S31_30,
828 Hexagon::S33_32, Hexagon::S35_34, Hexagon::S37_36, Hexagon::S39_38,
829 Hexagon::S41_40, Hexagon::S43_42, Hexagon::S45_44, Hexagon::S47_46,
830 Hexagon::S49_48, Hexagon::S51_50, Hexagon::S53_52, Hexagon::S55_54,
831 Hexagon::S57_56, Hexagon::S59_58, Hexagon::S61_60, Hexagon::S63_62,
832 Hexagon::S65_64, Hexagon::S67_66, Hexagon::S69_68, Hexagon::S71_70,
833 Hexagon::S73_72, Hexagon::S75_74, Hexagon::S77_76, Hexagon::S79_78,
854 using namespace Hexagon;
856 static const MCPhysReg GuestRegDecoderTable[] = {
861 GPMUCNT4, GPMUCNT5, GPMUCNT6, GPMUCNT7,
863 GPCYCLELO, GPCYCLEHI, GPMUCNT0, GPMUCNT1,
864 GPMUCNT2, GPMUCNT3, G30, G31
867 if (RegNo >= std::size(GuestRegDecoderTable))
869 if (GuestRegDecoderTable[RegNo] == Hexagon::NoRegister)
872 unsigned Register = GuestRegDecoderTable[RegNo];
881 using namespace Hexagon;
883 static const MCPhysReg GuestReg64DecoderTable[] = {
887 G13_12, 0, G15_14, 0,
888 G17_16, 0, G19_18, 0,
889 G21_20, 0, G23_22, 0,
890 G25_24, 0, G27_26, 0,
894 if (RegNo >= std::size(GuestReg64DecoderTable))
896 if (GuestReg64DecoderTable[RegNo] == Hexagon::NoRegister)
899 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.