LLVM API Documentation
This file is part of the XCore Disassembler. More...
#include "XCore.h"
#include "XCoreRegisterInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDisassembler.h"
#include "llvm/MC/MCFixedLenDisassembler.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/Support/MemoryObject.h"
#include "llvm/Support/TargetRegistry.h"
#include "XCoreGenDisassemblerTables.inc"
Go to the source code of this file.
Namespaces | |
namespace | llvm |
List of target independent CodeGen pass IDs. | |
Defines | |
#define | DEBUG_TYPE "xcore-disassembler" |
Typedefs | |
typedef MCDisassembler::DecodeStatus | DecodeStatus |
Functions | |
static bool | readInstruction16 (const MemoryObject ®ion, uint64_t address, uint64_t &size, uint16_t &insn) |
static bool | readInstruction32 (const MemoryObject ®ion, uint64_t address, uint64_t &size, uint32_t &insn) |
static unsigned | getReg (const void *D, unsigned RC, unsigned RegNo) |
static DecodeStatus | DecodeGRRegsRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeRRegsRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeBitpOperand (MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeNegImmOperand (MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder) |
static DecodeStatus | Decode2RInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | Decode2RImmInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeR2RInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | Decode2RSrcDstInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeRUSInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeRUSBitpInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeRUSSrcDstBitpInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeL2RInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeLR2RInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | Decode3RInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | Decode3RImmInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | Decode2RUSInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | Decode2RUSBitpInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeL3RInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeL3RSrcDstInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeL2RUSInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeL2RUSBitpInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeL6RInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeL5RInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeL4RSrcDstInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeL4RSrcDstSrcDstInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | Decode2OpInstruction (unsigned Insn, unsigned &Op1, unsigned &Op2) |
static DecodeStatus | Decode3OpInstruction (unsigned Insn, unsigned &Op1, unsigned &Op2, unsigned &Op3) |
static DecodeStatus | Decode2OpInstructionFail (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeL2OpInstructionFail (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static DecodeStatus | DecodeL5RInstructionFail (MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder) |
static MCDisassembler * | createXCoreDisassembler (const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx) |
void | LLVMInitializeXCoreDisassembler () |
Variables | |
Target | llvm::TheXCoreTarget |
This file is part of the XCore Disassembler.
Definition in file XCoreDisassembler.cpp.
#define DEBUG_TYPE "xcore-disassembler" |
Definition at line 27 of file XCoreDisassembler.cpp.
Definition at line 29 of file XCoreDisassembler.cpp.
static MCDisassembler* createXCoreDisassembler | ( | const Target & | T, |
const MCSubtargetInfo & | STI, | ||
MCContext & | Ctx | ||
) | [static] |
Definition at line 789 of file XCoreDisassembler.cpp.
Referenced by LLVMInitializeXCoreDisassembler().
static DecodeStatus Decode2OpInstruction | ( | unsigned | Insn, |
unsigned & | Op1, | ||
unsigned & | Op2 | ||
) | [static] |
Definition at line 251 of file XCoreDisassembler.cpp.
References llvm::MCDisassembler::Fail, and llvm::MCDisassembler::Success.
Referenced by Decode2RImmInstruction(), Decode2RInstruction(), Decode2RSrcDstInstruction(), DecodeL2RInstruction(), DecodeL5RInstruction(), DecodeLR2RInstruction(), DecodeR2RInstruction(), DecodeRUSBitpInstruction(), DecodeRUSInstruction(), and DecodeRUSSrcDstBitpInstruction().
static DecodeStatus Decode2OpInstructionFail | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 285 of file XCoreDisassembler.cpp.
References Decode2RUSBitpInstruction(), Decode2RUSInstruction(), Decode3RImmInstruction(), Decode3RInstruction(), llvm::MCDisassembler::Fail, and llvm::MCInst::setOpcode().
Referenced by Decode2RImmInstruction(), Decode2RInstruction(), Decode2RSrcDstInstruction(), DecodeR2RInstruction(), DecodeRUSBitpInstruction(), DecodeRUSInstruction(), and DecodeRUSSrcDstBitpInstruction().
static DecodeStatus Decode2RImmInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 368 of file XCoreDisassembler.cpp.
References llvm::MCInst::addOperand(), llvm::MCOperand::CreateImm(), Decode2OpInstruction(), Decode2OpInstructionFail(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
static DecodeStatus Decode2RInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 355 of file XCoreDisassembler.cpp.
References Decode2OpInstruction(), Decode2OpInstructionFail(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
static DecodeStatus Decode2RSrcDstInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 394 of file XCoreDisassembler.cpp.
References Decode2OpInstruction(), Decode2OpInstructionFail(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
static DecodeStatus Decode2RUSBitpInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 586 of file XCoreDisassembler.cpp.
References Decode3OpInstruction(), DecodeBitpOperand(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
Referenced by Decode2OpInstructionFail().
static DecodeStatus Decode2RUSInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 573 of file XCoreDisassembler.cpp.
References llvm::MCInst::addOperand(), llvm::MCOperand::CreateImm(), Decode3OpInstruction(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
Referenced by Decode2OpInstructionFail().
static DecodeStatus Decode3OpInstruction | ( | unsigned | Insn, |
unsigned & | Op1, | ||
unsigned & | Op2, | ||
unsigned & | Op3 | ||
) | [static] |
Definition at line 269 of file XCoreDisassembler.cpp.
References llvm::MCDisassembler::Fail, and llvm::MCDisassembler::Success.
Referenced by Decode2RUSBitpInstruction(), Decode2RUSInstruction(), Decode3RImmInstruction(), Decode3RInstruction(), DecodeL2RUSBitpInstruction(), DecodeL2RUSInstruction(), DecodeL3RInstruction(), DecodeL3RSrcDstInstruction(), DecodeL4RSrcDstInstruction(), DecodeL4RSrcDstSrcDstInstruction(), DecodeL5RInstruction(), and DecodeL6RInstruction().
static DecodeStatus Decode3RImmInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 560 of file XCoreDisassembler.cpp.
References llvm::MCInst::addOperand(), llvm::MCOperand::CreateImm(), Decode3OpInstruction(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
Referenced by Decode2OpInstructionFail().
static DecodeStatus Decode3RInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 547 of file XCoreDisassembler.cpp.
References Decode3OpInstruction(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
Referenced by Decode2OpInstructionFail().
static DecodeStatus DecodeBitpOperand | ( | MCInst & | Inst, |
unsigned | Val, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 233 of file XCoreDisassembler.cpp.
References llvm::MCInst::addOperand(), llvm::MCOperand::CreateImm(), llvm::MCDisassembler::Fail, and llvm::MCDisassembler::Success.
Referenced by Decode2RUSBitpInstruction(), DecodeL2RUSBitpInstruction(), DecodeRUSBitpInstruction(), and DecodeRUSSrcDstBitpInstruction().
static DecodeStatus DecodeGRRegsRegisterClass | ( | MCInst & | Inst, |
unsigned | RegNo, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 209 of file XCoreDisassembler.cpp.
References llvm::MCInst::addOperand(), llvm::MCOperand::CreateReg(), llvm::MCDisassembler::Fail, getReg(), and llvm::MCDisassembler::Success.
Referenced by Decode2RImmInstruction(), Decode2RInstruction(), Decode2RSrcDstInstruction(), Decode2RUSBitpInstruction(), Decode2RUSInstruction(), Decode3RImmInstruction(), Decode3RInstruction(), DecodeL2RInstruction(), DecodeL2RUSBitpInstruction(), DecodeL2RUSInstruction(), DecodeL3RInstruction(), DecodeL3RSrcDstInstruction(), DecodeL4RSrcDstInstruction(), DecodeL4RSrcDstSrcDstInstruction(), DecodeL5RInstruction(), DecodeL6RInstruction(), DecodeLR2RInstruction(), DecodeR2RInstruction(), DecodeRUSBitpInstruction(), DecodeRUSInstruction(), and DecodeRUSSrcDstBitpInstruction().
static DecodeStatus DecodeL2OpInstructionFail | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 448 of file XCoreDisassembler.cpp.
References DecodeL2RUSBitpInstruction(), DecodeL2RUSInstruction(), DecodeL3RInstruction(), DecodeL3RSrcDstInstruction(), llvm::MCDisassembler::Fail, and llvm::MCInst::setOpcode().
Referenced by DecodeL2RInstruction(), and DecodeLR2RInstruction().
static DecodeStatus DecodeL2RInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 519 of file XCoreDisassembler.cpp.
References Decode2OpInstruction(), DecodeGRRegsRegisterClass(), DecodeL2OpInstructionFail(), and llvm::MCDisassembler::Success.
static DecodeStatus DecodeL2RUSBitpInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 642 of file XCoreDisassembler.cpp.
References Decode3OpInstruction(), DecodeBitpOperand(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
Referenced by DecodeL2OpInstructionFail().
static DecodeStatus DecodeL2RUSInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 628 of file XCoreDisassembler.cpp.
References llvm::MCInst::addOperand(), llvm::MCOperand::CreateImm(), Decode3OpInstruction(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
Referenced by DecodeL2OpInstructionFail().
static DecodeStatus DecodeL3RInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 599 of file XCoreDisassembler.cpp.
References Decode3OpInstruction(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
Referenced by DecodeL2OpInstructionFail().
static DecodeStatus DecodeL3RSrcDstInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 613 of file XCoreDisassembler.cpp.
References Decode3OpInstruction(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
Referenced by DecodeL2OpInstructionFail().
static DecodeStatus DecodeL4RSrcDstInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 710 of file XCoreDisassembler.cpp.
References Decode3OpInstruction(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
static DecodeStatus DecodeL4RSrcDstSrcDstInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 729 of file XCoreDisassembler.cpp.
References Decode3OpInstruction(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
static DecodeStatus DecodeL5RInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 690 of file XCoreDisassembler.cpp.
References Decode2OpInstruction(), Decode3OpInstruction(), DecodeGRRegsRegisterClass(), DecodeL5RInstructionFail(), and llvm::MCDisassembler::Success.
static DecodeStatus DecodeL5RInstructionFail | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 676 of file XCoreDisassembler.cpp.
References llvm::MCInst::clear(), DecodeL6RInstruction(), llvm::MCDisassembler::Fail, and llvm::MCInst::setOpcode().
Referenced by DecodeL5RInstruction().
static DecodeStatus DecodeL6RInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 656 of file XCoreDisassembler.cpp.
References Decode3OpInstruction(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
Referenced by DecodeL5RInstructionFail().
static DecodeStatus DecodeLR2RInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 533 of file XCoreDisassembler.cpp.
References Decode2OpInstruction(), DecodeGRRegsRegisterClass(), DecodeL2OpInstructionFail(), and llvm::MCDisassembler::Success.
static DecodeStatus DecodeNegImmOperand | ( | MCInst & | Inst, |
unsigned | Val, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 244 of file XCoreDisassembler.cpp.
References llvm::MCInst::addOperand(), llvm::MCOperand::CreateImm(), and llvm::MCDisassembler::Success.
static DecodeStatus DecodeR2RInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 381 of file XCoreDisassembler.cpp.
References Decode2OpInstruction(), Decode2OpInstructionFail(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
static DecodeStatus DecodeRRegsRegisterClass | ( | MCInst & | Inst, |
unsigned | RegNo, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 221 of file XCoreDisassembler.cpp.
References llvm::MCInst::addOperand(), llvm::MCOperand::CreateReg(), llvm::MCDisassembler::Fail, getReg(), and llvm::MCDisassembler::Success.
static DecodeStatus DecodeRUSBitpInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 421 of file XCoreDisassembler.cpp.
References Decode2OpInstruction(), Decode2OpInstructionFail(), DecodeBitpOperand(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
static DecodeStatus DecodeRUSInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 408 of file XCoreDisassembler.cpp.
References llvm::MCInst::addOperand(), llvm::MCOperand::CreateImm(), Decode2OpInstruction(), Decode2OpInstructionFail(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
static DecodeStatus DecodeRUSSrcDstBitpInstruction | ( | MCInst & | Inst, |
unsigned | Insn, | ||
uint64_t | Address, | ||
const void * | Decoder | ||
) | [static] |
Definition at line 434 of file XCoreDisassembler.cpp.
References Decode2OpInstruction(), Decode2OpInstructionFail(), DecodeBitpOperand(), DecodeGRRegsRegisterClass(), and llvm::MCDisassembler::Success.
Definition at line 80 of file XCoreDisassembler.cpp.
References llvm::MCRegisterClass::begin(), and llvm::MCRegisterInfo::getRegClass().
Referenced by DecodeGRRegsRegisterClass(), and DecodeRRegsRegisterClass().
void LLVMInitializeXCoreDisassembler | ( | ) |
Definition at line 795 of file XCoreDisassembler.cpp.
References createXCoreDisassembler(), llvm::TargetRegistry::RegisterMCDisassembler(), and llvm::TheXCoreTarget.
static bool readInstruction16 | ( | const MemoryObject & | region, |
uint64_t | address, | ||
uint64_t & | size, | ||
uint16_t & | insn | ||
) | [static] |
Definition at line 47 of file XCoreDisassembler.cpp.
References llvm::MemoryObject::readBytes().
static bool readInstruction32 | ( | const MemoryObject & | region, |
uint64_t | address, | ||
uint64_t & | size, | ||
uint32_t & | insn | ||
) | [static] |
Definition at line 63 of file XCoreDisassembler.cpp.
References llvm::MemoryObject::readBytes().