44#define DEBUG_TYPE "mccodeemitter"
46STATISTIC(MCNumEmitted,
"Number of MC instructions emitted.");
47STATISTIC(MCNumCPRelocations,
"Number of constant pool relocations created.");
58 : MCII(mcii), CTX(ctx), IsLittleEndian(IsLittle) {
60 ARMMCCodeEmitter(
const ARMMCCodeEmitter &) =
delete;
61 ARMMCCodeEmitter &
operator=(
const ARMMCCodeEmitter &) =
delete;
62 ~ARMMCCodeEmitter()
override =
default;
74 return TT.isOSBinFormatMachO();
77 unsigned getMachineSoImmOpValue(
unsigned SoImm)
const;
99 bool EncodeAddrModeOpValues(
const MCInst &
MI,
unsigned OpIdx,
100 unsigned &Reg,
unsigned &Imm,
208 template<
unsigned Bits,
unsigned Shift>
308 unsigned getCCOutOpValue(
const MCInst &
MI,
unsigned Op,
313 return MI.getOperand(
Op).getReg() == ARM::CPSR;
316 unsigned getModImmOpValue(
const MCInst &
MI,
unsigned Op,
335 unsigned getT2SOImmOpValue(
const MCInst &
MI,
unsigned Op,
348 unsigned SoImm = MO.
getImm();
350 assert(Encoded != ~0U &&
"Not a Thumb2 so_imm value?");
354 unsigned getT2AddrModeSORegOpValue(
const MCInst &
MI,
unsigned OpNum,
357 template<
unsigned Bits,
unsigned Shift>
358 unsigned getT2AddrModeImmOpValue(
const MCInst &
MI,
unsigned OpNum,
361 unsigned getT2AddrModeImm8OffsetOpValue(
const MCInst &
MI,
unsigned OpNum,
366 unsigned getSORegRegOpValue(
const MCInst &
MI,
unsigned Op,
369 unsigned getSORegImmOpValue(
const MCInst &
MI,
unsigned Op,
372 unsigned getT2SORegOpValue(
const MCInst &
MI,
unsigned Op,
376 unsigned getNEONVcvtImm32OpValue(
const MCInst &
MI,
unsigned Op,
379 return 64 -
MI.getOperand(
Op).getImm();
382 unsigned getBitfieldInvertedMaskOpValue(
const MCInst &
MI,
unsigned Op,
386 unsigned getRegisterListOpValue(
const MCInst &
MI,
unsigned Op,
389 unsigned getAddrMode6AddressOpValue(
const MCInst &
MI,
unsigned Op,
392 unsigned getAddrMode6OneLane32AddressOpValue(
const MCInst &
MI,
unsigned Op,
395 unsigned getAddrMode6DupAddressOpValue(
const MCInst &
MI,
unsigned Op,
398 unsigned getAddrMode6OffsetOpValue(
const MCInst &
MI,
unsigned Op,
402 unsigned getShiftRight8Imm(
const MCInst &
MI,
unsigned Op,
405 unsigned getShiftRight16Imm(
const MCInst &
MI,
unsigned Op,
408 unsigned getShiftRight32Imm(
const MCInst &
MI,
unsigned Op,
411 unsigned getShiftRight64Imm(
const MCInst &
MI,
unsigned Op,
415 unsigned getThumbSRImmOpValue(
const MCInst &
MI,
unsigned Op,
419 unsigned NEONThumb2DataIPostEncoder(
const MCInst &
MI,
420 unsigned EncodedValue,
422 unsigned NEONThumb2LoadStorePostEncoder(
const MCInst &
MI,
423 unsigned EncodedValue,
425 unsigned NEONThumb2DupPostEncoder(
const MCInst &
MI,
426 unsigned EncodedValue,
428 unsigned NEONThumb2V8PostEncoder(
const MCInst &
MI,
429 unsigned EncodedValue,
432 unsigned VFPThumb2PostEncoder(
const MCInst &
MI,
433 unsigned EncodedValue,
444 template <
bool isNeg, ARM::Fixups fixup>
459 template <
unsigned size>
470unsigned ARMMCCodeEmitter::NEONThumb2DataIPostEncoder(
const MCInst &
MI,
471 unsigned EncodedValue,
477 unsigned Bit24 = EncodedValue & 0x01000000;
478 unsigned Bit28 = Bit24 << 4;
479 EncodedValue &= 0xEFFFFFFF;
480 EncodedValue |= Bit28;
481 EncodedValue |= 0x0F000000;
490unsigned ARMMCCodeEmitter::NEONThumb2LoadStorePostEncoder(
const MCInst &
MI,
491 unsigned EncodedValue,
494 EncodedValue &= 0xF0FFFFFF;
495 EncodedValue |= 0x09000000;
504unsigned ARMMCCodeEmitter::NEONThumb2DupPostEncoder(
const MCInst &
MI,
505 unsigned EncodedValue,
508 EncodedValue &= 0x00FFFFFF;
509 EncodedValue |= 0xEE000000;
517unsigned ARMMCCodeEmitter::NEONThumb2V8PostEncoder(
const MCInst &
MI,
518 unsigned EncodedValue,
521 EncodedValue |= 0xC000000;
529unsigned ARMMCCodeEmitter::
530VFPThumb2PostEncoder(
const MCInst &
MI,
unsigned EncodedValue,
533 EncodedValue &= 0x0FFFFFFF;
534 EncodedValue |= 0xE0000000;
541unsigned ARMMCCodeEmitter::
561 case ARM::Q0:
case ARM::Q1:
case ARM::Q2:
case ARM::Q3:
562 case ARM::Q4:
case ARM::Q5:
case ARM::Q6:
case ARM::Q7:
563 case ARM::Q8:
case ARM::Q9:
case ARM::Q10:
case ARM::Q11:
564 case ARM::Q12:
case ARM::Q13:
case ARM::Q14:
case ARM::Q15:
567 }
else if (MO.
isImm()) {
568 return static_cast<unsigned>(MO.
getImm());
580bool ARMMCCodeEmitter::
581EncodeAddrModeOpValues(
const MCInst &
MI,
unsigned OpIdx,
unsigned &Reg,
589 int32_t SImm = MO1.
getImm();
593 if (SImm == INT32_MIN) {
618 assert(MO.
isExpr() &&
"Unexpected branch target type!");
631 uint32_t S = (offset & 0x800000) >> 23;
632 uint32_t J1 = (offset & 0x400000) >> 22;
633 uint32_t J2 = (offset & 0x200000) >> 21;
648getThumbBLTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
661getThumbBLXTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
673getThumbBRTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
680 return (MO.
getImm() >> 1);
685getThumbBCCTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
692 return (MO.
getImm() >> 1);
697getThumbCBTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
703 return (MO.
getImm() >> 1);
708 int NumOp =
MI.getNumOperands();
710 for (
int i = 0; i < NumOp-1; ++i) {
726getBranchTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
734 return getARMBranchTargetOpValue(
MI, OpIdx, Fixups, STI);
740getARMBranchTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
746 return ::getBranchTargetOpValue(
MI, OpIdx,
748 return ::getBranchTargetOpValue(
MI, OpIdx,
756getARMBLTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
762 return ::getBranchTargetOpValue(
MI, OpIdx,
771getARMBLXTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
783uint32_t ARMMCCodeEmitter::getThumbBranchTargetOpValue(
794 bool I = (Val & 0x800000);
795 bool J1 = (Val & 0x400000);
796 bool J2 = (Val & 0x200000);
813getAdrLabelOpValue(
const MCInst &
MI,
unsigned OpIdx,
820 int64_t offset = MO.
getImm();
824 if (offset == INT32_MIN) {
827 }
else if (offset < 0) {
845 assert(SoImmVal != -1 &&
"Not a valid so_imm value!");
854getT2AdrLabelOpValue(
const MCInst &
MI,
unsigned OpIdx,
861 int32_t Val = MO.
getImm();
862 if (Val == INT32_MIN)
874getITMaskOpValue(
const MCInst &
MI,
unsigned OpIdx,
878 assert(MaskMO.
isImm() &&
"Unexpected operand type!");
886 assert(OpIdx > 0 &&
"IT mask appears first!");
888 assert(CondMO.
isImm() &&
"Unexpected operand type!");
889 if (CondMO.
getImm() & 1) {
891 unsigned BitsAboveLowBit = 0xF & (-LowBit << 1);
892 Mask ^= BitsAboveLowBit;
901getThumbAdrLabelOpValue(
const MCInst &
MI,
unsigned OpIdx,
914getThumbAddrModeRegRegOpValue(
const MCInst &
MI,
unsigned OpIdx,
924 return (Rm << 3) | Rn;
930ARMMCCodeEmitter::getMVEShiftImmOpValue(
const MCInst &
MI,
unsigned OpIdx,
941 unsigned Size, ShiftImm;
942 switch(
MI.getOpcode()) {
943 case ARM::MVE_VSHLL_imms16bh:
944 case ARM::MVE_VSHLL_imms16th:
945 case ARM::MVE_VSHLL_immu16bh:
946 case ARM::MVE_VSHLL_immu16th:
949 case ARM::MVE_VSHLL_imms8bh:
950 case ARM::MVE_VSHLL_imms8th:
951 case ARM::MVE_VSHLL_immu8bh:
952 case ARM::MVE_VSHLL_immu8th:
958 ShiftImm =
MI.getOperand(OpIdx).getImm();
959 return Size + ShiftImm;
964getAddrModeImm12OpValue(
const MCInst &
MI,
unsigned OpIdx,
970 unsigned Reg = 0, Imm12 = 0;
977 isAdd = EncodeAddrModeOpValues(
MI, OpIdx, Reg, Imm12, Fixups, STI);
978 }
else if (MO1.
isExpr()) {
980 "Thumb mode requires different encoding");
996 ++MCNumCPRelocations;
1000 if (
Offset == INT32_MIN) {
1017template<
unsigned Bits,
unsigned Shift>
1019getT2ScaledImmOpValue(
const MCInst &
MI,
unsigned OpIdx,
1031 int32_t
Imm =
MI.getOperand(OpIdx).getImm();
1032 bool isAdd =
Imm >= 0;
1050getMveAddrModeRQOpValue(
const MCInst &
MI,
unsigned OpIdx,
1061 assert(Qm < 8 &&
"Qm is supposed to be encodable in 3 bits");
1063 return (Rn << 3) | Qm;
1070getMveAddrModeQOpValue(
const MCInst &
MI,
unsigned OpIdx,
1079 int32_t
Imm =
M1.getImm();
1081 bool isAdd =
Imm >= 0;
1093 assert(Qm < 8 &&
"Qm is supposed to be encodable in 3 bits");
1095 return (Qm << 8) |
Imm;
1101getT2AddrModeImm8s4OpValue(
const MCInst &
MI,
unsigned OpIdx,
1116 assert(MO.
isExpr() &&
"Unexpected machine operand type!");
1121 ++MCNumCPRelocations;
1123 isAdd = EncodeAddrModeOpValues(
MI, OpIdx, Reg, Imm8, Fixups, STI);
1131 assert(((Imm8 & 0x3) == 0) &&
"Not a valid immediate!");
1143ARMMCCodeEmitter::getT2AddrModeImm7s4OpValue(
const MCInst &
MI,
unsigned OpIdx,
1151 bool isAdd = EncodeAddrModeOpValues(
MI, OpIdx, Reg, Imm7, Fixups, STI);
1170getT2AddrModeImm0_1020s4OpValue(
const MCInst &
MI,
unsigned OpIdx,
1179 return (Reg << 8) |
Imm8;
1182uint32_t ARMMCCodeEmitter::getHiLoImmOpValue(
const MCInst &
MI,
unsigned OpIdx,
1190 return static_cast<unsigned>(MO.
getImm());
1197 const ARMMCExpr *ARM16Expr = cast<ARMMCExpr>(E);
1201 const int64_t
Value = MCE->getValue();
1202 if (
Value > UINT32_MAX)
1205 switch (ARM16Expr->
getKind()) {
1207 return (int32_t(
Value) & 0xffff0000) >> 16;
1209 return (int32_t(
Value) & 0x0000ffff);
1212 return (int32_t(
Value) & 0xff000000) >> 24;
1214 return (int32_t(
Value) & 0x00ff0000) >> 16;
1216 return (int32_t(
Value) & 0x0000ff00) >> 8;
1218 return (int32_t(
Value) & 0x000000ff);
1224 switch (ARM16Expr->
getKind()) {
1266 ":upper0_7:, lower8_15: or :lower0_7:");
1270getLdStSORegOpValue(
const MCInst &
MI,
unsigned OpIdx,
1281 unsigned SBits = getShiftOp(ShOp);
1285 assert((ShImm & ~0x1f) == 0 &&
"Out of range shift amount");
1304getAddrMode2OffsetOpValue(
const MCInst &
MI,
unsigned OpIdx,
1320 Binary |= getShiftOp(ShOp) << 5;
1327getPostIdxRegOpValue(
const MCInst &
MI,
unsigned OpIdx,
1334 bool isAdd = MO1.
getImm() != 0;
1339getAddrMode3OffsetOpValue(
const MCInst &
MI,
unsigned OpIdx,
1355 return Imm8 | (isAdd << 8) | (
isImm << 9);
1359getAddrMode3OpValue(
const MCInst &
MI,
unsigned OpIdx,
1375 assert(MO.
isExpr() &&
"Unexpected machine operand type!");
1380 ++MCNumCPRelocations;
1381 return (Rn << 9) | (1 << 13);
1391 return (Rn << 9) |
Imm8 | (isAdd << 8) | (
isImm << 13);
1396getAddrModeThumbSPOpValue(
const MCInst &
MI,
unsigned OpIdx,
1402 assert(
MI.getOperand(OpIdx).getReg() == ARM::SP &&
1403 "Unexpected base register!");
1407 return MO1.
getImm() & 0xff;
1412getAddrModeISOpValue(
const MCInst &
MI,
unsigned OpIdx,
1421 unsigned Imm5 = MO1.
getImm();
1422 return ((Imm5 & 0x1f) << 3) | Rn;
1427getAddrModePCOpValue(
const MCInst &
MI,
unsigned OpIdx,
1433 return (MO.
getImm() >> 2);
1438getAddrMode5OpValue(
const MCInst &
MI,
unsigned OpIdx,
1453 assert(MO.
isExpr() &&
"Unexpected machine operand type!");
1462 ++MCNumCPRelocations;
1464 EncodeAddrModeOpValues(
MI, OpIdx, Reg, Imm8, Fixups, STI);
1478getAddrMode5FP16OpValue(
const MCInst &
MI,
unsigned OpIdx,
1493 assert(MO.
isExpr() &&
"Unexpected machine operand type!");
1502 ++MCNumCPRelocations;
1504 EncodeAddrModeOpValues(
MI, OpIdx, Reg, Imm8, Fixups, STI);
1516unsigned ARMMCCodeEmitter::
1517getSORegRegOpValue(
const MCInst &
MI,
unsigned OpIdx,
1540 unsigned Rs = MO1.
getReg();
1564unsigned ARMMCCodeEmitter::
1565getSORegImmOpValue(
const MCInst &
MI,
unsigned OpIdx,
1606 assert(
Offset < 32 &&
"Offset must be in range 0-31!");
1611unsigned ARMMCCodeEmitter::
1612getT2AddrModeSORegOpValue(
const MCInst &
MI,
unsigned OpNum,
1630template<
unsigned Bits,
unsigned Shift>
1631unsigned ARMMCCodeEmitter::
1632getT2AddrModeImmOpValue(
const MCInst &
MI,
unsigned OpNum,
1644 int32_t tmp = (int32_t)MO2.
getImm();
1645 if (tmp == INT32_MIN) {
1647 }
else if (tmp < 0) {
1652 Value |= (tmp >> Shift) & ((1U << Bits) - 1);
1656unsigned ARMMCCodeEmitter::
1657getT2AddrModeImm8OffsetOpValue(
const MCInst &
MI,
unsigned OpNum,
1665 if (
static_cast<int32_t
>(tmp) < 0)
1673unsigned ARMMCCodeEmitter::
1674getT2SORegOpValue(
const MCInst &
MI,
unsigned OpIdx,
1716unsigned ARMMCCodeEmitter::
1717getBitfieldInvertedMaskOpValue(
const MCInst &
MI,
unsigned Op,
1726 assert(v != 0 && lsb < 32 && msb < 32 &&
"Illegal bitfield mask!");
1727 return lsb | (msb << 5);
1730unsigned ARMMCCodeEmitter::
1731getRegisterListOpValue(
const MCInst &
MI,
unsigned Op,
1740 unsigned Reg =
MI.getOperand(
Op).getReg();
1741 bool SPRRegs = ARMMCRegisterClasses[ARM::SPRRegClassID].contains(Reg);
1742 bool DPRRegs = ARMMCRegisterClasses[ARM::DPRRegClassID].contains(Reg);
1746 if (SPRRegs || DPRRegs) {
1749 unsigned NumRegs = (
MI.getNumOperands() -
Op) & 0xff;
1750 Binary |= (RegNo & 0x1f) << 8;
1753 if (
MI.getOpcode() == ARM::VSCCLRMD ||
MI.getOpcode() == ARM::VSCCLRMS)
1763 return MRI.getEncodingValue(
LHS.getReg()) <
1764 MRI.getEncodingValue(
RHS.getReg());
1766 for (
unsigned I =
Op, E =
MI.getNumOperands();
I < E; ++
I) {
1767 unsigned RegNo =
MRI.getEncodingValue(
MI.getOperand(
I).getReg());
1777unsigned ARMMCCodeEmitter::
1778getAddrMode6AddressOpValue(
const MCInst &
MI,
unsigned Op,
1787 switch (
Imm.getImm()) {
1791 case 8:
Align = 0x01;
break;
1792 case 16:
Align = 0x02;
break;
1793 case 32:
Align = 0x03;
break;
1796 return RegNo | (
Align << 4);
1801unsigned ARMMCCodeEmitter::
1802getAddrMode6OneLane32AddressOpValue(
const MCInst &
MI,
unsigned Op,
1811 switch (
Imm.getImm()) {
1816 case 2:
Align = 0x00;
break;
1817 case 4:
Align = 0x03;
break;
1820 return RegNo | (
Align << 4);
1828unsigned ARMMCCodeEmitter::
1829getAddrMode6DupAddressOpValue(
const MCInst &
MI,
unsigned Op,
1838 switch (
Imm.getImm()) {
1842 case 8:
Align = 0x01;
break;
1843 case 16:
Align = 0x03;
break;
1846 return RegNo | (
Align << 4);
1849unsigned ARMMCCodeEmitter::
1850getAddrMode6OffsetOpValue(
const MCInst &
MI,
unsigned Op,
1854 if (MO.
getReg() == 0)
return 0x0D;
1858unsigned ARMMCCodeEmitter::
1859getShiftRight8Imm(
const MCInst &
MI,
unsigned Op,
1862 return 8 -
MI.getOperand(
Op).getImm();
1865unsigned ARMMCCodeEmitter::
1866getShiftRight16Imm(
const MCInst &
MI,
unsigned Op,
1869 return 16 -
MI.getOperand(
Op).getImm();
1872unsigned ARMMCCodeEmitter::
1873getShiftRight32Imm(
const MCInst &
MI,
unsigned Op,
1876 return 32 -
MI.getOperand(
Op).getImm();
1879unsigned ARMMCCodeEmitter::
1880getShiftRight64Imm(
const MCInst &
MI,
unsigned Op,
1883 return 64 -
MI.getOperand(
Op).getImm();
1886void ARMMCCodeEmitter::encodeInstruction(
const MCInst &
MI,
1897 if (
Desc.getSize() == 2 ||
Desc.getSize() == 4)
1906 support::endian::write<uint16_t>(CB, Binary, Endian);
1910 support::endian::write<uint16_t>(CB, Binary >> 16, Endian);
1911 support::endian::write<uint16_t>(CB, Binary & 0xffff, Endian);
1913 support::endian::write<uint32_t>(CB, Binary, Endian);
1918template <
bool isNeg, ARM::Fixups fixup>
1920ARMMCCodeEmitter::getBFTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
1925 return ::getBranchTargetOpValue(
MI, OpIdx, fixup, Fixups, STI);
1930ARMMCCodeEmitter::getBFAfterTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
1947 assert(Diff == 4 || Diff == 2);
1952uint32_t ARMMCCodeEmitter::getVPTMaskOpValue(
const MCInst &
MI,
unsigned OpIdx,
1963 unsigned PrevBit = 0;
1964 for (
int i = 3; i >= 0; --i) {
1968 if ((
Value & ~(~0U << i)) == 0) {
1983uint32_t ARMMCCodeEmitter::getRestrictedCondCodeOpValue(
1992 assert(0 &&
"Unexpected Condition!");
2012getPowerTwoOpValue(
const MCInst &
MI,
unsigned OpIdx,
2020template <
unsigned start>
2022getMVEPairVectorIndexOpValue(
const MCInst &
MI,
unsigned OpIdx,
2029 return Value - start;
2032#include "ARMGenMCCodeEmitter.inc"
2036 return new ARMMCCodeEmitter(MCII, Ctx,
true);
2041 return new ARMMCCodeEmitter(MCII, Ctx,
false);
unsigned const MachineRegisterInfo * MRI
This file declares a class to represent arbitrary precision floating point values and provide a varie...
This file implements a class to represent arbitrary precision integral constant values and operations...
static bool isThumb(const MCSubtargetInfo &STI)
static bool HasConditionalBranch(const MCInst &MI)
Return true if this branch has a non-always predication.
static int32_t encodeThumbBLOffset(int32_t offset)
static uint32_t getBranchTargetOpValue(const MCInst &MI, unsigned OpIdx, unsigned FixupKind, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI)
getBranchTargetOpValue - Helper function to get the branch target operand, which is either an immedia...
static bool isNeg(Value *V)
Returns true if the operation is a negation of V, and it works for both integers and floats.
static bool isReg(const MCInst &MI, unsigned OpNo)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool isImm(const MachineOperand &MO, MachineRegisterInfo *MRI)
This file defines the SmallVector class.
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
APInt bitcastToAPInt() const
APInt getHiBits(unsigned numBits) const
Compute an APInt containing numBits highbits from this APInt.
uint64_t getLimitedValue(uint64_t Limit=UINT64_MAX) const
If this value is smaller than the specified limit, return it, otherwise return the limit value.
VariantKind getKind() const
getOpcode - Get the kind of this expression.
const MCExpr * getSubExpr() const
getSubExpr - Get the child of this expression.
This class represents an Operation in the Expression.
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
MCCodeEmitter - Generic instruction encoding interface.
virtual void encodeInstruction(const MCInst &Inst, SmallVectorImpl< char > &CB, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const =0
Encode the given Inst to bytes and append to CB.
MCCodeEmitter & operator=(const MCCodeEmitter &)=delete
Context object for machine code objects.
const MCRegisterInfo * getRegisterInfo() const
Base class for the full range of assembler expressions which are needed for parsing.
@ Target
Target specific expression.
static MCFixup create(uint32_t Offset, const MCExpr *Value, MCFixupKind Kind, SMLoc Loc=SMLoc())
Instances of this class represent a single low-level machine instruction.
Describe properties that are true of each instruction in the target description file.
Interface to description of machine instruction set.
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode.
Instances of this class represent operands of the MCInst class.
unsigned getReg() const
Returns the register number.
const MCExpr * getExpr() const
uint64_t getDFPImm() const
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
uint16_t getEncodingValue(MCRegister RegNo) const
Returns the encoding for RegNo.
Generic base class for all target subtargets.
bool hasFeature(unsigned Feature) const
const Triple & getTargetTriple() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Triple - Helper class for working with autoconf configuration names.
LLVM Value Representation.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned char getAM3Offset(unsigned AM3Opc)
unsigned getSORegOffset(unsigned Op)
int getSOImmVal(unsigned Arg)
getSOImmVal - Given a 32-bit immediate, if it is something that can fit into an shifter_operand immed...
ShiftOpc getAM2ShiftOpc(unsigned AM2Opc)
unsigned getAM2Offset(unsigned AM2Opc)
int getT2SOImmVal(unsigned Arg)
getT2SOImmVal - Given a 32-bit immediate, if it is something that can fit into a Thumb-2 shifter_oper...
ShiftOpc getSORegShOp(unsigned Op)
AddrOpc getAM5Op(unsigned AM5Opc)
unsigned char getAM5Offset(unsigned AM5Opc)
AddrOpc getAM2Op(unsigned AM2Opc)
AddrOpc getAM3Op(unsigned AM3Opc)
@ fixup_thumb_adr_pcrel_10
@ fixup_arm_thumb_upper_8_15
@ fixup_arm_thumb_lower_0_7
@ fixup_arm_pcrel_10_unscaled
@ fixup_arm_thumb_upper_0_7
@ fixup_bfcsel_else_target
@ fixup_arm_ldst_pcrel_12
@ fixup_arm_thumb_lower_8_15
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
Reg
All possible values of the reg field in the ModR/M byte.
This is an optimization pass for GlobalISel generic memory operations.
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
APFloat abs(APFloat X)
Returns the absolute value of the argument.
MCCodeEmitter * createARMLEMCCodeEmitter(const MCInstrInfo &MCII, MCContext &Ctx)
int countr_zero(T Val)
Count number of 0's from the least significant bit to the most stopping at the first 1.
unsigned M1(unsigned Val)
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
MCFixupKind
Extensible enumeration to represent the type of a fixup.
bool is_sorted(R &&Range, Compare C)
Wrapper function around std::is_sorted to check if elements in a range R are sorted with respect to a...
DWARFExpression::Operation Op
unsigned M0(unsigned Val)
MCCodeEmitter * createARMBEMCCodeEmitter(const MCInstrInfo &MCII, MCContext &Ctx)
This struct is a compact representation of a valid (non-zero power of two) alignment.
Description of the encoding of one expression Op.