LLVM: lib/Target/LoongArch/Disassembler/LoongArchDisassembler.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
25
26using namespace llvm;
28
29#define DEBUG_TYPE "loongarch-disassembler"
30
32
33namespace {
35public:
38
42};
43}
44
48 return new LoongArchDisassembler(STI, Ctx);
49}
50
59
68
76
85
94
103
112
116 if (RegNo >= 32)
120}
121
125 if (RegNo >= 32)
129}
130
139
140template <unsigned N, int P = 0>
142 int64_t Address,
147}
148
149template <unsigned N, unsigned S = 0>
151 int64_t Address,
154
155
158}
159
160#include "LoongArchGenDisassemblerTables.inc"
161
166 uint32_t Insn;
168
169
170
171 if (Bytes.size() < 4) {
174 }
175
177
178 Result = decodeInstruction(DecoderTable32, MI, Insn, Address, this, STI);
180
182}
MCDisassembler::DecodeStatus DecodeStatus
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define LLVM_EXTERNAL_VISIBILITY
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeLoongArchDisassembler()
Definition LoongArchDisassembler.cpp:52
static DecodeStatus DecodeSCRRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
Definition LoongArchDisassembler.cpp:131
static DecodeStatus DecodeCFRRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
Definition LoongArchDisassembler.cpp:95
static DecodeStatus DecodeLASX256RegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
Definition LoongArchDisassembler.cpp:122
static DecodeStatus DecodeFPR64RegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
Definition LoongArchDisassembler.cpp:86
static DecodeStatus decodeUImmOperand(MCInst &Inst, uint64_t Imm, int64_t Address, const MCDisassembler *Decoder)
Definition LoongArchDisassembler.cpp:141
static DecodeStatus DecodeGPRRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
Definition LoongArchDisassembler.cpp:60
static DecodeStatus DecodeFPR32RegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
Definition LoongArchDisassembler.cpp:77
static DecodeStatus DecodeLSX128RegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
Definition LoongArchDisassembler.cpp:113
static DecodeStatus DecodeGPRNoR0R1RegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
Definition LoongArchDisassembler.cpp:70
static MCDisassembler * createLoongArchDisassembler(const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
Definition LoongArchDisassembler.cpp:45
static DecodeStatus decodeSImmOperand(MCInst &Inst, uint64_t Imm, int64_t Address, const MCDisassembler *Decoder)
Definition LoongArchDisassembler.cpp:150
static DecodeStatus DecodeFCSRRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
Definition LoongArchDisassembler.cpp:104
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
Context object for machine code objects.
Superclass for all disassemblers.
DecodeStatus
Ternary decode status.
Instances of this class represent a single low-level machine instruction.
void addOperand(const MCOperand Op)
static MCOperand createReg(MCRegister Reg)
static MCOperand createImm(int64_t Val)
Generic base class for all target subtargets.
Target - Wrapper for Target specific information.
This class implements an extremely fast bulk output stream that can only output to a stream.
uint32_t read32le(const void *P)
This is an optimization pass for GlobalISel generic memory operations.
Target & getTheLoongArch64Target()
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.
Target & getTheLoongArch32Target()
constexpr int64_t SignExtend64(uint64_t x)
Sign-extend the number in the bottom B bits of X to a 64-bit integer.
static void RegisterMCDisassembler(Target &T, Target::MCDisassemblerCtorTy Fn)
RegisterMCDisassembler - Register a MCDisassembler implementation for the given target.