26 static const char hex_rep[] =
"0123456789abcdef";
33 OS << hex_rep[(i & 0xF0) >> 4];
34 OS << hex_rep[i & 0xF];
53 (*CommentStream) << Annot;
56 if (Annot.back() !=
'\n')
57 (*CommentStream) <<
'\n';
67 bool &OrPredicateResult) {
85 bool Res = OrPredicateResult;
86 OrPredicateResult =
false;
98 return Opnd.
isImm() && Opnd.
getImm() == int32_t(
C.Value);
104 return Opnd.
isReg() && Opnd.
getReg() ==
MI.getOperand(
C.Value).getReg();
107 return Opnd.
isReg() &&
MRI.getRegClass(
C.Value).contains(Opnd.
getReg());
110 return M.ValidateMCOperand(Opnd, *STI,
C.Value);
131 return L.Opcode < Opcode;
133 if (It == M.OpToPatterns.end() || It->Opcode !=
MI->getOpcode())
139 M.Patterns.slice(It->PatternStart, It->NumPatterns);
142 if (
MI->getNumOperands() !=
P.NumOperands)
147 M.PatternConds.slice(
P.AliasCondStart,
P.NumConds);
149 bool OrPredicateResult =
false;
155 AsmStrOffset =
P.AsmStrOffset;
161 if (AsmStrOffset == ~0U)
167 assert(AsmStrOffset < M.AsmStrings.size() &&
168 (AsmStrOffset == 0 || M.AsmStrings[AsmStrOffset - 1] ==
'\0') &&
169 "bad asm string offset");
170 return M.AsmStrings.data() + AsmStrOffset;
188 return (digit >= 0xa);
202 if (
Value == std::numeric_limits<int64_t>::min())
203 return format<int64_t>(
"-0x8000000000000000",
Value);
209 if (
Value == std::numeric_limits<int64_t>::min())
210 return format<int64_t>(
"-8000000000000000h",
Value);
unsigned const MachineRegisterInfo * MRI
static bool needsLeadingZero(uint64_t Value)
static bool matchAliasCondition(const MCInst &MI, const MCSubtargetInfo *STI, const MCRegisterInfo &MRI, unsigned &OpIdx, const AliasMatchingData &M, const AliasPatternCond &C, bool &OrPredicateResult)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
constexpr bool test(unsigned I) const
StringRef getCommentString() const
format_object< int64_t > formatHex(int64_t Value) const
raw_ostream * CommentStream
A stream that comments can be emitted to if desired.
virtual void printRegName(raw_ostream &OS, MCRegister Reg) const
Print the assembler register name.
StringRef getOpcodeName(unsigned Opcode) const
Return the name of the specified opcode enum (e.g.
StringRef markup(StringRef s) const
Utility functions to make adding mark ups simpler.
format_object< int64_t > formatDec(int64_t Value) const
Utility functions to print decimal/hexadecimal values.
const MCRegisterInfo & MRI
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
bool getUseMarkup() const
const char * matchAliasPatterns(const MCInst *MI, const MCSubtargetInfo *STI, const AliasMatchingData &M)
Helper for matching MCInsts to alias patterns when printing instructions.
HexStyle::Style PrintHexStyle
Which style to use for printing hexadecimal values.
Instances of this class represent a single low-level machine instruction.
StringRef getName(unsigned Opcode) const
Returns the name for the instructions with the given opcode.
Instances of this class represent operands of the MCInst class.
unsigned getReg() const
Returns the register number.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Wrapper class representing physical registers. Should be passed by value.
Generic base class for all target subtargets.
const FeatureBitset & getFeatureBits() const
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
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.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
void dumpBytes(ArrayRef< uint8_t > Bytes, raw_ostream &OS)
Convert ‘Bytes’ to a hex string and output to ‘OS’.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
Tablegenerated data structures needed to match alias patterns.
Data for each alias pattern.
Map from opcode to pattern list by binary search.