LLVM 22.0.0git
MSP430Disassembler.cpp File Reference
#include "MCTargetDesc/MSP430MCTargetDesc.h"
#include "MSP430.h"
#include "TargetInfo/MSP430TargetInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDecoder.h"
#include "llvm/MC/MCDecoderOps.h"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Endian.h"
#include "MSP430GenDisassemblerTables.inc"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "msp430-disassembler"

Enumerations

enum  AddrMode {
  amInvalid = 0 , amRegister , amIndexed , amIndirect ,
  amIndirectPost , amSymbolic , amImmediate , amAbsolute ,
  amConstant
}

Functions

static MCDisassemblercreateMSP430Disassembler (const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeMSP430Disassembler ()
static DecodeStatus DecodeGR8RegisterClass (MCInst &MI, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeGR16RegisterClass (MCInst &MI, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeCGImm (MCInst &MI, uint64_t Bits, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMemOperand (MCInst &MI, uint64_t Bits, uint64_t Address, const MCDisassembler *Decoder)
static AddrMode DecodeSrcAddrMode (unsigned Rs, unsigned As)
static AddrMode DecodeSrcAddrModeI (unsigned Insn)
static AddrMode DecodeSrcAddrModeII (unsigned Insn)
static AddrMode DecodeDstAddrMode (unsigned Insn)
static const uint8_tgetDecoderTable (AddrMode SrcAM, unsigned Words)
static MSP430CC::CondCodes getCondCode (unsigned Cond)

Variables

static const unsigned GR8DecoderTable []
static const unsigned GR16DecoderTable []

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "msp430-disassembler"

Definition at line 29 of file MSP430Disassembler.cpp.

Enumeration Type Documentation

◆ AddrMode

enum AddrMode
Enumerator
amInvalid 
amRegister 
amIndexed 
amIndirect 
amIndirectPost 
amSymbolic 
amImmediate 
amAbsolute 
amConstant 

Definition at line 138 of file MSP430Disassembler.cpp.

Function Documentation

◆ createMSP430Disassembler()

MCDisassembler * createMSP430Disassembler ( const Target & T,
const MCSubtargetInfo & STI,
MCContext & Ctx )
static

Definition at line 57 of file MSP430Disassembler.cpp.

References T.

Referenced by LLVMInitializeMSP430Disassembler().

◆ DecodeCGImm()

DecodeStatus DecodeCGImm ( MCInst & MI,
uint64_t Bits,
uint64_t Address,
const MCDisassembler * Decoder )
static

◆ DecodeDstAddrMode()

AddrMode DecodeDstAddrMode ( unsigned Insn)
static

◆ DecodeGR16RegisterClass()

DecodeStatus DecodeGR16RegisterClass ( MCInst & MI,
uint64_t RegNo,
uint64_t Address,
const MCDisassembler * Decoder )
static

◆ DecodeGR8RegisterClass()

DecodeStatus DecodeGR8RegisterClass ( MCInst & MI,
uint64_t RegNo,
uint64_t Address,
const MCDisassembler * Decoder )
static

◆ DecodeMemOperand()

◆ DecodeSrcAddrMode()

◆ DecodeSrcAddrModeI()

AddrMode DecodeSrcAddrModeI ( unsigned Insn)
static

◆ DecodeSrcAddrModeII()

AddrMode DecodeSrcAddrModeII ( unsigned Insn)
static

◆ getCondCode()

◆ getDecoderTable()

const uint8_t * getDecoderTable ( AddrMode SrcAM,
unsigned Words )
static

◆ LLVMInitializeMSP430Disassembler()

Variable Documentation

◆ GR16DecoderTable

const unsigned GR16DecoderTable[]
static
Initial value:
= {
MSP430::PC, MSP430::SP, MSP430::SR, MSP430::CG,
MSP430::R4, MSP430::R5, MSP430::R6, MSP430::R7,
MSP430::R8, MSP430::R9, MSP430::R10, MSP430::R11,
MSP430::R12, MSP430::R13, MSP430::R14, MSP430::R15
}

Definition at line 87 of file MSP430Disassembler.cpp.

Referenced by DecodeGR16RegisterClass().

◆ GR8DecoderTable

const unsigned GR8DecoderTable[]
static
Initial value:
= {
MSP430::PCB, MSP430::SPB, MSP430::SRB, MSP430::CGB,
MSP430::R4B, MSP430::R5B, MSP430::R6B, MSP430::R7B,
MSP430::R8B, MSP430::R9B, MSP430::R10B, MSP430::R11B,
MSP430::R12B, MSP430::R13B, MSP430::R14B, MSP430::R15B
}

Definition at line 69 of file MSP430Disassembler.cpp.

Referenced by DecodeGR8RegisterClass().