22 #define DEBUG_TYPE "ppc-disassembler" 45 return new PPCDisassembler(STI, Ctx,
false);
51 return new PPCDisassembler(STI, Ctx,
true);
66 const void *Decoder) {
67 int32_t
Offset = SignExtend32<24>(Imm);
75 template <std::
size_t N>
78 assert(RegNo < N &&
"Invalid register number");
85 const void *Decoder) {
91 const void *Decoder) {
97 const void *Decoder) {
103 const void *Decoder) {
109 const void *Decoder) {
115 const void *Decoder) {
121 const void *Decoder) {
127 const void *Decoder) {
133 const void *Decoder) {
139 const void *Decoder) {
145 const void *Decoder) {
151 const void *Decoder) {
157 const void *Decoder) {
163 const void *Decoder) {
167 #define DecodePointerLikeRegClass0 DecodeGPRCRegisterClass 168 #define DecodePointerLikeRegClass1 DecodeGPRC_NOR0RegisterClass 172 const void *Decoder) {
178 const void *Decoder) {
184 const void *Decoder) {
188 #define DecodeQSRCRegisterClass DecodeQFRCRegisterClass 189 #define DecodeQBRCRegisterClass DecodeQFRCRegisterClass 193 int64_t
Address,
const void *Decoder) {
194 assert(isUInt<N>(Imm) &&
"Invalid immediate");
201 int64_t
Address,
const void *Decoder) {
202 assert(isUInt<N>(Imm) &&
"Invalid immediate");
208 int64_t
Address,
const void *Decoder) {
212 uint64_t
Base = Imm >> 16;
213 uint64_t Disp = Imm & 0xFFFF;
215 assert(Base < 32 &&
"Invalid base register");
243 int64_t
Address,
const void *Decoder) {
247 uint64_t
Base = Imm >> 14;
248 uint64_t Disp = Imm & 0x3FFF;
250 assert(Base < 32 &&
"Invalid base register");
264 int64_t
Address,
const void *Decoder) {
268 uint64_t
Base = Imm >> 12;
269 uint64_t Disp = Imm & 0xFFF;
271 assert(Base < 32 &&
"Invalid base register");
279 int64_t
Address,
const void *Decoder) {
283 uint64_t
Base = Imm >> 5;
284 uint64_t Disp = Imm & 0x1F;
286 assert(Base < 32 &&
"Invalid base register");
294 int64_t
Address,
const void *Decoder) {
298 uint64_t
Base = Imm >> 5;
299 uint64_t Disp = Imm & 0x1F;
301 assert(Base < 32 &&
"Invalid base register");
309 int64_t
Address,
const void *Decoder) {
313 uint64_t
Base = Imm >> 5;
314 uint64_t Disp = Imm & 0x1F;
316 assert(Base < 32 &&
"Invalid base register");
324 int64_t
Address,
const void *Decoder) {
328 assert(Zeros < 8 &&
"Invalid CR bit value");
334 #include "PPCGenDisassemblerTables.inc" 342 if (Bytes.
size() < 4) {
351 if (STI.getFeatureBits()[PPC::FeatureQPX]) {
356 }
else if (STI.getFeatureBits()[PPC::FeatureSPE]) {
static DecodeStatus DecodeVSFRCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeCRRC0RegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus decodeSPE8Operands(MCInst &Inst, uint64_t Imm, int64_t Address, const void *Decoder)
This class represents lattice values for constants.
static DecodeStatus DecodeCRBITRCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
DecodeStatus
Ternary decode status.
Superclass for all disassemblers.
Target & getThePPC32Target()
static DecodeStatus decodeCRBitMOperand(MCInst &Inst, uint64_t Imm, int64_t Address, const void *Decoder)
static DecodeStatus DecodeVRRCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeG8RCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static void RegisterMCDisassembler(Target &T, Target::MCDisassemblerCtorTy Fn)
RegisterMCDisassembler - Register a MCDisassembler implementation for the given target.
static DecodeStatus decodeSImmOperand(MCInst &Inst, uint64_t Imm, int64_t Address, const void *Decoder)
static DecodeStatus DecodeVSSRCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static MCDisassembler * createPPCDisassembler(const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
static MCOperand createReg(unsigned Reg)
uint32_t read32be(const void *P)
static DecodeStatus DecodeVSRCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static MCDisassembler * createPPCLEDisassembler(const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
static DecodeStatus DecodePCRel24BranchTarget(MCInst &Inst, unsigned Imm, uint64_t Addr, const void *Decoder)
static DecodeStatus DecodeSPERCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
Context object for machine code objects.
int decodeInstruction(InternalInstruction *insn, byteReader_t reader, const void *readerArg, dlog_t logger, void *loggerArg, const void *miiArg, uint64_t startLoc, DisassemblerMode mode)
Decode one instruction and store the decoding results in a buffer provided by the consumer...
Target & getThePPC64Target()
static DecodeStatus decodeMemRIXOperands(MCInst &Inst, uint64_t Imm, int64_t Address, const void *Decoder)
static DecodeStatus DecodeVFRCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
iterator insert(iterator I, const MCOperand &Op)
Instances of this class represent a single low-level machine instruction.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
MCDisassembler::DecodeStatus DecodeStatus
static DecodeStatus DecodeF4RCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus decodeMemRIOperands(MCInst &Inst, uint64_t Imm, int64_t Address, const void *Decoder)
std::size_t countTrailingZeros(T Val, ZeroBehavior ZB=ZB_Width)
Count number of 0's from the least significant bit to the most stopping at the first 1...
static DecodeStatus DecodeCRRCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
size_t size() const
size - Get the array size.
static DecodeStatus DecodeF8RCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeQFRCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeGPRCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus decodeRegisterClass(MCInst &Inst, uint64_t RegNo, const MCPhysReg(&Regs)[N])
static DecodeStatus decodeSPE4Operands(MCInst &Inst, uint64_t Imm, int64_t Address, const void *Decoder)
static DecodeStatus decodeSPE2Operands(MCInst &Inst, uint64_t Imm, int64_t Address, const void *Decoder)
Target - Wrapper for Target specific information.
Target & getThePPC64LETarget()
void LLVMInitializePowerPCDisassembler()
static DecodeStatus DecodeSPE4RCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
uint32_t read32le(const void *P)
Generic base class for all target subtargets.
static DecodeStatus decodeMemRIX16Operands(MCInst &Inst, uint64_t Imm, int64_t Address, const void *Decoder)
static DecodeStatus decodeUImmOperand(MCInst &Inst, uint64_t Imm, int64_t Address, const void *Decoder)
static DecodeStatus DecodeGPRC_NOR0RegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class implements an extremely fast bulk output stream that can only output to a stream...
static DecodeStatus DecodeG8RC_NOX0RegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
void addOperand(const MCOperand &Op)
unsigned getOpcode() const
static MCOperand createImm(int64_t Val)