27 virtual ~SystemZDisassembler() {}
41 return new SystemZDisassembler(STI);
51 const unsigned *Regs) {
52 assert(RegNo < 16 &&
"Invalid register");
62 const void *Decoder) {
68 const void *Decoder) {
74 const void *Decoder) {
80 const void *Decoder) {
86 const void *Decoder) {
92 const void *Decoder) {
98 const void *Decoder) {
104 const void *Decoder) {
110 assert(isUInt<N>(Imm) &&
"Invalid immediate");
117 assert(isUInt<N>(Imm) &&
"Invalid immediate");
124 const void *Decoder) {
125 return decodeUImmOperand<4>(Inst, Imm);
129 uint64_t Address,
const void *Decoder) {
130 return decodeUImmOperand<4>(Inst, Imm);
134 uint64_t Address,
const void *Decoder) {
135 return decodeUImmOperand<6>(Inst, Imm);
139 uint64_t Address,
const void *Decoder) {
140 return decodeUImmOperand<8>(Inst, Imm);
144 uint64_t Address,
const void *Decoder) {
145 return decodeUImmOperand<16>(Inst, Imm);
149 uint64_t Address,
const void *Decoder) {
150 return decodeUImmOperand<32>(Inst, Imm);
154 uint64_t Address,
const void *Decoder) {
155 return decodeSImmOperand<8>(Inst, Imm);
159 uint64_t Address,
const void *Decoder) {
160 return decodeSImmOperand<16>(Inst, Imm);
164 uint64_t Address,
const void *Decoder) {
165 return decodeSImmOperand<32>(Inst, Imm);
171 assert(isUInt<N>(Imm) &&
"Invalid PC-relative offset");
178 const void *Decoder) {
179 return decodePCDBLOperand<16>(Inst, Imm, Address);
184 const void *Decoder) {
185 return decodePCDBLOperand<32>(Inst, Imm, Address);
189 const unsigned *Regs) {
190 uint64_t Base = Field >> 12;
191 uint64_t Disp = Field & 0xfff;
192 assert(Base < 16 &&
"Invalid BDAddr12");
199 const unsigned *Regs) {
200 uint64_t Base = Field >> 20;
201 uint64_t Disp = ((Field << 12) & 0xff000) | ((Field >> 8) & 0xfff);
202 assert(Base < 16 &&
"Invalid BDAddr20");
209 const unsigned *Regs) {
210 uint64_t Index = Field >> 16;
211 uint64_t Base = (Field >> 12) & 0xf;
212 uint64_t Disp = Field & 0xfff;
213 assert(Index < 16 &&
"Invalid BDXAddr12");
221 const unsigned *Regs) {
222 uint64_t Index = Field >> 24;
223 uint64_t Base = (Field >> 20) & 0xf;
224 uint64_t Disp = ((Field & 0xfff00) >> 8) | ((Field & 0xff) << 12);
225 assert(Index < 16 &&
"Invalid BDXAddr20");
233 const unsigned *Regs) {
234 uint64_t Length = Field >> 16;
235 uint64_t Base = (Field >> 12) & 0xf;
236 uint64_t Disp = Field & 0xfff;
237 assert(Length < 256 &&
"Invalid BDLAddr12Len8");
246 const void *Decoder) {
252 const void *Decoder) {
258 const void *Decoder) {
264 const void *Decoder) {
270 const void *Decoder) {
276 const void *Decoder) {
283 const void *Decoder) {
287 #include "SystemZGenDisassemblerTables.inc"
297 if (Region.
readBytes(Address, 2, Bytes) == -1)
301 const uint8_t *Table;
302 if (Bytes[0] < 0x40) {
304 Table = DecoderTable16;
305 }
else if (Bytes[0] < 0xc0) {
307 Table = DecoderTable32;
310 Table = DecoderTable48;
314 if (Size > 2 && Region.
readBytes(Address + 2, Size - 2, Bytes + 2) == -1)
319 for (uint64_t
I = 0;
I < Size; ++
I)
320 Inst = (Inst << 8) | Bytes[
I];
static DecodeStatus decodeRegisterClass(MCInst &Inst, uint64_t RegNo, const unsigned *Regs)
static DecodeStatus decodeBDAddr12Operand(MCInst &Inst, uint64_t Field, const unsigned *Regs)
static MCDisassembler * createSystemZDisassembler(const Target &T, const MCSubtargetInfo &STI)
const unsigned GR32Regs[16]
static MCOperand CreateReg(unsigned Reg)
const unsigned FP128Regs[16]
static DecodeStatus decodeBDAddr32Disp12Operand(MCInst &Inst, uint64_t Field, uint64_t Address, const void *Decoder)
static DecodeStatus decodeBDAddr20Operand(MCInst &Inst, uint64_t Field, const unsigned *Regs)
static DecodeStatus decodePC32DBLOperand(MCInst &Inst, uint64_t Imm, uint64_t Address, const void *Decoder)
static DecodeStatus decodeBDXAddr12Operand(MCInst &Inst, uint64_t Field, const unsigned *Regs)
MCDisassembler::DecodeStatus DecodeStatus
static DecodeStatus DecodeADDR64BitRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static void RegisterMCDisassembler(Target &T, Target::MCDisassemblerCtorTy Fn)
const unsigned FP32Regs[16]
static DecodeStatus DecodeFP32BitRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus decodePC16DBLOperand(MCInst &Inst, uint64_t Imm, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeFP128BitRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus decodeS32ImmOperand(MCInst &Inst, uint64_t Imm, uint64_t Address, const void *Decoder)
static DecodeStatus decodeU6ImmOperand(MCInst &Inst, uint64_t Imm, uint64_t Address, const void *Decoder)
virtual int readBytes(uint64_t address, uint64_t size, uint8_t *buf) const
static DecodeStatus decodeBDAddr64Disp20Operand(MCInst &Inst, uint64_t Field, uint64_t Address, const void *Decoder)
static DecodeStatus decodeBDXAddr20Operand(MCInst &Inst, uint64_t Field, const unsigned *Regs)
const unsigned GRH32Regs[16]
static DecodeStatus decodeU16ImmOperand(MCInst &Inst, uint64_t Imm, uint64_t Address, const void *Decoder)
static DecodeStatus decodeBDAddr32Disp20Operand(MCInst &Inst, uint64_t Field, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeGR32BitRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus decodeBDAddr64Disp12Operand(MCInst &Inst, uint64_t Field, uint64_t Address, const void *Decoder)
static DecodeStatus decodeBDXAddr64Disp12Operand(MCInst &Inst, uint64_t Field, uint64_t Address, const void *Decoder)
static DecodeStatus decodeS8ImmOperand(MCInst &Inst, uint64_t Imm, uint64_t Address, const void *Decoder)
static DecodeStatus decodeBDLAddr12Len8Operand(MCInst &Inst, uint64_t Field, const unsigned *Regs)
A single entry single exit Region.
static DecodeStatus decodeU32ImmOperand(MCInst &Inst, uint64_t Imm, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeGR64BitRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus decodeUImmOperand(MCInst &Inst, uint64_t Imm)
static DecodeStatus decodeBDXAddr64Disp20Operand(MCInst &Inst, uint64_t Field, uint64_t Address, const void *Decoder)
static DecodeStatus decodeAccessRegOperand(MCInst &Inst, uint64_t Imm, uint64_t Address, const void *Decoder)
static DecodeStatus decodeS16ImmOperand(MCInst &Inst, uint64_t Imm, uint64_t Address, const void *Decoder)
static DecodeStatus decodePCDBLOperand(MCInst &Inst, uint64_t Imm, uint64_t Address)
static DecodeStatus decodeBDLAddr64Disp12Len8Operand(MCInst &Inst, uint64_t Field, uint64_t Address, const void *Decoder)
const unsigned FP64Regs[16]
const unsigned GR128Regs[16]
const unsigned GR64Regs[16]
static DecodeStatus decodeU8ImmOperand(MCInst &Inst, uint64_t Imm, uint64_t Address, const void *Decoder)
static MCOperand CreateImm(int64_t Val)
static DecodeStatus decodeU4ImmOperand(MCInst &Inst, uint64_t Imm, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeGRH32BitRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeGR128BitRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus decodeSImmOperand(MCInst &Inst, uint64_t Imm)
void LLVMInitializeSystemZDisassembler()
static DecodeStatus DecodeFP64BitRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder)
void addOperand(const MCOperand &Op)
int decodeInstruction(struct InternalInstruction *insn, byteReader_t reader, const void *readerArg, dlog_t logger, void *loggerArg, const void *miiArg, uint64_t startLoc, DisassemblerMode mode)