22 #define DEBUG_TYPE "ppc-disassembler" 44 return new PPCDisassembler(STI, Ctx,
false);
50 return new PPCDisassembler(STI, Ctx,
true);
65 const void *Decoder) {
66 int32_t
Offset = SignExtend32<24>(Imm);
74 template <std::
size_t N>
77 assert(RegNo < N &&
"Invalid register number");
84 const void *Decoder) {
90 const void *Decoder) {
96 const void *Decoder) {
102 const void *Decoder) {
108 const void *Decoder) {
114 const void *Decoder) {
120 const void *Decoder) {
126 const void *Decoder) {
132 const void *Decoder) {
138 const void *Decoder) {
144 const void *Decoder) {
150 const void *Decoder) {
156 const void *Decoder) {
160 #define DecodePointerLikeRegClass0 DecodeGPRCRegisterClass 161 #define DecodePointerLikeRegClass1 DecodeGPRC_NOR0RegisterClass 165 const void *Decoder) {
171 const void *Decoder) {
175 #define DecodeQSRCRegisterClass DecodeQFRCRegisterClass 176 #define DecodeQBRCRegisterClass DecodeQFRCRegisterClass 180 int64_t
Address,
const void *Decoder) {
181 assert(isUInt<N>(Imm) &&
"Invalid immediate");
188 int64_t
Address,
const void *Decoder) {
189 assert(isUInt<N>(Imm) &&
"Invalid immediate");
195 int64_t
Address,
const void *Decoder) {
199 uint64_t
Base = Imm >> 16;
200 uint64_t Disp = Imm & 0xFFFF;
202 assert(Base < 32 &&
"Invalid base register");
230 int64_t
Address,
const void *Decoder) {
234 uint64_t
Base = Imm >> 14;
235 uint64_t Disp = Imm & 0x3FFF;
237 assert(Base < 32 &&
"Invalid base register");
251 int64_t
Address,
const void *Decoder) {
255 uint64_t
Base = Imm >> 12;
256 uint64_t Disp = Imm & 0xFFF;
258 assert(Base < 32 &&
"Invalid base register");
266 int64_t
Address,
const void *Decoder) {
270 uint64_t
Base = Imm >> 5;
271 uint64_t Disp = Imm & 0x1F;
273 assert(Base < 32 &&
"Invalid base register");
281 int64_t
Address,
const void *Decoder) {
285 uint64_t
Base = Imm >> 5;
286 uint64_t Disp = Imm & 0x1F;
288 assert(Base < 32 &&
"Invalid base register");
296 int64_t
Address,
const void *Decoder) {
300 uint64_t
Base = Imm >> 5;
301 uint64_t Disp = Imm & 0x1F;
303 assert(Base < 32 &&
"Invalid base register");
311 int64_t
Address,
const void *Decoder) {
315 assert(Zeros < 8 &&
"Invalid CR bit value");
321 #include "PPCGenDisassemblerTables.inc" 329 if (Bytes.
size() < 4) {
338 if (STI.getFeatureBits()[PPC::FeatureQPX]) {
340 decodeInstruction(DecoderTableQPX32, MI, Inst, Address,
this, STI);
343 }
else if (STI.getFeatureBits()[PPC::FeatureSPE]) {
345 decodeInstruction(DecoderTableSPE32, MI, Inst, Address,
this, STI);
350 return decodeInstruction(DecoderTable32, MI, Inst, Address,
this, STI);
static DecodeStatus DecodeVSFRCRegisterClass(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)
unsigned 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 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.
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)
static DecodeStatus DecodeCRRCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
size_t size() const
size - Get the array size.
LLVM_EXTERNAL_VISIBILITY void LLVMInitializePowerPCDisassembler()
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)
#define LLVM_EXTERNAL_VISIBILITY
static DecodeStatus decodeSPE2Operands(MCInst &Inst, uint64_t Imm, int64_t Address, const void *Decoder)
Target - Wrapper for Target specific information.
Target & getThePPC64LETarget()
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)