28#define RECORD(name, altName, print, parse) #name
38#define RECORD(name, altName, print, parse) #altName
49 for (
unsigned i = 0; i < names.
size(); ++i) {
50 map.
insert(std::pair(names[i], i));
51 map.
insert(std::pair(altNames[i], i));
59 return map.lookup(
name) - 1;
69 return OS <<
Name <<
" = ";
72template <
typename T, T amd_kernel_code_t::*ptr>
78template <
typename T, T amd_kernel_code_t::*ptr,
int shift,
int w
idth = 1>
81 const auto Mask = (
static_cast<T>(1) << width) - 1;
88 static const PrintFx Table[] = {
89#define RECORD(name, altName, print, parse) print
108 for (
int i = 0; i <
Size; ++i) {
120 Err <<
"expected '='";
126 Err <<
"integer absolute expression expected";
132template <
typename T, T amd_kernel_code_t::*ptr>
142template <
typename T, T amd_kernel_code_t::*ptr,
int shift,
int w
idth = 1>
148 const uint64_t Mask = ((UINT64_C(1) << width) - 1) << shift;
150 C.*ptr |= (
T)((
Value << shift) & Mask);
158 static const ParseFx Table[] = {
159#define RECORD(name, altName, print, parse) parse
172 Err <<
"unexpected amd_kernel_code_t field name " <<
ID;
176 return Parser ? Parser(
C, MCParser, Err) :
false;
This file defines the StringMap class.
static ArrayRef< StringRef > get_amd_kernel_code_t_FldAltNames()
static ArrayRef< PrintFx > getPrinterTable()
static void printBitField(StringRef Name, const amd_kernel_code_t &c, raw_ostream &OS)
void(*)(StringRef, const amd_kernel_code_t &, raw_ostream &) PrintFx
static raw_ostream & printName(raw_ostream &OS, StringRef Name)
static bool parseBitField(amd_kernel_code_t &C, MCAsmParser &MCParser, raw_ostream &Err)
static bool expectAbsExpression(MCAsmParser &MCParser, int64_t &Value, raw_ostream &Err)
static void printField(StringRef Name, const amd_kernel_code_t &C, raw_ostream &OS)
static StringMap< int > createIndexMap(const ArrayRef< StringRef > &names, const ArrayRef< StringRef > &altNames)
bool(*)(amd_kernel_code_t &, MCAsmParser &MCParser, raw_ostream &Err) ParseFx
static ArrayRef< StringRef > get_amd_kernel_code_t_FldNames()
static bool parseField(amd_kernel_code_t &C, MCAsmParser &MCParser, raw_ostream &Err)
static StringRef get_amd_kernel_code_t_FieldName(int index)
static ArrayRef< ParseFx > getParserTable()
static int get_amd_kernel_code_t_FieldIndex(StringRef name)
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
Memory true print Memory SSA Printer
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.
bool isNot(AsmToken::TokenKind K) const
Check if the current token has kind K.
const AsmToken & Lex()
Consume the next token from the input stream and return it.
Generic assembler parser interface, for use by target specific assembly parsers.
virtual MCAsmLexer & getLexer()=0
virtual bool parseAbsoluteExpression(int64_t &Res)=0
Parse an expression which must evaluate to an absolute value.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
void dumpAmdKernelCode(const amd_kernel_code_t *C, raw_ostream &OS, const char *tab)
void printAmdKernelCodeField(const amd_kernel_code_t &C, int FldIndex, raw_ostream &OS)
bool parseAmdKernelCodeField(StringRef ID, MCAsmParser &Parser, amd_kernel_code_t &C, raw_ostream &Err)
AMD Kernel Code Object (amd_kernel_code_t).