39 class X86AlignBranchKind {
41 uint8_t AlignBranchKind = 0;
44 void operator=(
const std::string &Val) {
64 "'-x86-align-branch 'The branches's type is combination of jcc, " 65 "fused, jmp, call, ret, indirect.(plus separated)",
71 operator uint8_t()
const {
return AlignBranchKind; }
75 X86AlignBranchKind X86AlignBranchKindLoc;
78 "x86-align-branch-boundary",
cl::init(0),
80 "Control how the assembler should align branches with NOP. If the " 81 "boundary's size is not 0, it should be a power of 2 and no less " 82 "than 32. Branches will be aligned to prevent from being across or " 83 "against the boundary of specified size. The default value 0 does not " 89 "Specify types of branches to align. The branches's types are " 90 "combination of jcc, fused, jmp, call, ret, indirect. jcc indicates " 91 "conditional jumps, fused indicates fused conditional jumps, jmp " 92 "indicates unconditional jumps, call indicates direct and indirect " 93 "calls, ret indicates rets, indirect indicates indirect jumps."),
98 "x86-branches-within-32B-boundaries",
cl::init(
false),
100 "Align selected instructions to mitigate negative performance impact " 101 "of Intel's micro code update for errata skx102. May break " 102 "assumptions about labels corresponding to particular instructions, " 103 "and should be used with caution."));
108 bool HasRelocationAddend,
bool foobar)
114 std::unique_ptr<const MCInstrInfo> MCII;
115 X86AlignBranchKind AlignBranchType;
121 bool needAlignInst(
const MCInst &Inst)
const;
130 if (X86AlignBranchWithin32BBoundaries) {
141 if (X86AlignBranchBoundary.getNumOccurrences())
143 if (X86AlignBranch.getNumOccurrences())
144 AlignBranchType = X86AlignBranchKindLoc;
147 bool allowAutoPadding()
const override;
151 unsigned getNumFixupKinds()
const override {
164 uint64_t
Value,
bool IsResolved,
167 bool mayNeedRelaxation(
const MCInst &Inst,
170 bool fixupNeedsRelaxation(
const MCFixup &Fixup, uint64_t
Value,
175 MCInst &Res)
const override;
177 bool writeNopData(
raw_ostream &OS, uint64_t Count)
const override;
187 return (is16BitMode) ? X86::JCC_2 : X86::JCC_4;
189 return (is16BitMode) ? X86::JMP_2 : X86::JMP_4;
200 case X86::IMUL16rri8:
return X86::IMUL16rri;
201 case X86::IMUL16rmi8:
return X86::IMUL16rmi;
202 case X86::IMUL32rri8:
return X86::IMUL32rri;
203 case X86::IMUL32rmi8:
return X86::IMUL32rmi;
204 case X86::IMUL64rri8:
return X86::IMUL64rri32;
205 case X86::IMUL64rmi8:
return X86::IMUL64rmi32;
208 case X86::AND16ri8:
return X86::AND16ri;
209 case X86::AND16mi8:
return X86::AND16mi;
210 case X86::AND32ri8:
return X86::AND32ri;
211 case X86::AND32mi8:
return X86::AND32mi;
212 case X86::AND64ri8:
return X86::AND64ri32;
213 case X86::AND64mi8:
return X86::AND64mi32;
216 case X86::OR16ri8:
return X86::OR16ri;
217 case X86::OR16mi8:
return X86::OR16mi;
218 case X86::OR32ri8:
return X86::OR32ri;
219 case X86::OR32mi8:
return X86::OR32mi;
220 case X86::OR64ri8:
return X86::OR64ri32;
221 case X86::OR64mi8:
return X86::OR64mi32;
224 case X86::XOR16ri8:
return X86::XOR16ri;
225 case X86::XOR16mi8:
return X86::XOR16mi;
226 case X86::XOR32ri8:
return X86::XOR32ri;
227 case X86::XOR32mi8:
return X86::XOR32mi;
228 case X86::XOR64ri8:
return X86::XOR64ri32;
229 case X86::XOR64mi8:
return X86::XOR64mi32;
232 case X86::ADD16ri8:
return X86::ADD16ri;
233 case X86::ADD16mi8:
return X86::ADD16mi;
234 case X86::ADD32ri8:
return X86::ADD32ri;
235 case X86::ADD32mi8:
return X86::ADD32mi;
236 case X86::ADD64ri8:
return X86::ADD64ri32;
237 case X86::ADD64mi8:
return X86::ADD64mi32;
240 case X86::ADC16ri8:
return X86::ADC16ri;
241 case X86::ADC16mi8:
return X86::ADC16mi;
242 case X86::ADC32ri8:
return X86::ADC32ri;
243 case X86::ADC32mi8:
return X86::ADC32mi;
244 case X86::ADC64ri8:
return X86::ADC64ri32;
245 case X86::ADC64mi8:
return X86::ADC64mi32;
248 case X86::SUB16ri8:
return X86::SUB16ri;
249 case X86::SUB16mi8:
return X86::SUB16mi;
250 case X86::SUB32ri8:
return X86::SUB32ri;
251 case X86::SUB32mi8:
return X86::SUB32mi;
252 case X86::SUB64ri8:
return X86::SUB64ri32;
253 case X86::SUB64mi8:
return X86::SUB64mi32;
256 case X86::SBB16ri8:
return X86::SBB16ri;
257 case X86::SBB16mi8:
return X86::SBB16mi;
258 case X86::SBB32ri8:
return X86::SBB32ri;
259 case X86::SBB32mi8:
return X86::SBB32mi;
260 case X86::SBB64ri8:
return X86::SBB64ri32;
261 case X86::SBB64mi8:
return X86::SBB64mi32;
264 case X86::CMP16ri8:
return X86::CMP16ri;
265 case X86::CMP16mi8:
return X86::CMP16mi;
266 case X86::CMP32ri8:
return X86::CMP32ri;
267 case X86::CMP32mi8:
return X86::CMP32mi;
268 case X86::CMP64ri8:
return X86::CMP64ri32;
269 case X86::CMP64mi8:
return X86::CMP64mi32;
272 case X86::PUSH32i8:
return X86::PUSHi32;
273 case X86::PUSH16i8:
return X86::PUSHi16;
274 case X86::PUSH64i8:
return X86::PUSH64i32;
309 uint64_t TSFlags = Desc.
TSFlags;
312 if (MemoryOperand < 0)
316 return (BaseReg == X86::RIP);
346 for (
auto &Operand : MI) {
347 if (!Operand.isExpr())
349 const MCExpr &Expr = *Operand.getExpr();
357 bool X86AsmBackend::allowAutoPadding()
const {
365 assert(allowAutoPadding() &&
"incorrect initialization!");
382 bool X86AsmBackend::needAlignInst(
const MCInst &Inst)
const {
406 X86AsmBackend::getOrCreateBoundaryAlignFragment(
MCObjectStreamer &OS)
const {
423 if (NeedAlignFused &&
isMacroFused(PrevInst, Inst) && CF) {
428 dyn_cast_or_null<MCBoundaryAlignFragment>(CF->
getPrevNode())) {
432 }
else if (needAlignInst(Inst)) {
444 auto *
F = getOrCreateBoundaryAlignFragment(OS);
445 F->setEmitNops(
true);
450 getOrCreateBoundaryAlignFragment(OS);
482 if (Name ==
"R_X86_64_NONE")
485 if (Name ==
"R_386_NONE")
498 {
"reloc_signed_4byte", 0, 32, 0},
499 {
"reloc_signed_4byte_relax", 0, 32, 0},
500 {
"reloc_global_offset_table", 0, 32, 0},
501 {
"reloc_global_offset_table8", 0, 64, 0},
514 bool X86AsmBackend::shouldForceRelocation(
const MCAssembler &,
557 uint64_t
Value,
bool IsResolved,
563 int64_t SignedValue =
static_cast<int64_t
>(
Value);
565 getFixupKindInfo(Fixup.
getKind()).Flags &
568 if (Size > 0 && !
isIntN(Size * 8, SignedValue))
571 " is too large for field of " +
Twine(Size) +
572 ((Size == 1) ?
" byte." :
" bytes."));
578 assert((Size == 0 ||
isIntN(Size * 8 + 1, SignedValue)) &&
579 "Value does not fit in the Fixup field");
582 for (
unsigned i = 0; i !=
Size; ++i)
583 Data[Fixup.
getOffset() + i] = uint8_t(Value >> (i * 8));
586 bool X86AsmBackend::mayNeedRelaxation(
const MCInst &Inst,
606 bool X86AsmBackend::fixupNeedsRelaxation(
const MCFixup &Fixup,
616 void X86AsmBackend::relaxInstruction(
const MCInst &Inst,
638 bool X86AsmBackend::writeNopData(
raw_ostream &OS, uint64_t Count)
const {
639 static const char Nops[10][11] = {
649 "\x0f\x1f\x44\x00\x00",
651 "\x66\x0f\x1f\x44\x00\x00",
653 "\x0f\x1f\x80\x00\x00\x00\x00",
655 "\x0f\x1f\x84\x00\x00\x00\x00\x00",
657 "\x66\x0f\x1f\x84\x00\x00\x00\x00\x00",
659 "\x66\x2e\x0f\x1f\x84\x00\x00\x00\x00\x00",
665 for (uint64_t i = 0; i < Count; ++i)
672 uint64_t MaxNopLength = 10;
683 const uint8_t ThisNopLength = (uint8_t) std::min(Count, MaxNopLength);
684 const uint8_t Prefixes = ThisNopLength <= 10 ? 0 : ThisNopLength - 10;
685 for (uint8_t i = 0; i < Prefixes; i++)
687 const uint8_t Rest = ThisNopLength - Prefixes;
689 OS.
write(Nops[Rest - 1], Rest);
690 Count -= ThisNopLength;
691 }
while (Count != 0);
700 class ELFX86AsmBackend :
public X86AsmBackend {
703 ELFX86AsmBackend(
const Target &T, uint8_t OSABI,
const MCSubtargetInfo &STI)
704 : X86AsmBackend(T, STI), OSABI(OSABI) {}
707 class ELFX86_32AsmBackend :
public ELFX86AsmBackend {
709 ELFX86_32AsmBackend(
const Target &T, uint8_t OSABI,
711 : ELFX86AsmBackend(T, OSABI, STI) {}
713 std::unique_ptr<MCObjectTargetWriter>
714 createObjectTargetWriter()
const override {
719 class ELFX86_X32AsmBackend :
public ELFX86AsmBackend {
721 ELFX86_X32AsmBackend(
const Target &T, uint8_t OSABI,
723 : ELFX86AsmBackend(T, OSABI, STI) {}
725 std::unique_ptr<MCObjectTargetWriter>
726 createObjectTargetWriter()
const override {
732 class ELFX86_IAMCUAsmBackend :
public ELFX86AsmBackend {
734 ELFX86_IAMCUAsmBackend(
const Target &T, uint8_t OSABI,
736 : ELFX86AsmBackend(T, OSABI, STI) {}
738 std::unique_ptr<MCObjectTargetWriter>
739 createObjectTargetWriter()
const override {
745 class ELFX86_64AsmBackend :
public ELFX86AsmBackend {
747 ELFX86_64AsmBackend(
const Target &T, uint8_t OSABI,
749 : ELFX86AsmBackend(T, OSABI, STI) {}
751 std::unique_ptr<MCObjectTargetWriter>
752 createObjectTargetWriter()
const override {
757 class WindowsX86AsmBackend :
public X86AsmBackend {
761 WindowsX86AsmBackend(
const Target &T,
bool is64Bit,
763 : X86AsmBackend(T, STI)
775 std::unique_ptr<MCObjectTargetWriter>
776 createObjectTargetWriter()
const override {
787 UNWIND_MODE_BP_FRAME = 0x01000000,
790 UNWIND_MODE_STACK_IMMD = 0x02000000,
793 UNWIND_MODE_STACK_IND = 0x03000000,
796 UNWIND_MODE_DWARF = 0x04000000,
799 UNWIND_BP_FRAME_REGISTERS = 0x00007FFF,
802 UNWIND_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF
807 class DarwinX86AsmBackend :
public X86AsmBackend {
811 enum { CU_NUM_SAVED_REGS = 6 };
813 mutable unsigned SavedRegs[CU_NUM_SAVED_REGS];
817 unsigned MoveInstrSize;
818 unsigned StackDivide;
821 unsigned PushInstrSize(
unsigned Reg)
const {
845 if (Instrs.
empty())
return 0;
848 unsigned SavedRegIdx = 0;
849 memset(SavedRegs, 0,
sizeof(SavedRegs));
856 unsigned SubtractInstrIdx = Is64Bit ? 3 : 2;
857 unsigned InstrOffset = 0;
858 unsigned StackAdjust = 0;
859 unsigned StackSize = 0;
860 unsigned NumDefCFAOffsets = 0;
862 for (
unsigned i = 0,
e = Instrs.
size(); i !=
e; ++i) {
882 (Is64Bit ? X86::RBP : X86::EBP))
886 memset(SavedRegs, 0,
sizeof(SavedRegs));
889 InstrOffset += MoveInstrSize;
924 if (SavedRegIdx == CU_NUM_SAVED_REGS)
927 return CU::UNWIND_MODE_DWARF;
930 SavedRegs[SavedRegIdx++] =
Reg;
931 StackAdjust += OffsetSize;
932 InstrOffset += PushInstrSize(Reg);
938 StackAdjust /= StackDivide;
941 if ((StackAdjust & 0xFF) != StackAdjust)
943 return CU::UNWIND_MODE_DWARF;
946 uint32_t RegEnc = encodeCompactUnwindRegistersWithFrame();
947 if (RegEnc == ~0U)
return CU::UNWIND_MODE_DWARF;
949 CompactUnwindEncoding |= CU::UNWIND_MODE_BP_FRAME;
950 CompactUnwindEncoding |= (StackAdjust & 0xFF) << 16;
951 CompactUnwindEncoding |= RegEnc & CU::UNWIND_BP_FRAME_REGISTERS;
953 SubtractInstrIdx += InstrOffset;
956 if ((StackSize & 0xFF) == StackSize) {
958 CompactUnwindEncoding |= CU::UNWIND_MODE_STACK_IMMD;
961 CompactUnwindEncoding |= (StackSize & 0xFF) << 16;
963 if ((StackAdjust & 0x7) != StackAdjust)
965 return CU::UNWIND_MODE_DWARF;
968 CompactUnwindEncoding |= CU::UNWIND_MODE_STACK_IND;
972 CompactUnwindEncoding |= (SubtractInstrIdx & 0xFF) << 16;
975 CompactUnwindEncoding |= (StackAdjust & 0x7) << 13;
980 CompactUnwindEncoding |= (SavedRegIdx & 0x7) << 10;
984 uint32_t RegEnc = encodeCompactUnwindRegistersWithoutFrame(SavedRegIdx);
985 if (RegEnc == ~0U)
return CU::UNWIND_MODE_DWARF;
988 CompactUnwindEncoding |=
989 RegEnc & CU::UNWIND_FRAMELESS_STACK_REG_PERMUTATION;
992 return CompactUnwindEncoding;
998 int getCompactUnwindRegNum(
unsigned Reg)
const {
999 static const MCPhysReg CU32BitRegs[7] = {
1002 static const MCPhysReg CU64BitRegs[] = {
1003 X86::RBX, X86::R12, X86::R13, X86::R14, X86::R15, X86::RBP, 0
1005 const MCPhysReg *CURegs = Is64Bit ? CU64BitRegs : CU32BitRegs;
1006 for (
int Idx = 1; *CURegs; ++CURegs, ++Idx)
1015 uint32_t encodeCompactUnwindRegistersWithFrame()
const {
1020 for (
int i = 0, Idx = 0; i != CU_NUM_SAVED_REGS; ++i) {
1021 unsigned Reg = SavedRegs[i];
1022 if (Reg == 0)
break;
1024 int CURegNum = getCompactUnwindRegNum(Reg);
1025 if (CURegNum == -1)
return ~0U;
1029 RegEnc |= (CURegNum & 0x7) << (Idx++ * 3);
1032 assert((RegEnc & 0x3FFFF) == RegEnc &&
1033 "Invalid compact register encoding!");
1040 uint32_t encodeCompactUnwindRegistersWithoutFrame(
unsigned RegCount)
const {
1054 for (
unsigned i = 0; i < RegCount; ++i) {
1055 int CUReg = getCompactUnwindRegNum(SavedRegs[i]);
1056 if (CUReg == -1)
return ~0U;
1057 SavedRegs[i] = CUReg;
1061 std::reverse(&SavedRegs[0], &SavedRegs[CU_NUM_SAVED_REGS]);
1063 uint32_t RenumRegs[CU_NUM_SAVED_REGS];
1064 for (
unsigned i = CU_NUM_SAVED_REGS - RegCount; i < CU_NUM_SAVED_REGS; ++i){
1065 unsigned Countless = 0;
1066 for (
unsigned j = CU_NUM_SAVED_REGS - RegCount; j < i; ++j)
1067 if (SavedRegs[j] < SavedRegs[i])
1070 RenumRegs[i] = SavedRegs[i] - Countless - 1;
1077 permutationEncoding |= 120 * RenumRegs[0] + 24 * RenumRegs[1]
1078 + 6 * RenumRegs[2] + 2 * RenumRegs[3]
1082 permutationEncoding |= 120 * RenumRegs[1] + 24 * RenumRegs[2]
1083 + 6 * RenumRegs[3] + 2 * RenumRegs[4]
1087 permutationEncoding |= 60 * RenumRegs[2] + 12 * RenumRegs[3]
1088 + 3 * RenumRegs[4] + RenumRegs[5];
1091 permutationEncoding |= 20 * RenumRegs[3] + 4 * RenumRegs[4]
1095 permutationEncoding |= 5 * RenumRegs[4] + RenumRegs[5];
1098 permutationEncoding |= RenumRegs[5];
1102 assert((permutationEncoding & 0x3FF) == permutationEncoding &&
1103 "Invalid compact register encoding!");
1104 return permutationEncoding;
1110 : X86AsmBackend(T, STI),
MRI(MRI), Is64Bit(Is64Bit) {
1111 memset(SavedRegs, 0,
sizeof(SavedRegs));
1112 OffsetSize = Is64Bit ? 8 : 4;
1113 MoveInstrSize = Is64Bit ? 3 : 2;
1114 StackDivide = Is64Bit ? 8 : 4;
1118 class DarwinX86_32AsmBackend :
public DarwinX86AsmBackend {
1122 : DarwinX86AsmBackend(T, MRI, STI,
false) {}
1124 std::unique_ptr<MCObjectTargetWriter>
1125 createObjectTargetWriter()
const override {
1132 uint32_t generateCompactUnwindEncoding(
1134 return generateCompactUnwindEncodingImpl(Instrs);
1138 class DarwinX86_64AsmBackend :
public DarwinX86AsmBackend {
1143 : DarwinX86AsmBackend(T, MRI, STI,
true), Subtype(st) {}
1145 std::unique_ptr<MCObjectTargetWriter>
1146 createObjectTargetWriter()
const override {
1152 uint32_t generateCompactUnwindEncoding(
1154 return generateCompactUnwindEncodingImpl(Instrs);
1166 return new DarwinX86_32AsmBackend(T, MRI, STI);
1169 return new WindowsX86AsmBackend(T,
false, STI);
1174 return new ELFX86_IAMCUAsmBackend(T, OSABI, STI);
1176 return new ELFX86_32AsmBackend(T, OSABI, STI);
1189 return new DarwinX86_64AsmBackend(T, MRI, STI, CS);
1193 return new WindowsX86AsmBackend(T,
true, STI);
1198 return new ELFX86_X32AsmBackend(T, OSABI, STI);
1199 return new ELFX86_64AsmBackend(T, OSABI, STI);
static MCInstrInfo * createMCInstrInfo()
Instances of this class represent a uniqued identifier for a section in the current translation unit...
A eight-byte pc relative fixup.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
This represents an "assembler immediate".
static unsigned getFixupKindSize(unsigned Kind)
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
SecondMacroFusionInstKind
OSType getOS() const
getOS - Get the parsed operating system type of this triple.
Describe properties that are true of each instruction in the target description file.
virtual const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.
void dump_pretty(raw_ostream &OS, const MCInstPrinter *Printer=nullptr, StringRef Separator=" ") const
Dump the MCInst as prettily as possible using the additional MC structures, if given.
std::unique_ptr< MCObjectTargetWriter > createX86MachObjectWriter(bool Is64Bit, uint32_t CPUType, uint32_t CPUSubtype)
Construct an X86 Mach-O object writer.
static bool canReuseBoundaryAlignFragment(const MCBoundaryAlignFragment &F)
SecondMacroFusionInstKind classifySecondCondCodeInMacroFusion(X86::CondCode CC)
constexpr bool isInt< 8 >(int64_t x)
bool isAbsolute() const
Is this an absolute (as opposed to relocatable) value.
A raw_ostream that writes to an SmallVector or SmallString.
bool isBundlingEnabled() const
static bool isRIPRelative(const MCInst &MI, const MCInstrInfo &MCII)
Check if the instruction uses RIP relative addressing.
StringSwitch & Case(StringLiteral S, T Value)
bool isReturn() const
Return true if the instruction is a return.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
const Triple & getTargetTriple() const
unsigned getAlignment() const
Is this fixup kind PCrelative? This is used by the assembler backend to evaluate fixup values in a ta...
A one-byte pc relative fixup.
bool getAllowAutoPadding() const
MCContext & getContext() const
static bool isFirstMacroFusibleInst(const MCInst &Inst, const MCInstrInfo &MCII)
Check if the instruction is valid as the first instruction in macro fusion.
MCAsmBackend * createX86_32AsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
unsigned getNumOperands() const
Return the number of declared MachineOperands for this MachineInstruction.
const FeatureBitset & getFeatureBits() const
Encapsulates the layout of an assembly file at a particular point in time.
Base class for the full range of assembler expressions which are needed for parsing.
LLVM_NODISCARD R Default(T Value)
AlignBranchBoundaryKind
Defines the possible values of the branch boundary alignment mask.
MCAsmBackend * createX86_64AsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
A four-byte section relative fixup.
unsigned getReg() const
Returns the register number.
auto reverse(ContainerTy &&C, typename std::enable_if< has_rbegin< ContainerTy >::value >::type *=nullptr) -> decltype(make_range(C.rbegin(), C.rend()))
A two-byte section relative fixup.
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Streaming object file generation interface.
CompactUnwindEncodings
Compact unwind encoding values.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
bool isBundleLocked() const
uint64_t value() const
This is a hole in the type system and should not be abused.
Instances of this class represent a single low-level machine instruction.
std::unique_ptr< MCObjectTargetWriter > createX86ELFObjectWriter(bool IsELF64, uint8_t OSABI, uint16_t EMachine)
Construct an X86 ELF object writer.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
std::unique_ptr< MCObjectTargetWriter > createX86WinCOFFObjectWriter(bool Is64Bit)
Construct an X86 Win COFF object writer.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Optional< unsigned > getLLVMRegNum(unsigned RegNum, bool isEH) const
Map a dwarf register back to a target register.
bool isOSWindows() const
Tests whether the OS is Windows.
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
A switch()-like statement whose cases are string literals.
initializer< Ty > init(const Ty &Val)
unsigned const MachineRegisterInfo * MRI
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
FirstMacroFusionInstKind classifyFirstOpcodeInMacroFusion(unsigned Opcode)
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
void insert(MCFragment *F)
size_t size() const
size - Get the array size.
bool isConditionalBranch() const
Return true if this is a branch which may fall through to the next instruction or may transfer contro...
MCAssembler & getAssembler()
Interface to description of machine instruction set.
MCFixupKind
Extensible enumeration to represent the type of a fixup.
void setAlignment(Align Value)
OpType getOperation() const
void reportError(SMLoc L, const Twine &Msg)
unsigned getOperandBias(const MCInstrDesc &Desc)
Compute whether all of the def operands are repeated in the uses and therefore should be skipped...
unsigned getNumOperands() const
uint32_t getOffset() const
bool isIndirectBranch() const
Return true if this is an indirect branch, such as a branch through a register.
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
static unsigned getRelaxedOpcodeArith(const MCInst &Inst)
bool isIntN(unsigned N, int64_t x)
Checks if an signed integer fits into the given (dynamic) bit width.
static constexpr const Align None()
Returns a default constructed Align which corresponds to no alignment.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Triple - Helper class for working with autoconf configuration names.
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
raw_ostream & write(unsigned char C)
PowerPC TLS Dynamic Call Fixup
unsigned getRegister() const
Represents required padding such that a particular other set of fragments does not cross a particular...
StringRef getArchName() const
getArchName - Get the architecture (first) component of the triple.
void setOpcode(unsigned Op)
A two-byte pc relative fixup.
A four-byte pc relative fixup.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
const MCOperand & getOperand(unsigned i) const
LLVM_NODISCARD std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
virtual Optional< MCFixupKind > getFixupKind(StringRef Name) const
Map a relocation name used in .reloc to a fixup kind.
EnvironmentType getEnvironment() const
getEnvironment - Get the parsed environment type of this triple.
StringRef str()
Return a StringRef for the vector contents.
static unsigned getRelaxedOpcodeBranch(const MCInst &Inst, bool is16BitMode)
Target - Wrapper for Target specific information.
MCSection * getCurrentSectionOnly() const
A one-byte section relative fixup.
static X86::SecondMacroFusionInstKind classifySecondInstInMacroFusion(const MCInst &MI, const MCInstrInfo &MCII)
bool isUnconditionalBranch() const
Return true if this is a branch which always transfers control flow to some other block...
static X86::CondCode getCondFromBranch(const MCInst &MI, const MCInstrInfo &MCII)
static unsigned getRelaxedOpcode(const MCInst &Inst, bool is16BitMode)
A eight-byte section relative fixup.
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
APFloat abs(APFloat X)
Returns the absolute value of the argument.
bool hasFeature(unsigned Feature) const
bool isCall() const
Return true if the instruction is a call.
Generic base class for all target subtargets.
References to labels and assigned expressions.
static bool hasVariantSymbol(const MCInst &MI)
Check if the instruction has a variant symbol operand.
Target independent information on a fixup kind.
MCFragment * getCurrentFragment() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isMacroFused(FirstMacroFusionInstKind FirstKind, SecondMacroFusionInstKind SecondKind)
LLVM Value Representation.
Generic interface to target specific assembler backends.
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
unsigned getOpcode() const
static bool is64Bit(const char *name)
LocationClass< Ty > location(Ty &L)
Align assumeAligned(uint64_t Value)
Treats the value 0 as a 1, so Align is always at least 1.
MCFixupKind getKind() const
bool empty() const
empty - Check if the array is empty.
int getMemoryOperandNo(uint64_t TSFlags)
The function returns the MCInst operand # for the first field of the memory operand.