25 static const char hex_rep[] =
"0123456789abcdef";
32 OS << hex_rep[(i & 0xF0) >> 4];
33 OS << hex_rep[i & 0xF];
52 (*CommentStream) << Annot;
55 if (Annot.back() !=
'\n')
118 M.
Patterns.slice(It->PatternStart, It->NumPatterns);
132 AsmStrOffset =
P.AsmStrOffset;
138 if (AsmStrOffset == ~0U)
145 (AsmStrOffset == 0 || M.
AsmStrings[AsmStrOffset - 1] ==
'\0') &&
146 "bad asm string offset");
163 uint64_t digit = (Value >> 60) & 0xf;
165 return (digit >= 0xa);
172 return format(
"%" PRId64, Value);
179 if (Value == std::numeric_limits<int64_t>::min())
180 return format<int64_t>(
"-0x8000000000000000",
Value);
181 return format(
"-0x%" PRIx64, -Value);
183 return format(
"0x%" PRIx64, Value);
186 if (Value == std::numeric_limits<int64_t>::min())
187 return format<int64_t>(
"-8000000000000000h",
Value);
189 return format(
"-0%" PRIx64
"h", -Value);
190 return format(
"-%" PRIx64
"h", -Value);
193 return format(
"0%" PRIx64
"h", Value);
194 return format(
"%" PRIx64
"h", Value);
202 return format(
"0x%" PRIx64, Value);
205 return format(
"0%" PRIx64
"h", Value);
207 return format(
"%" PRIx64
"h", Value);
auto lower_bound(R &&Range, T &&Value) -> decltype(adl_begin(Range))
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
Data for each alias pattern.
HexStyle::Style PrintHexStyle
Which style to use for printing hexadecimal values.
static bool needsLeadingZero(uint64_t Value)
This class represents lattice values for constants.
ArrayRef< AliasPattern > Patterns
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
virtual void printRegName(raw_ostream &OS, unsigned RegNo) const
Print the assembler register name.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly...
const FeatureBitset & getFeatureBits() const
Map from opcode to pattern list by binary search.
static bool matchAliasCondition(const MCInst &MI, const MCSubtargetInfo *STI, const MCRegisterInfo &MRI, unsigned &OpIdx, const AliasMatchingData &M, const AliasPatternCond &C)
format_object< int64_t > formatDec(int64_t Value) const
Utility functions to print decimal/hexadecimal values.
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
unsigned getReg() const
Returns the register number.
constexpr bool test(unsigned I) const
bool contains(MCRegister Reg) const
contains - Return true if the specified register is included in this register class.
LLVM_NODISCARD size_t size() const
size - Get the string size.
Instances of this class represent a single low-level machine instruction.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
ArrayRef< PatternsForOpcode > OpToPatterns
StringRef markup(StringRef s) const
Utility functions to make adding mark ups simpler.
Tablegenerated data structures needed to match alias patterns.
StringRef getCommentString() const
unsigned getNumOperands() const
StringRef getName(unsigned Opcode) const
Returns the name for the instructions with the given opcode.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
ArrayRef< AliasPatternCond > PatternConds
const MCOperand & getOperand(unsigned i) const
raw_ostream * CommentStream
A stream that comments can be emitted to if desired.
const char * matchAliasPatterns(const MCInst *MI, const MCSubtargetInfo *STI, const AliasMatchingData &M)
Helper for matching MCInsts to alias patterns when printing instructions.
bool getUseMarkup() const
StringRef getOpcodeName(unsigned Opcode) const
Return the name of the specified opcode enum (e.g.
format_object< int64_t > formatHex(int64_t Value) const
bool(* ValidateMCOperand)(const MCOperand &MCOp, const MCSubtargetInfo &STI, unsigned PredicateIndex)
Generic base class for all target subtargets.
void dumpBytes(ArrayRef< uint8_t > Bytes, raw_ostream &OS)
Convert `Bytes' to a hex string and output to `OS'.
LLVM_NODISCARD const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
void printAnnotation(raw_ostream &OS, StringRef Annot)
Utility function for printing annotations.
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
Instances of this class represent operands of the MCInst class.
const MCRegisterClass & getRegClass(unsigned i) const
Returns the register class associated with the enumeration value.
const MCRegisterInfo & MRI