1//===- MipsDisassembler.cpp - Disassembler for Mips -----------------------===// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7//===----------------------------------------------------------------------===// 9// This file is part of the Mips Disassembler. 11//===----------------------------------------------------------------------===// 33#define DEBUG_TYPE "mips-disassembler" 46 IsMicroMips(STI.
hasFeature(Mips::FeatureMicroMips)),
47 IsBigEndian(IsBigEndian) {}
49bool hasMips2()
const{
return STI.
hasFeature(Mips::FeatureMips2); }
50bool hasMips3()
const{
return STI.
hasFeature(Mips::FeatureMips3); }
51bool hasMips32()
const{
return STI.
hasFeature(Mips::FeatureMips32); }
53bool hasMips32r6()
const{
57bool isFP64()
const{
return STI.
hasFeature(Mips::FeatureFP64Bit); }
59bool isGP64()
const{
return STI.
hasFeature(Mips::FeatureGP64Bit); }
61bool isPTR64()
const{
return STI.
hasFeature(Mips::FeaturePTR64Bit); }
63bool hasCnMips()
const{
return STI.
hasFeature(Mips::FeatureCnMips); }
65bool hasCnMipsP()
const{
return STI.
hasFeature(Mips::FeatureCnMipsP); }
68// Only present in MIPS-I and MIPS-II 69return !hasMips32() && !hasMips3();
77}
// end anonymous namespace 79// Forward declare these because the autogenerated code will reference them. 80// Definitions are further down. 205// DecodeBranchTarget7MM - Decode microMIPS branch offset, which is 206// shifted left by 1 bit. 211// DecodeBranchTarget10MM - Decode microMIPS branch offset, which is 212// shifted left by 1 bit. 217// DecodeBranchTargetMM - Decode microMIPS branch offset, which is 218// shifted left by 1 bit. 223// DecodeBranchTarget26MM - Decode microMIPS branch offset, which is 224// shifted left by 1 bit. 229// DecodeJumpTargetMM - Decode microMIPS jump target, which is 230// shifted left by 1 bit. 235// DecodeJumpTargetXMM - Decode microMIPS jump and link exchange target, 236// which is shifted left by 2 bit. 345template <
unsigned Bits,
int Offset,
int Scale>
350template <
unsigned Bits,
int Offset>
354return DecodeUImmWithOffsetAndScale<Bits, Offset, 1>(Inst,
Value,
Address,
358template <
unsigned Bits,
int Offset = 0,
int ScaleBy = 1>
385/// INSVE_[BHWD] have an implicit operand that the generated decoder doesn't 387template <
typename InsnType>
391template <
typename InsnType>
396template <
typename InsnType>
400template <
typename InsnType>
405template <
typename InsnType>
410template <
typename InsnType>
415template <
typename InsnType>
420template <
typename InsnType>
425template <
typename InsnType>
430template <
typename InsnType>
435template <
typename InsnType>
440template <
typename InsnType>
445template <
typename InsnType>
450template <
typename InsnType>
455template <
typename InsnType>
460template <
typename InsnType>
464template <
typename InsnType>
468template <
typename InsnType>
496returnnew MipsDisassembler(STI, Ctx,
true);
503returnnew MipsDisassembler(STI, Ctx,
false);
507// Register the disassembler. 518#include "MipsGenDisassemblerTables.inc" 522return *(
RegInfo->getRegClass(RC).begin() + RegNo);
525template <
typename InsnType>
531// The size of the n field depends on the element size 532// The register class also depends on this. 533 InsnType tmp = fieldFromInstruction(insn, 17, 5);
535 DecodeFN RegDecoder =
nullptr;
536if ((tmp & 0x18) == 0x00) {
// INSVE_B 539 }
elseif ((tmp & 0x1c) == 0x10) {
// INSVE_H 542 }
elseif ((tmp & 0x1e) == 0x18) {
// INSVE_W 545 }
elseif ((tmp & 0x1f) == 0x1c) {
// INSVE_D 551assert(NSize != 0 && RegDecoder !=
nullptr);
554 tmp = fieldFromInstruction(insn, 6, 5);
561 tmp = fieldFromInstruction(insn, 16, NSize);
564 tmp = fieldFromInstruction(insn, 11, 5);
573template <
typename InsnType>
577 InsnType Rs = fieldFromInstruction(insn, 16, 5);
578 InsnType Imm = fieldFromInstruction(insn, 0, 16);
588template <
typename InsnType>
591 InsnType Rs = fieldFromInstruction(insn, 21, 5);
592 InsnType Imm = fieldFromInstruction(insn, 0, 16);
602template <
typename InsnType>
606// If we are called then we can assume that MIPS32r6/MIPS64r6 is enabled 607// (otherwise we would have matched the ADDI instruction from the earlier 611// 0b001000 sssss ttttt iiiiiiiiiiiiiiii 613// BEQZALC if rs == 0 && rt != 0 614// BEQC if rs < rt && rs != 0 616 InsnType Rs = fieldFromInstruction(insn, 21, 5);
617 InsnType Rt = fieldFromInstruction(insn, 16, 5);
618 int64_t Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4;
622MI.setOpcode(Mips::BOVC);
624 }
elseif (Rs != 0 && Rs < Rt) {
625MI.setOpcode(Mips::BEQC);
628MI.setOpcode(Mips::BEQZALC);
641template <
typename InsnType>
645 InsnType Rt = fieldFromInstruction(insn, 21, 5);
646 InsnType Rs = fieldFromInstruction(insn, 16, 5);
650MI.setOpcode(Mips::BOVC_MMR6);
655 Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 2 + 4;
656 }
elseif (Rs != 0 && Rs < Rt) {
657MI.setOpcode(Mips::BEQC_MMR6);
662 Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4;
664MI.setOpcode(Mips::BEQZALC_MMR6);
667 Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 2 + 4;
675template <
typename InsnType>
679// If we are called then we can assume that MIPS32r6/MIPS64r6 is enabled 680// (otherwise we would have matched the ADDI instruction from the earlier 684// 0b011000 sssss ttttt iiiiiiiiiiiiiiii 686// BNEZALC if rs == 0 && rt != 0 687// BNEC if rs < rt && rs != 0 689 InsnType Rs = fieldFromInstruction(insn, 21, 5);
690 InsnType Rt = fieldFromInstruction(insn, 16, 5);
691 int64_t Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4;
695MI.setOpcode(Mips::BNVC);
697 }
elseif (Rs != 0 && Rs < Rt) {
698MI.setOpcode(Mips::BNEC);
701MI.setOpcode(Mips::BNEZALC);
714template <
typename InsnType>
718 InsnType Rt = fieldFromInstruction(insn, 21, 5);
719 InsnType Rs = fieldFromInstruction(insn, 16, 5);
723MI.setOpcode(Mips::BNVC_MMR6);
728 Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 2 + 4;
729 }
elseif (Rs != 0 && Rs < Rt) {
730MI.setOpcode(Mips::BNEC_MMR6);
735 Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4;
737MI.setOpcode(Mips::BNEZALC_MMR6);
740 Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 2 + 4;
748template <
typename InsnType>
753// 0b110101 ttttt sssss iiiiiiiiiiiiiiii 755// BGTZC_MMR6 if rs == 0 && rt != 0 756// BLTZC_MMR6 if rs == rt && rt != 0 757// BLTC_MMR6 if rs != rt && rs != 0 && rt != 0 759 InsnType Rt = fieldFromInstruction(insn, 21, 5);
760 InsnType Rs = fieldFromInstruction(insn, 16, 5);
761 int64_t Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4;
767MI.setOpcode(Mips::BGTZC_MMR6);
769MI.setOpcode(Mips::BLTZC_MMR6);
771MI.setOpcode(Mips::BLTC_MMR6);
787template <
typename InsnType>
792// 0b111101 ttttt sssss iiiiiiiiiiiiiiii 794// BLEZC_MMR6 if rs == 0 && rt != 0 795// BGEZC_MMR6 if rs == rt && rt != 0 796// BGEC_MMR6 if rs != rt && rs != 0 && rt != 0 798 InsnType Rt = fieldFromInstruction(insn, 21, 5);
799 InsnType Rs = fieldFromInstruction(insn, 16, 5);
800 int64_t Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4;
806MI.setOpcode(Mips::BLEZC_MMR6);
808MI.setOpcode(Mips::BGEZC_MMR6);
811MI.setOpcode(Mips::BGEC_MMR6);
826template <
typename InsnType>
830// If we are called then we can assume that MIPS32r6/MIPS64r6 is enabled 831// (otherwise we would have matched the BLEZL instruction from the earlier 835// 0b010110 sssss ttttt iiiiiiiiiiiiiiii 837// BLEZC if rs == 0 && rt != 0 838// BGEZC if rs == rt && rt != 0 839// BGEC if rs != rt && rs != 0 && rt != 0 841 InsnType Rs = fieldFromInstruction(insn, 21, 5);
842 InsnType Rt = fieldFromInstruction(insn, 16, 5);
843 int64_t Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4;
849MI.setOpcode(Mips::BLEZC);
851MI.setOpcode(Mips::BGEZC);
854MI.setOpcode(Mips::BGEC);
869template <
typename InsnType>
873// If we are called then we can assume that MIPS32r6/MIPS64r6 is enabled 874// (otherwise we would have matched the BGTZL instruction from the earlier 878// 0b010111 sssss ttttt iiiiiiiiiiiiiiii 880// BGTZC if rs == 0 && rt != 0 881// BLTZC if rs == rt && rt != 0 882// BLTC if rs != rt && rs != 0 && rt != 0 886 InsnType Rs = fieldFromInstruction(insn, 21, 5);
887 InsnType Rt = fieldFromInstruction(insn, 16, 5);
888 int64_t Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4;
893MI.setOpcode(Mips::BGTZC);
895MI.setOpcode(Mips::BLTZC);
897MI.setOpcode(Mips::BLTC);
913template <
typename InsnType>
917// If we are called then we can assume that MIPS32r6/MIPS64r6 is enabled 918// (otherwise we would have matched the BGTZ instruction from the earlier 922// 0b000111 sssss ttttt iiiiiiiiiiiiiiii 924// BGTZALC if rs == 0 && rt != 0 925// BLTZALC if rs != 0 && rs == rt 926// BLTUC if rs != 0 && rs != rt 928 InsnType Rs = fieldFromInstruction(insn, 21, 5);
929 InsnType Rt = fieldFromInstruction(insn, 16, 5);
930 int64_t Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4;
935MI.setOpcode(Mips::BGTZ);
938MI.setOpcode(Mips::BGTZALC);
941MI.setOpcode(Mips::BLTZALC);
944MI.setOpcode(Mips::BLTUC);
962template <
typename InsnType>
966// If we are called then we can assume that MIPS32r6/MIPS64r6 is enabled 967// (otherwise we would have matched the BLEZL instruction from the earlier 971// 0b000110 sssss ttttt iiiiiiiiiiiiiiii 973// BLEZALC if rs == 0 && rt != 0 974// BGEZALC if rs == rt && rt != 0 975// BGEUC if rs != rt && rs != 0 && rt != 0 977 InsnType Rs = fieldFromInstruction(insn, 21, 5);
978 InsnType Rt = fieldFromInstruction(insn, 16, 5);
979 int64_t Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4;
985MI.setOpcode(Mips::BLEZALC);
987MI.setOpcode(Mips::BGEZALC);
990MI.setOpcode(Mips::BGEUC);
1004// Override the generated disassembler to produce DEXT all the time. This is 1005// for feature / behaviour parity with binutils. 1006template <
typename InsnType>
1009unsigned Msbd = fieldFromInstruction(
Insn, 11, 5);
1010unsigned Lsb = fieldFromInstruction(
Insn, 6, 5);
1014switch (
MI.getOpcode()) {
1021Size = Msbd + 1 + 32;
1031MI.setOpcode(Mips::DEXT);
1033 InsnType Rs = fieldFromInstruction(
Insn, 21, 5);
1034 InsnType Rt = fieldFromInstruction(
Insn, 16, 5);
1046// Override the generated disassembler to produce DINS all the time. This is 1047// for feature / behaviour parity with binutils. 1048template <
typename InsnType>
1051unsigned Msbd = fieldFromInstruction(
Insn, 11, 5);
1052unsigned Lsb = fieldFromInstruction(
Insn, 6, 5);
1056switch (
MI.getOpcode()) {
1059Size = Msbd + 1 - Pos;
1063Size = Msbd + 33 - Pos;
1067// mbsd = pos + size - 33 1068// mbsd - pos + 33 = size 1069Size = Msbd + 33 - Pos;
1075 InsnType Rs = fieldFromInstruction(
Insn, 21, 5);
1076 InsnType Rt = fieldFromInstruction(
Insn, 16, 5);
1078MI.setOpcode(Mips::DINS);
1089// Auto-generated decoder wouldn't add the third operand for CRC32*. 1090template <
typename InsnType>
1093 InsnType Rs = fieldFromInstruction(
Insn, 21, 5);
1094 InsnType Rt = fieldFromInstruction(
Insn, 16, 5);
1104/// Read two bytes from the ArrayRef and return 16 bit halfword sorted 1105/// according to the given endianness. 1109// We want to read exactly 2 Bytes of data. 1110if (Bytes.
size() < 2) {
1116Insn = (Bytes[0] << 8) | Bytes[1];
1118Insn = (Bytes[1] << 8) | Bytes[0];
1124/// Read four bytes from the ArrayRef and return 32 bit word sorted 1125/// according to the given endianness. 1128bool IsBigEndian,
bool IsMicroMips) {
1129// We want to read exactly 4 Bytes of data. 1130if (Bytes.
size() < 4) {
1135// High 16 bits of a 32-bit microMIPS instruction (where the opcode is) 1136// always precede the low 16 bits in the instruction stream (that is, they 1137// are placed at lower addresses in the instruction stream). 1139// microMIPS byte ordering: 1140// Big-endian: 0 | 1 | 2 | 3 1141// Little-endian: 1 | 0 | 3 | 2 1144// Encoded as a big-endian 32-bit word in the stream. 1146 (Bytes[3] << 0) | (Bytes[2] << 8) | (Bytes[1] << 16) | (Bytes[0] << 24);
1149Insn = (Bytes[2] << 0) | (Bytes[3] << 8) | (Bytes[0] << 16) |
1152Insn = (Bytes[0] << 0) | (Bytes[1] << 8) | (Bytes[2] << 16) |
1175dbgs() <<
"Trying MicroMipsR616 table (16-bit instructions):\n");
1176// Calling the auto-generated decoder function for microMIPS32R6 1177// 16-bit instructions. 1178Result = decodeInstruction(DecoderTableMicroMipsR616, Instr,
Insn,
1186LLVM_DEBUG(
dbgs() <<
"Trying MicroMips16 table (16-bit instructions):\n");
1187// Calling the auto-generated decoder function for microMIPS 16-bit 1189Result = decodeInstruction(DecoderTableMicroMips16, Instr,
Insn, Address,
1202dbgs() <<
"Trying MicroMips32r632 table (32-bit instructions):\n");
1203// Calling the auto-generated decoder function. 1204Result = decodeInstruction(DecoderTableMicroMipsR632, Instr,
Insn,
1212LLVM_DEBUG(
dbgs() <<
"Trying MicroMips32 table (32-bit instructions):\n");
1213// Calling the auto-generated decoder function. 1214Result = decodeInstruction(DecoderTableMicroMips32, Instr,
Insn, Address,
1222LLVM_DEBUG(
dbgs() <<
"Trying MicroMipsFP64 table (32-bit opcodes):\n");
1223Result = decodeInstruction(DecoderTableMicroMipsFP6432, Instr,
Insn,
1231// This is an invalid instruction. Claim that the Size is 2 bytes. Since 1232// microMIPS instructions have a minimum alignment of 2, the next 2 bytes 1233// could form a valid instruction. The two bytes we rejected as an 1234// instruction could have actually beeen an inline constant pool that is 1235// unconditionally branched over. 1240// Attempt to read the instruction so that we can attempt to decode it. If 1241// the buffer is not 4 bytes long, let the higher level logic figure out 1242// what to do with a size of zero and MCDisassembler::Fail. 1247// The only instruction size for standard encoded MIPS. 1253 decodeInstruction(DecoderTableCOP3_32, Instr,
Insn, Address,
this, STI);
1258if (hasMips32r6() && isGP64()) {
1260dbgs() <<
"Trying Mips32r6_64r6 (GPR64) table (32-bit opcodes):\n");
1261Result = decodeInstruction(DecoderTableMips32r6_64r6_GP6432, Instr,
Insn,
1267if (hasMips32r6() && isPTR64()) {
1269dbgs() <<
"Trying Mips32r6_64r6 (PTR64) table (32-bit opcodes):\n");
1270Result = decodeInstruction(DecoderTableMips32r6_64r6_PTR6432, Instr,
Insn,
1277LLVM_DEBUG(
dbgs() <<
"Trying Mips32r6_64r6 table (32-bit opcodes):\n");
1278Result = decodeInstruction(DecoderTableMips32r6_64r632, Instr,
Insn,
1284if (hasMips2() && isPTR64()) {
1286dbgs() <<
"Trying Mips32r6_64r6 (PTR64) table (32-bit opcodes):\n");
1287Result = decodeInstruction(DecoderTableMips32_64_PTR6432, Instr,
Insn,
1295Result = decodeInstruction(DecoderTableCnMips32, Instr,
Insn,
1303Result = decodeInstruction(DecoderTableCnMipsP32, Instr,
Insn,
1310LLVM_DEBUG(
dbgs() <<
"Trying Mips64 (GPR64) table (32-bit opcodes):\n");
1311Result = decodeInstruction(DecoderTableMips6432, Instr,
Insn,
1319dbgs() <<
"Trying MipsFP64 (64 bit FPU) table (32-bit opcodes):\n");
1320Result = decodeInstruction(DecoderTableMipsFP6432, Instr,
Insn,
1327// Calling the auto-generated decoder function. 1329 decodeInstruction(DecoderTableMips32, Instr,
Insn, Address,
this, STI);
1348unsigned Reg =
getReg(Decoder, Mips::GPR64RegClassID, RegNo);
1358unsigned Reg =
getReg(Decoder, Mips::GPRMM16RegClassID, RegNo);
1368unsigned Reg =
getReg(Decoder, Mips::GPRMM16ZeroRegClassID, RegNo);
1378unsigned Reg =
getReg(Decoder, Mips::GPRMM16MovePRegClassID, RegNo);
1388unsigned Reg =
getReg(Decoder, Mips::GPR32RegClassID, RegNo);
1396if (
static_cast<constMipsDisassembler *
>(Decoder)->isGP64())
1414unsigned Reg =
getReg(Decoder, Mips::FGR64RegClassID, RegNo);
1425unsigned Reg =
getReg(Decoder, Mips::FGR32RegClassID, RegNo);
1435unsigned Reg =
getReg(Decoder, Mips::CCRRegClassID, RegNo);
1445unsigned Reg =
getReg(Decoder, Mips::FCCRegClassID, RegNo);
1456unsigned Reg =
getReg(Decoder, Mips::FGRCCRegClassID, RegNo);
1464unsigned Reg = fieldFromInstruction(
Insn, 16, 5);
1465unsignedBase = fieldFromInstruction(
Insn, 21, 5);
1467 Reg =
getReg(Decoder, Mips::GPR32RegClassID, Reg);
1484unsigned Reg = fieldFromInstruction(
Insn, 16, 5);
1485unsignedBase = fieldFromInstruction(
Insn, 21, 5);
1487 Reg =
getReg(Decoder, Mips::GPR32RegClassID, Reg);
1504unsignedBase = fieldFromInstruction(
Insn, 16, 5);
1505unsigned Reg = fieldFromInstruction(
Insn, 21, 5);
1508 Reg =
getReg(Decoder, Mips::GPR32RegClassID, Reg);
1520unsigned Hint = fieldFromInstruction(
Insn, 16, 5);
1521unsignedBase = fieldFromInstruction(
Insn, 21, 5);
1536unsignedBase = fieldFromInstruction(
Insn, 16, 5);
1537unsigned Hint = fieldFromInstruction(
Insn, 21, 5);
1552unsignedBase = fieldFromInstruction(
Insn, 16, 5);
1553unsigned Hint = fieldFromInstruction(
Insn, 21, 5);
1568unsigned Hint = fieldFromInstruction(
Insn, 16, 5);
1569unsignedBase = fieldFromInstruction(
Insn, 21, 5);
1583unsignedBase = fieldFromInstruction(
Insn, 21, 5);
1597unsignedBase = fieldFromInstruction(
Insn, 16, 5);
1609int Immediate = SignExtend32<16>(
Insn & 0xffff);
1610unsignedBase = fieldFromInstruction(
Insn, 16, 5);
1623intOffset = SignExtend32<10>(fieldFromInstruction(
Insn, 16, 10));
1624unsigned Reg = fieldFromInstruction(
Insn, 6, 5);
1625unsignedBase = fieldFromInstruction(
Insn, 11, 5);
1627 Reg =
getReg(Decoder, Mips::MSA128BRegClassID, Reg);
1633// The immediate field of an LD/ST instruction is scaled which means it must 1634// be multiplied (when decoding) by the size (in bytes) of the instructions' 1643assert(
false &&
"Unexpected instruction");
1671unsigned Reg = fieldFromInstruction(
Insn, 7, 3);
1672unsignedBase = fieldFromInstruction(
Insn, 4, 3);
1683case Mips::SB16_MMR6:
1685case Mips::SH16_MMR6:
1687case Mips::SW16_MMR6:
1706case Mips::SB16_MMR6:
1711case Mips::SH16_MMR6:
1716case Mips::SW16_MMR6:
1728unsigned Reg = fieldFromInstruction(
Insn, 5, 5);
1730 Reg =
getReg(Decoder, Mips::GPR32RegClassID, Reg);
1743unsigned Reg = fieldFromInstruction(
Insn, 7, 3);
1745 Reg =
getReg(Decoder, Mips::GPR32RegClassID, Reg);
1759case Mips::LWM16_MMR6:
1760case Mips::SWM16_MMR6:
1782unsigned Reg = fieldFromInstruction(
Insn, 21, 5);
1783unsignedBase = fieldFromInstruction(
Insn, 16, 5);
1785 Reg =
getReg(Decoder, Mips::GPR32RegClassID, Reg);
1802unsigned Reg = fieldFromInstruction(
Insn, 21, 5);
1803unsignedBase = fieldFromInstruction(
Insn, 16, 5);
1805 Reg =
getReg(Decoder, Mips::GPR32RegClassID, Reg);
1836unsigned Reg = fieldFromInstruction(
Insn, 21, 5);
1837unsignedBase = fieldFromInstruction(
Insn, 16, 5);
1839 Reg =
getReg(Decoder, Mips::GPR32RegClassID, Reg);
1852unsigned Reg = fieldFromInstruction(
Insn, 16, 5);
1853unsignedBase = fieldFromInstruction(
Insn, 21, 5);
1855 Reg =
getReg(Decoder, Mips::FGR64RegClassID, Reg);
1868// This function is the same as DecodeFMem but with the Reg and Base fields 1869// swapped according to microMIPS spec. 1871unsignedBase = fieldFromInstruction(
Insn, 16, 5);
1872unsigned Reg = fieldFromInstruction(
Insn, 21, 5);
1874 Reg =
getReg(Decoder, Mips::FGR64RegClassID, Reg);
1887unsigned Reg = fieldFromInstruction(
Insn, 16, 5);
1888unsignedBase = fieldFromInstruction(
Insn, 21, 5);
1890 Reg =
getReg(Decoder, Mips::COP2RegClassID, Reg);
1903unsigned Reg = fieldFromInstruction(
Insn, 16, 5);
1904unsignedBase = fieldFromInstruction(
Insn, 21, 5);
1906 Reg =
getReg(Decoder, Mips::COP3RegClassID, Reg);
1920unsigned Reg = fieldFromInstruction(
Insn, 16, 5);
1921unsignedBase = fieldFromInstruction(
Insn, 11, 5);
1923 Reg =
getReg(Decoder, Mips::COP2RegClassID, Reg);
1937unsigned Reg = fieldFromInstruction(
Insn, 21, 5);
1938unsignedBase = fieldFromInstruction(
Insn, 16, 5);
1940 Reg =
getReg(Decoder, Mips::COP2RegClassID, Reg);
1953 int64_t
Offset = SignExtend64<9>((
Insn >> 7) & 0x1ff);
1954unsigned Rt = fieldFromInstruction(
Insn, 16, 5);
1955unsignedBase = fieldFromInstruction(
Insn, 21, 5);
1957 Rt =
getReg(Decoder, Mips::GPR32RegClassID, Rt);
1974// Currently only hardware register 29 is supported. 1984if (RegNo > 30 || RegNo %2)
1987unsigned Reg =
getReg(Decoder, Mips::AFGR64RegClassID, RegNo /2);
1998unsigned Reg =
getReg(Decoder, Mips::ACC64DSPRegClassID, RegNo);
2009unsigned Reg =
getReg(Decoder, Mips::HI32DSPRegClassID, RegNo);
2020unsigned Reg =
getReg(Decoder, Mips::LO32DSPRegClassID, RegNo);
2031unsigned Reg =
getReg(Decoder, Mips::MSA128BRegClassID, RegNo);
2042unsigned Reg =
getReg(Decoder, Mips::MSA128HRegClassID, RegNo);
2053unsigned Reg =
getReg(Decoder, Mips::MSA128WRegClassID, RegNo);
2064unsigned Reg =
getReg(Decoder, Mips::MSA128DRegClassID, RegNo);
2075unsigned Reg =
getReg(Decoder, Mips::MSACtrlRegClassID, RegNo);
2086unsigned Reg =
getReg(Decoder, Mips::COP0RegClassID, RegNo);
2097unsigned Reg =
getReg(Decoder, Mips::COP2RegClassID, RegNo);
2105 int32_t BranchOffset = (SignExtend32<16>(
Offset) * 4) + 4;
2113 int32_t BranchOffset = (SignExtend32<16>(
Offset) * 2);
2121unsigned JumpOffset = fieldFromInstruction(
Insn, 0, 26) << 2;
2129 int32_t BranchOffset = SignExtend32<21>(
Offset) * 4 + 4;
2138 int32_t BranchOffset = SignExtend32<21>(
Offset) * 4 + 4;
2147 int32_t BranchOffset = SignExtend32<26>(
Offset) * 4 + 4;
2156 int32_t BranchOffset = SignExtend32<8>(
Offset << 1);
2164 int32_t BranchOffset = SignExtend32<11>(
Offset << 1);
2172 int32_t BranchOffset = SignExtend32<16>(
Offset) * 2 + 4;
2180 int32_t BranchOffset = SignExtend32<27>(
Offset << 1);
2189unsigned JumpOffset = fieldFromInstruction(
Insn, 0, 26) << 1;
2197unsigned JumpOffset = fieldFromInstruction(
Insn, 0, 26) << 2;
2207elseif (
Value == 0x7)
2231template <
unsigned Bits,
int Offset,
int Scale>
2235Value &= ((1 << Bits) - 1);
2241template <
unsigned Bits,
int Offset,
int ScaleBy>
2245 int32_t Imm = SignExtend32<Bits>(
Value) * ScaleBy;
2252// First we need to grab the pos(lsb) from MCInst. 2253// This function only handles the 32 bit variants of ins, as dins 2254// variants are handled differently. 2277 int32_t DecodedValue;
2279case 0: DecodedValue = 256;
break;
2280case 1: DecodedValue = 257;
break;
2281case 510: DecodedValue = -258;
break;
2282case 511: DecodedValue = -257;
break;
2283default: DecodedValue = SignExtend32<9>(
Insn);
break;
2292// Insn must be >= 0, since it is unsigned that condition is always true. 2294 int32_t DecodedValues[] = {128, 1, 2, 3, 4, 7, 8, 15, 16, 31, 32, 63, 64,
2303unsigned Regs[] = {Mips::S0, Mips::S1, Mips::S2, Mips::S3, Mips::S4, Mips::S5,
2304 Mips::S6, Mips::S7, Mips::FP};
2307unsigned RegLst = fieldFromInstruction(
Insn, 21, 5);
2309// Empty register lists are not allowed. 2313 RegNum = RegLst & 0xf;
2315// RegLst values 10-15, and 26-31 are reserved. 2319for (
unsigned i = 0; i < RegNum; i++)
2331unsigned Regs[] = {Mips::S0, Mips::S1, Mips::S2, Mips::S3};
2335 RegLst = fieldFromInstruction(
Insn, 4, 2);
2337case Mips::LWM16_MMR6:
2338case Mips::SWM16_MMR6:
2339 RegLst = fieldFromInstruction(
Insn, 8, 2);
2342unsigned RegNum = RegLst & 0x3;
2344for (
unsigned i = 0; i <= RegNum; i++)
2355unsigned RegPair = fieldFromInstruction(
Insn, 7, 3);
2361if (
static_cast<constMipsDisassembler*
>(Decoder)->hasMips32r6())
2362 RegRs = fieldFromInstruction(
Insn, 0, 2) |
2363 (fieldFromInstruction(
Insn, 3, 1) << 2);
2365 RegRs = fieldFromInstruction(
Insn, 1, 3);
2370unsigned RegRt = fieldFromInstruction(
Insn, 4, 3);
2428template <
typename InsnType>
2433// 0b000111 ttttt sssss iiiiiiiiiiiiiiii 2434// Invalid if rt == 0 2435// BGTZALC_MMR6 if rs == 0 && rt != 0 2436// BLTZALC_MMR6 if rs != 0 && rs == rt 2437// BLTUC_MMR6 if rs != 0 && rs != rt 2439 InsnType Rt = fieldFromInstruction(insn, 21, 5);
2440 InsnType Rs = fieldFromInstruction(insn, 16, 5);
2448MI.setOpcode(Mips::BGTZALC_MMR6);
2450 Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 2 + 4;
2453MI.setOpcode(Mips::BLTZALC_MMR6);
2455 Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 2 + 4;
2458MI.setOpcode(Mips::BLTUC_MMR6);
2461 Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4;
2477template <
typename InsnType>
2482// 0b000110 ttttt sssss iiiiiiiiiiiiiiii 2483// Invalid if rt == 0 2484// BLEZALC_MMR6 if rs == 0 && rt != 0 2485// BGEZALC_MMR6 if rs == rt && rt != 0 2486// BGEUC_MMR6 if rs != rt && rs != 0 && rt != 0 2488 InsnType Rt = fieldFromInstruction(insn, 21, 5);
2489 InsnType Rs = fieldFromInstruction(insn, 16, 5);
2496MI.setOpcode(Mips::BLEZALC_MMR6);
2497 Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 2 + 4;
2500MI.setOpcode(Mips::BGEZALC_MMR6);
2501 Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 2 + 4;
2505MI.setOpcode(Mips::BGEUC_MMR6);
2506 Imm =
SignExtend64(fieldFromInstruction(insn, 0, 16), 16) * 4 + 4;
2520// This instruction does not have a working decoder, and needs to be 2521// fixed. This "fixme" function was introduced to keep the backend compiling, 2522// while making changes to tablegen code. SmallVector< AArch64_IMM::ImmInsnModel, 4 > Insn
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
#define LLVM_EXTERNAL_VISIBILITY
static DecodeStatus DecodePOOL16BEncodedField(MCInst &Inst, unsigned Value, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeFMemCop2MMR6(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSimm19Lsl2(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMemEVA(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBgtzlGroupBranch(MCInst &MI, InsnType insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeRegListOperand(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus readInstruction32(ArrayRef< uint8_t > Bytes, uint64_t Address, uint64_t &Size, uint32_t &Insn, bool IsBigEndian, bool IsMicroMips)
Read four bytes from the ArrayRef and return 32 bit word sorted according to the given endianness.
static DecodeStatus DecodeBranchTarget21(MCInst &Inst, unsigned Offset, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeJumpTargetXMM(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeFGR32RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeCCRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeCOP2RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static unsigned getReg(const MCDisassembler *D, unsigned RC, unsigned RegNo)
static DecodeStatus DecodeFCCRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeCacheOpMM(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus readInstruction16(ArrayRef< uint8_t > Bytes, uint64_t Address, uint64_t &Size, uint32_t &Insn, bool IsBigEndian)
Read two bytes from the ArrayRef and return 16 bit halfword sorted according to the given endianness.
static DecodeStatus DecodeGPRMM16RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSImmWithOffsetAndScale(MCInst &Inst, unsigned Value, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSimm23Lsl2(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeGPRMM16MovePRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBranchTarget1SImm16(MCInst &Inst, unsigned Offset, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMemMMImm9(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMovePOperands(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeCRC(MCInst &MI, InsnType Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodePOP75GroupBranchMMR6(MCInst &MI, InsnType insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeDINS(MCInst &MI, InsnType Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMSA128Mem(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodePrefeOpMM(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeCPU16RegsRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMSA128WRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBranchTarget26(MCInst &Inst, unsigned Offset, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeFMem(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeCacheOp(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSyncI_MM(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeLoadByte15(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSimm9SP(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeFMem2(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeUImmWithOffsetAndScale(MCInst &Inst, unsigned Value, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMemMMImm12(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeDEXT(MCInst &MI, InsnType Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeGPRMM16ZeroRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodePtrRegisterClass(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeLi16Imm(MCInst &Inst, unsigned Value, uint64_t Address, const MCDisassembler *Decoder)
static MCDisassembler * createMipselDisassembler(const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
static DecodeStatus DecodeSimm18Lsl3(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeFMem3(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBlezlGroupBranch(MCInst &MI, InsnType insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeCOP0RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBranchTarget(MCInst &Inst, unsigned Offset, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMemMMReglistImm4Lsl2(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBgtzGroupBranch(MCInst &MI, InsnType insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBranchTargetMM(MCInst &Inst, unsigned Offset, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodePOP35GroupBranchMMR6(MCInst &MI, InsnType insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeFIXMEInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBranchTarget10MM(MCInst &Inst, unsigned Offset, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeANDI16Imm(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMSA128DRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMemMMImm4(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static MCDisassembler * createMipsDisassembler(const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
static DecodeStatus DecodeGPR32RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMSA128BRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeHWRegsRegisterClass(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeDaddiGroupBranch(MCInst &MI, InsnType insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMovePRegPair(MCInst &Inst, unsigned RegPair, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeDAHIDATIMMR6(MCInst &MI, InsnType insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBranchTarget21MM(MCInst &Inst, unsigned Offset, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBranchTarget26MM(MCInst &Inst, unsigned Offset, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeAFGR64RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeDAHIDATI(MCInst &MI, InsnType insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeLO32DSPRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSpecial3LlSc(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeHI32DSPRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
MCDisassembler::DecodeStatus DecodeStatus
static DecodeStatus DecodeSynciR6(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeUImmWithOffset(MCInst &Inst, unsigned Value, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeRegListOperand16(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeAddiGroupBranch(MCInst &MI, InsnType insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMemMMSPImm5Lsl2(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeAddiur2Simm7(MCInst &Inst, unsigned Value, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMSACtrlRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMSA128HRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeFMemMMR2(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeCacheeOp_CacheOpR6(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMemMMImm16(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBranchTarget7MM(MCInst &Inst, unsigned Offset, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeFGR64RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeGPR64RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBlezGroupBranchMMR6(MCInst &MI, InsnType insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeJumpTargetMM(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodePOP37GroupBranchMMR6(MCInst &MI, InsnType insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeSyncI(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeJumpTarget(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeACC64DSPRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeFMemCop2R6(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBgtzGroupBranchMMR6(MCInst &MI, InsnType insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodePOP65GroupBranchMMR6(MCInst &MI, InsnType insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeDSPRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeInsSize(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeMipsDisassembler()
static DecodeStatus DecodeBlezGroupBranch(MCInst &MI, InsnType insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeMem(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeFGRCCRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeINSVE_DF(MCInst &MI, InsnType insn, uint64_t Address, const MCDisassembler *Decoder)
INSVE_[BHWD] have an implicit operand that the generated decoder doesn't handle.
static DecodeStatus DecodeMemMMGPImm7Lsl2(MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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.
virtual DecodeStatus getInstruction(MCInst &Instr, uint64_t &Size, ArrayRef< uint8_t > Bytes, uint64_t Address, raw_ostream &CStream) const =0
Returns the disassembly of a single instruction.
Instances of this class represent a single low-level machine instruction.
unsigned getOpcode() const
void addOperand(const MCOperand Op)
const MCOperand & getOperand(unsigned i) const
static MCOperand createReg(MCRegister Reg)
static MCOperand createImm(int64_t Val)
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Generic base class for all target subtargets.
bool hasFeature(unsigned Feature) const
Target - Wrapper for Target specific information.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
Target & getTheMips64Target()
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Target & getTheMips64elTarget()
Target & getTheMipselTarget()
constexpr int64_t SignExtend64(uint64_t x)
Sign-extend the number in the bottom B bits of X to a 64-bit integer.
Target & getTheMipsTarget()
static void RegisterMCDisassembler(Target &T, Target::MCDisassemblerCtorTy Fn)
RegisterMCDisassembler - Register a MCDisassembler implementation for the given target.