#include "MCTargetDesc/VEMCTargetDesc.h"
#include "TargetInfo/VETargetInfo.h"
#include "VE.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDecoderOps.h"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/TargetRegistry.h"
usingnamespacellvm;
#define DEBUG_TYPE …
DecodeStatus;
namespace {
class VEDisassembler : public MCDisassembler { … };
}
static MCDisassembler *createVEDisassembler(const Target &T,
const MCSubtargetInfo &STI,
MCContext &Ctx) { … }
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeVEDisassembler() { … }
static const unsigned I32RegDecoderTable[] = …;
static const unsigned I64RegDecoderTable[] = …;
static const unsigned F32RegDecoderTable[] = …;
static const unsigned F128RegDecoderTable[] = …;
static const unsigned V64RegDecoderTable[] = …;
static const unsigned VMRegDecoderTable[] = …;
static const unsigned VM512RegDecoderTable[] = …;
static const unsigned MiscRegDecoderTable[] = …;
static DecodeStatus DecodeI32RegisterClass(MCInst &Inst, unsigned RegNo,
uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeI64RegisterClass(MCInst &Inst, unsigned RegNo,
uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeF32RegisterClass(MCInst &Inst, unsigned RegNo,
uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeF128RegisterClass(MCInst &Inst, unsigned RegNo,
uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeV64RegisterClass(MCInst &Inst, unsigned RegNo,
uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeVMRegisterClass(MCInst &Inst, unsigned RegNo,
uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeVM512RegisterClass(MCInst &Inst, unsigned RegNo,
uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeMISCRegisterClass(MCInst &Inst, unsigned RegNo,
uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeASX(MCInst &Inst, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeLoadI32(MCInst &Inst, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeStoreI32(MCInst &Inst, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeLoadI64(MCInst &Inst, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeStoreI64(MCInst &Inst, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeLoadF32(MCInst &Inst, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeStoreF32(MCInst &Inst, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeLoadASI64(MCInst &Inst, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeStoreASI64(MCInst &Inst, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeTS1AMI64(MCInst &Inst, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeTS1AMI32(MCInst &Inst, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeCASI64(MCInst &Inst, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeCASI32(MCInst &Inst, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeCall(MCInst &Inst, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeSIMM7(MCInst &Inst, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeSIMM32(MCInst &Inst, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeCCOperand(MCInst &Inst, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeRDOperand(MCInst &Inst, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeBranchCondition(MCInst &Inst, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeBranchConditionAlways(MCInst &Inst, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder);
#include "VEGenDisassemblerTables.inc"
static DecodeStatus readInstruction64(ArrayRef<uint8_t> Bytes, uint64_t Address,
uint64_t &Size, uint64_t &Insn,
bool IsLittleEndian) { … }
DecodeStatus VEDisassembler::getInstruction(MCInst &Instr, uint64_t &Size,
ArrayRef<uint8_t> Bytes,
uint64_t Address,
raw_ostream &CStream) const { … }
DecodeFunc;
static DecodeStatus DecodeASX(MCInst &MI, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeAS(MCInst &MI, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeMem(MCInst &MI, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder, bool isLoad,
DecodeFunc DecodeSX) { … }
static DecodeStatus DecodeMemAS(MCInst &MI, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder, bool isLoad,
DecodeFunc DecodeSX) { … }
static DecodeStatus DecodeLoadI32(MCInst &Inst, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeStoreI32(MCInst &Inst, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeLoadI64(MCInst &Inst, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeStoreI64(MCInst &Inst, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeLoadF32(MCInst &Inst, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeStoreF32(MCInst &Inst, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeLoadASI64(MCInst &Inst, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeStoreASI64(MCInst &Inst, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeCAS(MCInst &MI, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder, bool isImmOnly,
bool isUImm, DecodeFunc DecodeSX) { … }
static DecodeStatus DecodeTS1AMI64(MCInst &MI, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeTS1AMI32(MCInst &MI, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeCASI64(MCInst &MI, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeCASI32(MCInst &MI, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeCall(MCInst &Inst, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeSIMM7(MCInst &MI, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeSIMM32(MCInst &MI, uint64_t insn, uint64_t Address,
const MCDisassembler *Decoder) { … }
static bool isIntegerBCKind(MCInst &MI) { … }
static DecodeStatus DecodeCCOperand(MCInst &MI, uint64_t cf, uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeRDOperand(MCInst &MI, uint64_t cf, uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeBranchCondition(MCInst &MI, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder) { … }
static DecodeStatus DecodeBranchConditionAlways(MCInst &MI, uint64_t insn,
uint64_t Address,
const MCDisassembler *Decoder) { … }