50 std::unique_ptr<LanaiOperand> parseRegister();
54 std::unique_ptr<LanaiOperand> parseIdentifier();
56 unsigned parseAluOperator(
bool PreOp,
bool PostOp);
64 bool ParseDirective(
AsmToken DirectiveID)
override;
69 bool ParseRegister(
unsigned &RegNum,
SMLoc &StartLoc,
SMLoc &EndLoc)
override;
71 bool MatchAndEmitInstruction(
SMLoc IdLoc,
unsigned &Opcode,
74 bool MatchingInlineAsm)
override;
77 #define GET_ASSEMBLER_HEADER 78 #include "LanaiGenAsmMatcher.inc" 89 Lexer(Parser.getLexer()), SubtargetInfo(STI) {
91 ComputeAvailableFeatures(SubtargetInfo.getFeatureBits()));
113 SMLoc StartLoc, EndLoc;
149 SMLoc getStartLoc()
const override {
return StartLoc; }
152 SMLoc getEndLoc()
const override {
return EndLoc; }
154 unsigned getReg()
const override {
159 const MCExpr *getImm()
const {
160 assert(isImm() &&
"Invalid type access!");
165 assert(isToken() &&
"Invalid type access!");
169 unsigned getMemBaseReg()
const {
174 unsigned getMemOffsetReg()
const {
176 return Mem.OffsetReg;
179 const MCExpr *getMemOffset()
const {
184 unsigned getMemOp()
const {
190 bool isReg()
const override {
return Kind == REGISTER; }
192 bool isImm()
const override {
return Kind == IMMEDIATE; }
194 bool isMem()
const override {
195 return isMemImm() || isMemRegImm() || isMemRegReg();
198 bool isMemImm()
const {
return Kind == MEMORY_IMM; }
200 bool isMemRegImm()
const {
return Kind == MEMORY_REG_IMM; }
202 bool isMemRegReg()
const {
return Kind == MEMORY_REG_REG; }
204 bool isMemSpls()
const {
return isMemRegImm() || isMemRegReg(); }
206 bool isToken()
const override {
return Kind ==
TOKEN; }
218 return isShiftedUInt<23, 2>(
static_cast<int32_t
>(
Value));
221 bool isBrTarget() {
return isBrImm() || isToken(); }
223 bool isCallTarget() {
return isImm() || isToken(); }
230 if (
const MCConstantExpr *ConstExpr = dyn_cast<MCConstantExpr>(Imm.Value)) {
231 int64_t
Value = ConstExpr->getValue();
232 return Value != 0 && isShiftedUInt<16, 16>(
Value);
236 if (
const LanaiMCExpr *SymbolRefExpr = dyn_cast<LanaiMCExpr>(Imm.Value))
248 bool isHiImm16And() {
254 int64_t Value = ConstExpr->
getValue();
256 return (Value != 0) && ((Value & ~0xffff0000) == 0xffff);
266 if (
const MCConstantExpr *ConstExpr = dyn_cast<MCConstantExpr>(Imm.Value)) {
267 int64_t Value = ConstExpr->
getValue();
273 if (
const LanaiMCExpr *SymbolRefExpr = dyn_cast<LanaiMCExpr>(Imm.Value))
285 bool isLoImm16Signed() {
290 if (
const MCConstantExpr *ConstExpr = dyn_cast<MCConstantExpr>(Imm.Value)) {
291 int64_t Value = ConstExpr->
getValue();
297 if (
const LanaiMCExpr *SymbolRefExpr = dyn_cast<LanaiMCExpr>(Imm.Value))
309 bool isLoImm16And() {
315 int64_t Value = ConstExpr->
getValue();
317 return ((Value & ~0xffff) == 0xffff0000);
329 int64_t Value = ConstExpr->
getValue();
330 return (Value >= -31) && (Value <= 31);
338 if (
const MCConstantExpr *ConstExpr = dyn_cast<MCConstantExpr>(Imm.Value)) {
339 int64_t Value = ConstExpr->
getValue();
340 return isUInt<21>(
Value);
344 if (
const LanaiMCExpr *SymbolRefExpr = dyn_cast<LanaiMCExpr>(Imm.Value))
347 dyn_cast<MCSymbolRefExpr>(Imm.Value)) {
357 dyn_cast<MCSymbolRefExpr>(
BinaryExpr->getLHS()))
371 int64_t Value = ConstExpr->
getValue();
372 return isInt<10>(
Value);
382 uint64_t Value = ConstExpr->
getValue();
393 else if (
const MCConstantExpr *ConstExpr = dyn_cast<MCConstantExpr>(Expr))
400 void addRegOperands(
MCInst &Inst,
unsigned N)
const {
401 assert(N == 1 &&
"Invalid number of operands!");
405 void addImmOperands(
MCInst &Inst,
unsigned N)
const {
406 assert(N == 1 &&
"Invalid number of operands!");
407 addExpr(Inst, getImm());
410 void addBrTargetOperands(
MCInst &Inst,
unsigned N)
const {
411 assert(N == 1 &&
"Invalid number of operands!");
412 addExpr(Inst, getImm());
415 void addCallTargetOperands(
MCInst &Inst,
unsigned N)
const {
416 assert(N == 1 &&
"Invalid number of operands!");
417 addExpr(Inst, getImm());
420 void addCondCodeOperands(
MCInst &Inst,
unsigned N)
const {
421 assert(N == 1 &&
"Invalid number of operands!");
422 addExpr(Inst, getImm());
425 void addMemImmOperands(
MCInst &Inst,
unsigned N)
const {
426 assert(N == 1 &&
"Invalid number of operands!");
427 const MCExpr *Expr = getMemOffset();
431 void addMemRegImmOperands(
MCInst &Inst,
unsigned N)
const {
432 assert(N == 3 &&
"Invalid number of operands!");
434 const MCExpr *Expr = getMemOffset();
439 void addMemRegRegOperands(
MCInst &Inst,
unsigned N)
const {
440 assert(N == 3 &&
"Invalid number of operands!");
442 assert(getMemOffsetReg() != 0 &&
"Invalid offset");
447 void addMemSplsOperands(
MCInst &Inst,
unsigned N)
const {
449 addMemRegImmOperands(Inst, N);
451 addMemRegRegOperands(Inst, N);
454 void addImmShiftOperands(
MCInst &Inst,
unsigned N)
const {
455 assert(N == 1 &&
"Invalid number of operands!");
456 addExpr(Inst, getImm());
459 void addImm10Operands(
MCInst &Inst,
unsigned N)
const {
460 assert(N == 1 &&
"Invalid number of operands!");
461 addExpr(Inst, getImm());
464 void addLoImm16Operands(
MCInst &Inst,
unsigned N)
const {
465 assert(N == 1 &&
"Invalid number of operands!");
466 if (
const MCConstantExpr *ConstExpr = dyn_cast<MCConstantExpr>(getImm()))
469 else if (isa<LanaiMCExpr>(getImm())) {
476 }
else if (isa<MCBinaryExpr>(getImm())) {
479 assert(BinaryExpr && isa<LanaiMCExpr>(BinaryExpr->
getLHS()) &&
480 cast<LanaiMCExpr>(BinaryExpr->
getLHS())->getKind() ==
485 assert(
false &&
"Operand type not supported.");
488 void addLoImm16AndOperands(
MCInst &Inst,
unsigned N)
const {
489 assert(N == 1 &&
"Invalid number of operands!");
490 if (
const MCConstantExpr *ConstExpr = dyn_cast<MCConstantExpr>(getImm()))
493 assert(
false &&
"Operand type not supported.");
496 void addHiImm16Operands(
MCInst &Inst,
unsigned N)
const {
497 assert(N == 1 &&
"Invalid number of operands!");
498 if (
const MCConstantExpr *ConstExpr = dyn_cast<MCConstantExpr>(getImm()))
500 else if (isa<LanaiMCExpr>(getImm())) {
507 }
else if (isa<MCBinaryExpr>(getImm())) {
510 assert(BinaryExpr && isa<LanaiMCExpr>(BinaryExpr->
getLHS()) &&
511 cast<LanaiMCExpr>(BinaryExpr->
getLHS())->getKind() ==
516 assert(
false &&
"Operand type not supported.");
519 void addHiImm16AndOperands(
MCInst &Inst,
unsigned N)
const {
520 assert(N == 1 &&
"Invalid number of operands!");
521 if (
const MCConstantExpr *ConstExpr = dyn_cast<MCConstantExpr>(getImm()))
524 assert(
false &&
"Operand type not supported.");
527 void addLoImm21Operands(
MCInst &Inst,
unsigned N)
const {
528 assert(N == 1 &&
"Invalid number of operands!");
529 if (
const MCConstantExpr *ConstExpr = dyn_cast<MCConstantExpr>(getImm()))
531 else if (isa<LanaiMCExpr>(getImm())) {
538 }
else if (isa<MCSymbolRefExpr>(getImm())) {
546 }
else if (isa<MCBinaryExpr>(getImm())) {
549 assert(BinaryExpr && isa<LanaiMCExpr>(BinaryExpr->
getLHS()) &&
550 cast<LanaiMCExpr>(BinaryExpr->
getLHS())->getKind() ==
555 assert(
false &&
"Operand type not supported.");
561 OS <<
"Imm: " << getImm() <<
"\n";
564 OS <<
"Token: " <<
getToken() <<
"\n";
567 OS <<
"Reg: %r" <<
getReg() <<
"\n";
570 OS <<
"MemImm: " << *getMemOffset() <<
"\n";
573 OS <<
"MemRegImm: " << getMemBaseReg() <<
"+" << *getMemOffset() <<
"\n";
576 assert(getMemOffset() ==
nullptr);
577 OS <<
"MemRegReg: " << getMemBaseReg() <<
"+" 578 <<
"%r" << getMemOffsetReg() <<
"\n";
583 static std::unique_ptr<LanaiOperand> CreateToken(
StringRef Str,
SMLoc Start) {
584 auto Op = std::make_unique<LanaiOperand>(
TOKEN);
585 Op->Tok.Data = Str.
data();
586 Op->Tok.Length = Str.
size();
587 Op->StartLoc = Start;
592 static std::unique_ptr<LanaiOperand> createReg(
unsigned RegNum,
SMLoc Start,
594 auto Op = std::make_unique<LanaiOperand>(REGISTER);
595 Op->Reg.RegNum = RegNum;
596 Op->StartLoc = Start;
601 static std::unique_ptr<LanaiOperand> createImm(
const MCExpr *Value,
603 auto Op = std::make_unique<LanaiOperand>(IMMEDIATE);
605 Op->StartLoc = Start;
610 static std::unique_ptr<LanaiOperand>
611 MorphToMemImm(std::unique_ptr<LanaiOperand>
Op) {
612 const MCExpr *Imm = Op->getImm();
613 Op->Kind = MEMORY_IMM;
616 Op->Mem.OffsetReg = 0;
617 Op->Mem.Offset = Imm;
621 static std::unique_ptr<LanaiOperand>
622 MorphToMemRegReg(
unsigned BaseReg, std::unique_ptr<LanaiOperand> Op,
624 unsigned OffsetReg = Op->getReg();
625 Op->Kind = MEMORY_REG_REG;
626 Op->Mem.BaseReg = BaseReg;
627 Op->Mem.AluOp = AluOp;
628 Op->Mem.OffsetReg = OffsetReg;
629 Op->Mem.Offset =
nullptr;
633 static std::unique_ptr<LanaiOperand>
634 MorphToMemRegImm(
unsigned BaseReg, std::unique_ptr<LanaiOperand> Op,
636 const MCExpr *Imm = Op->getImm();
637 Op->Kind = MEMORY_REG_IMM;
638 Op->Mem.BaseReg = BaseReg;
639 Op->Mem.AluOp = AluOp;
640 Op->Mem.OffsetReg = 0;
641 Op->Mem.Offset = Imm;
648 bool LanaiAsmParser::ParseDirective(
AsmToken ) {
return true; }
650 bool LanaiAsmParser::MatchAndEmitInstruction(
SMLoc IdLoc,
unsigned &Opcode,
654 bool MatchingInlineAsm) {
658 switch (MatchInstructionImpl(Operands, Inst, ErrorInfo, MatchingInlineAsm)) {
663 case Match_MissingFeature:
664 return Error(IdLoc,
"Instruction use requires option to be enabled");
665 case Match_MnemonicFail:
666 return Error(IdLoc,
"Unrecognized instruction mnemonic");
667 case Match_InvalidOperand: {
669 if (ErrorInfo != ~0U) {
670 if (ErrorInfo >= Operands.
size())
671 return Error(IdLoc,
"Too few operands for instruction");
673 ErrorLoc = ((LanaiOperand &)*Operands[ErrorInfo]).getStartLoc();
674 if (ErrorLoc ==
SMLoc())
677 return Error(ErrorLoc,
"Invalid operand for instruction");
690 std::unique_ptr<LanaiOperand> LanaiAsmParser::parseRegister() {
691 SMLoc Start = Parser.getTok().getLoc();
703 return LanaiOperand::createReg(RegNum, Start, End);
708 bool LanaiAsmParser::ParseRegister(
unsigned &RegNum,
SMLoc &StartLoc,
710 const AsmToken &Tok = getParser().getTok();
713 std::unique_ptr<LanaiOperand> Op = parseRegister();
715 RegNum = Op->getReg();
716 return (Op ==
nullptr);
719 std::unique_ptr<LanaiOperand> LanaiAsmParser::parseIdentifier() {
720 SMLoc Start = Parser.getTok().getLoc();
722 const MCExpr *Res, *RHS =
nullptr;
729 if (Parser.parseIdentifier(Identifier))
742 Error(Lexer.getLoc(),
"Expected '('");
748 if (Parser.parseIdentifier(Identifier))
753 if (Lexer.getKind() ==
AsmToken::Plus && Parser.parseExpression(RHS))
759 Error(Lexer.getLoc(),
"Expected ')'");
766 MCSymbol *Sym = getContext().getOrCreateSymbol(Identifier);
774 return LanaiOperand::createImm(Res, Start, End);
778 SMLoc Start = Parser.getTok().getLoc();
782 switch (Lexer.getKind()) {
784 return parseIdentifier();
789 if (!Parser.parseExpression(ExprVal))
790 return LanaiOperand::createImm(ExprVal, Start, End);
805 unsigned LanaiAsmParser::parseAluOperator(
bool PreOp,
bool PostOp) {
807 Parser.parseIdentifier(IdString);
810 Error(Parser.getTok().getLoc(),
"Can't parse ALU operator");
820 bool LanaiAsmParser::parsePrePost(
StringRef Type,
int *OffsetValue) {
821 bool PreOrPost =
false;
822 if (Lexer.getKind() == Lexer.peekTok(
true).getKind()) {
845 if (
const MCConstantExpr *ConstExpr = dyn_cast<MCConstantExpr>(Op.getImm())) {
846 int64_t Value = ConstExpr->
getValue();
847 return (Value % 4 == 0) && (Value >= 0) && (Value <= 0x1fffff);
851 if (
const LanaiMCExpr *SymbolRefExpr = dyn_cast<LanaiMCExpr>(Op.getImm()))
856 if (
const MCBinaryExpr *BinaryExpr = dyn_cast<MCBinaryExpr>(Op.getImm())) {
859 return (LHSSymbolRefExpr &&
867 LanaiAsmParser::parseMemoryOperand(
OperandVector &Operands) {
880 if (Operands[0]->isToken())
881 Type =
static_cast<LanaiOperand *
>(Operands[0].get())->
getToken();
885 unsigned BaseReg = 0;
887 bool PostOp =
false, PreOp =
false;
890 std::unique_ptr<LanaiOperand> Op = parseRegister();
907 std::unique_ptr<LanaiOperand>
Offset =
nullptr;
912 PreOp = parsePrePost(Type, &OffsetValue);
914 Op = parseRegister();
923 Operands.
push_back(LanaiOperand::MorphToMemImm(std::move(Op)));
925 if (!Op->isLoImm16Signed()) {
926 Error(Parser.getTok().getLoc(),
927 "Memory address is not word " 928 "aligned and larger than class RM can handle");
931 Operands.
push_back(LanaiOperand::MorphToMemRegImm(
938 Error(Parser.getTok().getLoc(),
939 "Unknown operand, expected register or immediate");
942 BaseReg = Op->getReg();
946 PostOp = parsePrePost(Type, &OffsetValue);
952 SMLoc Start = Parser.getTok().getLoc();
957 Offset = LanaiOperand::createImm(OffsetConstExpr, Start, End);
960 if (Offset || OffsetValue != 0) {
961 Error(Parser.getTok().getLoc(),
"Expected ']'");
966 AluOp = parseAluOperator(PreOp, PostOp);
969 Offset = parseRegister();
971 Error(Parser.getTok().getLoc(),
"Expected ']'");
982 if (Offset->isImm() && !Offset->isLoImm16Signed()) {
983 Error(Parser.getTok().getLoc(),
984 "Memory address is not word " 985 "aligned and larger than class RM can handle");
991 ? LanaiOperand::MorphToMemRegImm(BaseReg, std::move(Offset), AluOp)
992 : LanaiOperand::MorphToMemRegReg(BaseReg, std::move(Offset), AluOp));
1009 Parser.eatToEndOfStatement();
1014 std::unique_ptr<LanaiOperand> Op = parseRegister();
1022 Error(Parser.getTok().getLoc(),
"Unknown operand");
1023 Parser.eatToEndOfStatement();
1037 size_t Next = Name.
find(
'.');
1048 if (Mnemonic[0] ==
'b' ||
1049 (Mnemonic[0] ==
's' && !Mnemonic.
startswith(
"sel") &&
1056 Mnemonic = Mnemonic.
slice(0, 1);
1057 Operands->
push_back(LanaiOperand::CreateToken(Mnemonic, NameLoc));
1058 Operands->
push_back(LanaiOperand::createImm(
1061 Operands->
push_back(LanaiOperand::CreateToken(
".r", NameLoc));
1075 size_t Next = Mnemonic.
rfind(
'.', Name.
size());
1082 Mnemonic = Mnemonic.
substr(0, Next + 1);
1084 Mnemonic = Mnemonic.
substr(0, Next);
1086 Operands->
push_back(LanaiOperand::CreateToken(Mnemonic, NameLoc));
1087 Operands->
push_back(LanaiOperand::createImm(
1093 Operands->
push_back(LanaiOperand::CreateToken(Mnemonic, NameLoc));
1095 Operands->
push_back(LanaiOperand::CreateToken(
".r", NameLoc));
1107 bool Modifies =
false;
1111 if (Operands.
size() < 5)
1113 else if (Operands[0]->isToken() && Operands[1]->isReg() &&
1114 Operands[2]->isImm() && Operands[3]->isImm() && Operands[4]->isReg())
1116 else if (Operands[0]->isToken() && Operands[1]->isToken() &&
1117 Operands[2]->isReg() && Operands[3]->isImm() &&
1118 Operands[4]->isImm() && Operands[5]->isReg())
1123 int PossibleAluOpIdx = Offset + 3;
1124 int PossibleBaseIdx = Offset + 1;
1125 int PossibleDestIdx = Offset + 4;
1126 if (LanaiOperand *PossibleAluOp =
1127 static_cast<LanaiOperand *>(Operands[PossibleAluOpIdx].
get()))
1128 if (PossibleAluOp->isImm())
1130 dyn_cast<MCConstantExpr>(PossibleAluOp->getImm()))
1132 return Modifies && Operands[PossibleBaseIdx]->isReg() &&
1133 Operands[PossibleDestIdx]->isReg() &&
1134 Operands[PossibleBaseIdx]->getReg() ==
1135 Operands[PossibleDestIdx]->getReg();
1139 return static_cast<const LanaiOperand &
>(
op).
isReg();
1147 static_cast<const LanaiOperand &
>(*Operands[0]).
getToken())
1148 .StartsWith(
"addc",
true)
1163 StringRef Mnemonic = splitMnemonic(Name, NameLoc, &Operands);
1176 Operands.
size() == 2) {
1178 Operands.
insert(Operands.
begin(), LanaiOperand::CreateToken(
"s", NameLoc));
1180 LanaiOperand::createImm(
1189 Operands.
size() == 3) {
1191 Operands.
insert(Operands.
begin(), LanaiOperand::CreateToken(
"bt", NameLoc));
1205 Error(Parser.getTok().getLoc(),
1206 "the destination register can't equal the base register in an " 1207 "instruction that modifies the base register.");
1215 LanaiOperand::createImm(
1223 #define GET_REGISTER_MATCHER 1224 #define GET_MATCHER_IMPLEMENTATION 1225 #include "LanaiGenAsmMatcher.inc" static bool isReg(const MCInst &MI, unsigned OpNo)
static CondCode suffixToLanaiCondCode(StringRef S)
static unsigned AluWithPrePost(unsigned AluCode, bool PreOp, bool PostOp)
LLVM_NODISCARD bool endswith(StringRef Suffix) const
Check if this string ends with the given Suffix.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
This class represents lattice values for constants.
Target & getTheLanaiTarget()
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
VariantKind getKind() const
LLVM_NODISCARD bool equals_lower(StringRef RHS) const
equals_lower - Check for string equality, ignoring case.
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeLanaiAsmParser()
Generic assembler parser interface, for use by target specific assembly parsers.
static bool modifiesOp(unsigned AluOp)
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
static MCOperand createExpr(const MCExpr *Val)
MCTargetAsmParser - Generic interface to target specific assembly parsers.
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
LLVM_NODISCARD size_t rfind(char C, size_t From=npos) const
Search for the last character C in the string.
void push_back(const T &Elt)
static int SizeForSuffix(StringRef T)
const MCExpr * getLHS() const
Get the left-hand side expression of the binary operator.
constexpr bool isInt< 16 >(int64_t x)
StringSwitch & StartsWith(StringLiteral S, T Value)
TOKEN(Invalid) TOKEN(Int) TOKEN(String) TOKEN(Identifier) SHORT_TOKEN(BlockBegin
static bool IsMemoryAssignmentError(const OperandVector &Operands)
static const LanaiMCExpr * create(VariantKind Kind, const MCExpr *Expr, MCContext &Ctx)
static unsigned makePostOp(unsigned AluOp)
virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
static bool MaybePredicatedInst(const OperandVector &Operands)
static MCOperand createReg(unsigned Reg)
Generic assembler lexer interface, for use by target specific assembly lexers.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Base class for the full range of assembler expressions which are needed for parsing.
LLVM_NODISCARD R Default(T Value)
static bool IsRegister(const MCParsedAsmOperand &op)
Target independent representation for an assembler token.
Represent a reference to a symbol from inside an expression.
LLVM_NODISCARD StringRef slice(size_t Start, size_t End) const
Return a reference to the substring from [Start, End).
mir Rename Register Operands
LLVM_NODISCARD StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
static bool isMem(const MachineInstr &MI, unsigned Op)
MCParsedAsmOperand - This abstract class represents a source-level assembly instruction operand...
std::pair< StringRef, StringRef > getToken(StringRef Source, StringRef Delimiters=" \\\)
getToken - This function extracts one token from source, ignoring any leading characters that appear ...
RegisterMCAsmParser - Helper template for registering a target specific assembly parser, for use in the target machine initialization function.
LLVM_NODISCARD size_t size() const
size - Get the string size.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Instances of this class represent a single low-level machine instruction.
Analysis containing CSE Info
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false)
A switch()-like statement whose cases are string literals.
Streaming machine code generation interface.
The instances of the Type class are immutable: once they are created, they are never changed...
StringSwitch & EndsWith(StringLiteral S, T Value)
Interface to description of machine instruction set.
LLVM_NODISCARD size_t find(char C, size_t From=0) const
Search for the first character C in the string.
bool shouldBeSls(const LanaiOperand &Op)
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
iterator erase(const_iterator CI)
Binary assembler expressions.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
#define LLVM_EXTERNAL_VISIBILITY
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
static unsigned makePreOp(unsigned AluOp)
Base class for user error types.
iterator insert(iterator I, T &&Elt)
static SMLoc getFromPointer(const char *Ptr)
static AluCode stringToLanaiAluCode(StringRef S)
Generic base class for all target subtargets.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
VariantKind getKind() const
constexpr bool isUInt< 16 >(uint64_t x)
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.
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
This class implements an extremely fast bulk output stream that can only output to a stream...
void addOperand(const MCOperand &Op)
StringRef - Represent a constant reference to a string, i.e.
Represents a location in source code.
unsigned getOpcode() const
static MCOperand createImm(int64_t Val)
bool parseImmediate(MCInst &MI, uint64_t &Size, ArrayRef< uint8_t > Bytes)
static unsigned MatchRegisterName(StringRef Name)