LLVM 20.0.0git
Macros | Typedefs | Enumerations | Functions | Variables
MSP430Disassembler.cpp File Reference
#include "MCTargetDesc/MSP430MCTargetDesc.h"
#include "MSP430.h"
#include "TargetInfo/MSP430TargetInfo.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/MCRegisterInfo.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/Endian.h"
#include "MSP430GenDisassemblerTables.inc"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "msp430-disassembler"
 

Typedefs

typedef MCDisassembler::DecodeStatus DecodeStatus
 

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_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_t * getDecoderTable (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 27 of file MSP430Disassembler.cpp.

Typedef Documentation

◆ DecodeStatus

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 142 of file MSP430Disassembler.cpp.

Function Documentation

◆ createMSP430Disassembler()

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

Definition at line 55 of file MSP430Disassembler.cpp.

Referenced by LLVMInitializeMSP430Disassembler().

◆ DecodeCGImm()

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

◆ DecodeDstAddrMode()

static AddrMode DecodeDstAddrMode ( unsigned  Insn)
static

Definition at line 193 of file MSP430Disassembler.cpp.

References amAbsolute, amIndexed, amRegister, amSymbolic, and Insn.

◆ DecodeGR16RegisterClass()

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

◆ DecodeGR8RegisterClass()

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

◆ DecodeMemOperand()

static DecodeStatus DecodeMemOperand ( MCInst MI,
uint64_t  Bits,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodeSrcAddrMode()

static AddrMode DecodeSrcAddrMode ( unsigned  Rs,
unsigned  As 
)
static

◆ DecodeSrcAddrModeI()

static AddrMode DecodeSrcAddrModeI ( unsigned  Insn)
static

Definition at line 181 of file MSP430Disassembler.cpp.

References DecodeSrcAddrMode(), and Insn.

◆ DecodeSrcAddrModeII()

static AddrMode DecodeSrcAddrModeII ( unsigned  Insn)
static

Definition at line 187 of file MSP430Disassembler.cpp.

References DecodeSrcAddrMode(), and Insn.

◆ getCondCode()

static MSP430CC::CondCodes getCondCode ( unsigned  Cond)
static

◆ getDecoderTable()

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

◆ LLVMInitializeMSP430Disassembler()

LLVM_EXTERNAL_VISIBILITY void 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 84 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 66 of file MSP430Disassembler.cpp.

Referenced by DecodeGR8RegisterClass().