@@ -728,40 +728,6 @@ static void tryAddingPcLoadReferenceComment(uint64_t Address, int Value,
728728 Decoder->tryAddingPcLoadReferenceComment (Value, Address);
729729}
730730
731- #include " ARMGenDisassemblerTables.inc"
732-
733- // Post-decoding checks
734- static DecodeStatus checkDecodedInstruction (MCInst &MI, uint64_t &Size,
735- uint64_t Address, raw_ostream &CS,
736- uint32_t Insn,
737- DecodeStatus Result) {
738- switch (MI.getOpcode ()) {
739- case ARM::HVC: {
740- // HVC is undefined if condition = 0xf otherwise upredictable
741- // if condition != 0xe
742- uint32_t Cond = (Insn >> 28 ) & 0xF ;
743- if (Cond == 0xF )
744- return MCDisassembler::Fail;
745- if (Cond != 0xE )
746- return MCDisassembler::SoftFail;
747- return Result;
748- }
749- case ARM::t2ADDri:
750- case ARM::t2ADDri12:
751- case ARM::t2ADDrr:
752- case ARM::t2ADDrs:
753- case ARM::t2SUBri:
754- case ARM::t2SUBri12:
755- case ARM::t2SUBrr:
756- case ARM::t2SUBrs:
757- if (MI.getOperand (0 ).getReg () == ARM::SP &&
758- MI.getOperand (1 ).getReg () != ARM::SP)
759- return MCDisassembler::SoftFail;
760- return Result;
761- default : return Result;
762- }
763- }
764-
765731static const uint16_t GPRDecoderTable[] = {
766732 ARM::R0, ARM::R1, ARM::R2, ARM::R3,
767733 ARM::R4, ARM::R5, ARM::R6, ARM::R7,
@@ -6560,6 +6526,40 @@ static DecodeStatus DecodeLazyLoadStoreMul(MCInst &Inst, unsigned Insn,
65606526 return S;
65616527}
65626528
6529+ #include " ARMGenDisassemblerTables.inc"
6530+
6531+ // Post-decoding checks
6532+ static DecodeStatus checkDecodedInstruction (MCInst &MI, uint64_t &Size,
6533+ uint64_t Address, raw_ostream &CS,
6534+ uint32_t Insn,
6535+ DecodeStatus Result) {
6536+ switch (MI.getOpcode ()) {
6537+ case ARM::HVC: {
6538+ // HVC is undefined if condition = 0xf otherwise upredictable
6539+ // if condition != 0xe
6540+ uint32_t Cond = (Insn >> 28 ) & 0xF ;
6541+ if (Cond == 0xF )
6542+ return MCDisassembler::Fail;
6543+ if (Cond != 0xE )
6544+ return MCDisassembler::SoftFail;
6545+ return Result;
6546+ }
6547+ case ARM::t2ADDri:
6548+ case ARM::t2ADDri12:
6549+ case ARM::t2ADDrr:
6550+ case ARM::t2ADDrs:
6551+ case ARM::t2SUBri:
6552+ case ARM::t2SUBri12:
6553+ case ARM::t2SUBrr:
6554+ case ARM::t2SUBrs:
6555+ if (MI.getOperand (0 ).getReg () == ARM::SP &&
6556+ MI.getOperand (1 ).getReg () != ARM::SP)
6557+ return MCDisassembler::SoftFail;
6558+ return Result;
6559+ default : return Result;
6560+ }
6561+ }
6562+
65636563uint64_t ARMDisassembler::suggestBytesToSkip (ArrayRef<uint8_t > Bytes,
65646564 uint64_t Address) const {
65656565 // In Arm state, instructions are always 4 bytes wide, so there's no
0 commit comments