23#define DEBUG_TYPE "m68k-asm-parser"
29 cl::desc(
"Enable specifying registers without the % prefix"),
38#define GET_ASSEMBLER_HEADER
39#include "M68kGenAsmMatcher.inc"
62 MRI = getContext().getRegisterInfo();
64 setAvailableFeatures(ComputeAvailableFeatures(STI.
getFeatureBits()));
67 unsigned validateTargetOperandClass(MCParsedAsmOperand &
Op,
68 unsigned Kind)
override;
69 bool parseRegister(MCRegister &
Reg, SMLoc &StartLoc, SMLoc &EndLoc)
override;
70 ParseStatus tryParseRegister(MCRegister &
Reg, SMLoc &StartLoc,
71 SMLoc &EndLoc)
override;
72 bool parseInstruction(ParseInstructionInfo &Info, StringRef Name,
74 bool matchAndEmitInstruction(SMLoc IDLoc,
unsigned &Opcode,
77 bool MatchingInlineAsm)
override;
88 RegIndirectDisplacement,
89 RegIndirectDisplacementIndex,
106 const MCExpr *OuterDisp;
107 const MCExpr *InnerDisp;
111 uint8_t AtLeast68020 : 1;
114 M68kMemOp(Kind Op) : Op(Op) {}
116 void print(raw_ostream &OS)
const;
121 typedef MCParsedAsmOperand Base;
138 template <
unsigned N>
bool isAddrN()
const;
141 M68kOperand(KindTy Kind, SMLoc Start, SMLoc End)
142 : Base(), Kind(Kind), Start(Start), End(End) {}
144 SMLoc getStartLoc()
const override {
return Start; }
145 SMLoc getEndLoc()
const override {
return End; }
147 void print(raw_ostream &OS,
const MCAsmInfo &MAI)
const override;
149 bool isMem()
const override {
return false; }
150 bool isMemOp()
const {
return Kind == KindTy::MemOp; }
152 static void addExpr(MCInst &Inst,
const MCExpr *Expr);
155 bool isReg()
const override;
158 bool isFPDReg()
const;
159 bool isFPCReg()
const;
160 MCRegister
getReg()
const override;
161 void addRegOperands(MCInst &Inst,
unsigned N)
const;
163 static std::unique_ptr<M68kOperand> createMemOp(M68kMemOp MemOp, SMLoc Start,
167 bool isToken()
const override;
169 static std::unique_ptr<M68kOperand> createToken(StringRef Token, SMLoc Start,
173 bool isImm()
const override;
174 void addImmOperands(MCInst &Inst,
unsigned N)
const;
176 static std::unique_ptr<M68kOperand> createImm(
const MCExpr *Expr, SMLoc Start,
180 bool isTrapImm()
const;
182 bool isBkptImm()
const;
185 bool isMoveMask()
const;
186 void addMoveMaskOperands(MCInst &Inst,
unsigned N)
const;
190 bool isAddr8()
const {
return isAddrN<8>(); }
191 bool isAddr16()
const {
return isAddrN<16>(); }
192 bool isAddr32()
const {
return isAddrN<32>(); }
193 void addAddrOperands(MCInst &Inst,
unsigned N)
const;
197 void addARIOperands(MCInst &Inst,
unsigned N)
const;
201 void addARIDOperands(MCInst &Inst,
unsigned N)
const;
205 void addARIIOperands(MCInst &Inst,
unsigned N)
const;
208 bool isARIPD()
const;
209 void addARIPDOperands(MCInst &Inst,
unsigned N)
const;
212 bool isARIPI()
const;
213 void addARIPIOperands(MCInst &Inst,
unsigned N)
const;
217 void addPCDOperands(MCInst &Inst,
unsigned N)
const;
221 void addPCIOperands(MCInst &Inst,
unsigned N)
const;
224 bool isPCIBD()
const;
225 bool isPCIBD32()
const;
226 bool isPCIBD16()
const;
227 void addPCIBDOperands(MCInst &Inst,
unsigned N)
const;
236#define GET_REGISTER_MATCHER
237#define GET_MATCHER_IMPLEMENTATION
238#include "M68kGenAsmMatcher.inc"
241 static unsigned RegistersByIndex[] = {
242 M68k::D0, M68k::D1, M68k::D2, M68k::D3, M68k::D4, M68k::D5,
243 M68k::D6, M68k::D7, M68k::A0, M68k::A1, M68k::A2, M68k::A3,
244 M68k::A4, M68k::A5, M68k::A6, M68k::SP, M68k::FP0, M68k::FP1,
245 M68k::FP2, M68k::FP3, M68k::FP4, M68k::FP5, M68k::FP6, M68k::FP7};
247 sizeof(RegistersByIndex) /
sizeof(RegistersByIndex[0]));
248 return RegistersByIndex[RegisterIndex];
284 OS <<
"RegMask(" <<
format(
"%04x", RegMask) <<
")";
287 OS <<
'%' << OuterReg;
289 case Kind::RegIndirect:
290 OS <<
"(%" << OuterReg <<
')';
292 case Kind::RegPostIncrement:
293 OS <<
"(%" << OuterReg <<
")+";
295 case Kind::RegPreDecrement:
296 OS <<
"-(%" << OuterReg <<
")";
298 case Kind::RegIndirectDisplacement:
299 OS << OuterDisp <<
"(%" << OuterReg <<
")";
301 case Kind::RegIndirectDisplacementIndex:
302 OS << OuterDisp <<
"(%" << OuterReg <<
", " << InnerReg <<
", " << InnerDisp
308void M68kOperand::addExpr(MCInst &Inst,
const MCExpr *Expr) {
318bool M68kOperand::isReg()
const {
319 return Kind == KindTy::MemOp && MemOp.Op == M68kMemOp::Kind::Reg;
322MCRegister M68kOperand::getReg()
const {
324 return MemOp.OuterReg;
327void M68kOperand::addRegOperands(MCInst &Inst,
unsigned N)
const {
329 assert((
N == 1) &&
"can only handle one register operand");
334std::unique_ptr<M68kOperand> M68kOperand::createMemOp(M68kMemOp MemOp,
335 SMLoc Start, SMLoc End) {
336 auto Op = std::make_unique<M68kOperand>(KindTy::MemOp, Start, End);
342bool M68kOperand::isToken()
const {
return Kind == KindTy::Token; }
343StringRef M68kOperand::getToken()
const {
348std::unique_ptr<M68kOperand> M68kOperand::createToken(StringRef Token,
349 SMLoc Start, SMLoc End) {
350 auto Op = std::make_unique<M68kOperand>(KindTy::Token, Start, End);
356bool M68kOperand::isImm()
const {
return Kind == KindTy::Imm; }
357void M68kOperand::addImmOperands(MCInst &Inst,
unsigned N)
const {
358 assert(isImm() &&
"wrong operand kind");
359 assert((
N == 1) &&
"can only handle one register operand");
361 M68kOperand::addExpr(Inst, Expr);
364std::unique_ptr<M68kOperand> M68kOperand::createImm(
const MCExpr *Expr,
365 SMLoc Start, SMLoc End) {
366 auto Op = std::make_unique<M68kOperand>(KindTy::Imm, Start, End);
371bool M68kOperand::isTrapImm()
const {
373 if (!isImm() || !Expr->evaluateAsAbsolute(
Value))
379bool M68kOperand::isBkptImm()
const {
381 if (!isImm() || !Expr->evaluateAsAbsolute(
Value))
388bool M68kOperand::isMoveMask()
const {
392 if (MemOp.Op == M68kMemOp::Kind::RegMask)
395 if (MemOp.Op != M68kMemOp::Kind::Reg)
403void M68kOperand::addMoveMaskOperands(MCInst &Inst,
unsigned N)
const {
404 assert(isMoveMask() &&
"wrong operand kind");
405 assert((
N == 1) &&
"can only handle one immediate operand");
407 uint16_t MoveMask = MemOp.RegMask;
408 if (MemOp.Op == M68kMemOp::Kind::Reg)
415bool M68kOperand::isAddr()
const {
416 return isMemOp() && MemOp.Op == M68kMemOp::Kind::Addr;
420template <
unsigned N>
bool M68kOperand::isAddrN()
const {
423 if (MemOp.OuterDisp->evaluateAsAbsolute(Res))
429void M68kOperand::addAddrOperands(MCInst &Inst,
unsigned N)
const {
430 M68kOperand::addExpr(Inst, MemOp.OuterDisp);
434bool M68kOperand::isARI()
const {
435 return isMemOp() && MemOp.Op == M68kMemOp::Kind::RegIndirect &&
436 M68k::AR32RegClass.contains(MemOp.OuterReg);
438void M68kOperand::addARIOperands(MCInst &Inst,
unsigned N)
const {
443bool M68kOperand::isARID()
const {
444 return isMemOp() && MemOp.Op == M68kMemOp::Kind::RegIndirectDisplacement &&
445 M68k::AR32RegClass.contains(MemOp.OuterReg);
447void M68kOperand::addARIDOperands(MCInst &Inst,
unsigned N)
const {
448 M68kOperand::addExpr(Inst, MemOp.OuterDisp);
453bool M68kOperand::isARII()
const {
455 MemOp.Op == M68kMemOp::Kind::RegIndirectDisplacementIndex &&
456 M68k::AR32RegClass.contains(MemOp.OuterReg);
458void M68kOperand::addARIIOperands(MCInst &Inst,
unsigned N)
const {
459 M68kOperand::addExpr(Inst, MemOp.OuterDisp);
465bool M68kOperand::isARIPD()
const {
466 return isMemOp() && MemOp.Op == M68kMemOp::Kind::RegPreDecrement &&
467 M68k::AR32RegClass.contains(MemOp.OuterReg);
469void M68kOperand::addARIPDOperands(MCInst &Inst,
unsigned N)
const {
474bool M68kOperand::isARIPI()
const {
475 return isMemOp() && MemOp.Op == M68kMemOp::Kind::RegPostIncrement &&
476 M68k::AR32RegClass.contains(MemOp.OuterReg);
478void M68kOperand::addARIPIOperands(MCInst &Inst,
unsigned N)
const {
483bool M68kOperand::isPCD()
const {
484 return isMemOp() && MemOp.Op == M68kMemOp::Kind::RegIndirectDisplacement &&
485 MemOp.OuterReg == M68k::PC && !MemOp.AtLeast68020;
487void M68kOperand::addPCDOperands(MCInst &Inst,
unsigned N)
const {
488 M68kOperand::addExpr(Inst, MemOp.OuterDisp);
492bool M68kOperand::isPCI()
const {
494 MemOp.Op == M68kMemOp::Kind::RegIndirectDisplacementIndex &&
495 MemOp.OuterReg == M68k::PC && MemOp.Scale == 1 && !MemOp.AtLeast68020;
497void M68kOperand::addPCIOperands(MCInst &Inst,
unsigned N)
const {
498 M68kOperand::addExpr(Inst, MemOp.OuterDisp);
505bool M68kOperand::isPCIBD()
const {
506 return isMemOp() && MemOp.AtLeast68020 &&
507 (MemOp.Op == M68kMemOp::Kind::RegIndirectDisplacementIndex ||
508 MemOp.Op == M68kMemOp::Kind::RegIndirectDisplacement) &&
509 MemOp.OuterReg == M68k::PC;
511bool M68kOperand::isPCIBD32()
const {
515 (!MemOp.InnerReg.isValid() ||
516 getM68kMCRegisterClass(M68k::XR32RegClassID)
519bool M68kOperand::isPCIBD16()
const {
521 getM68kMCRegisterClass(M68k::XR16RegClassID).contains(MemOp.InnerReg);
523void M68kOperand::addPCIBDOperands(MCInst &Inst,
unsigned N)
const {
524 M68kOperand::addExpr(Inst, MemOp.OuterDisp);
530 bool SP,
bool FPDR =
false,
580bool M68kOperand::isAReg()
const {
586bool M68kOperand::isDReg()
const {
592bool M68kOperand::isFPDReg()
const {
599bool M68kOperand::isFPCReg()
const {
606unsigned M68kAsmParser::validateTargetOperandClass(MCParsedAsmOperand &
Op,
608 M68kOperand &Operand = (M68kOperand &)
Op;
613 if (Operand.isReg() &&
615 return Match_Success;
621 if (Operand.isReg() &&
623 return Match_Success;
628 if (Operand.isReg() &&
630 return Match_Success;
637 if (Operand.isReg() &&
639 return Match_Success;
644 if (Operand.isReg() &&
645 ((Operand.getReg() == M68k::A0) || (Operand.getReg() == M68k::A1))) {
646 return Match_Success;
651 if (Operand.isReg() &&
652 ((Operand.getReg() == M68k::D0) || (Operand.getReg() == M68k::D1))) {
653 return Match_Success;
658 if (Operand.isReg() &&
659 ((Operand.getReg() == M68k::D0) || (Operand.getReg() == M68k::D1) ||
660 (Operand.getReg() == M68k::A0) || (Operand.getReg() == M68k::A1))) {
661 return Match_Success;
666 return Match_InvalidOperand;
669bool M68kAsmParser::parseRegisterName(MCRegister &RegNo, SMLoc Loc,
670 StringRef RegisterName) {
671 auto RegisterNameLower = RegisterName.
lower();
674 if (RegisterNameLower ==
"ccr") {
677 }
else if (RegisterNameLower ==
"sr") {
683 if (RegisterNameLower.size() == 2) {
685 switch (RegisterNameLower[0]) {
688 if (isdigit(RegisterNameLower[1])) {
689 unsigned IndexOffset = (RegisterNameLower[0] ==
'a') ? 8 : 0;
690 unsigned RegIndex = (unsigned)(RegisterNameLower[1] -
'0');
700 if (RegisterNameLower[1] ==
'p') {
703 }
else if (RegisterNameLower[1] ==
'r') {
710 if (RegisterNameLower[1] ==
'c') {
716 }
else if (StringRef(RegisterNameLower).
starts_with(
"fp") &&
717 RegisterNameLower.size() > 2) {
718 auto RegIndex = unsigned(RegisterNameLower[2] -
'0');
719 if (RegIndex < 8 && RegisterNameLower.size() == 3) {
725 RegNo = StringSwitch<unsigned>(RegisterNameLower)
726 .Cases({
"fpc",
"fpcr"}, M68k::FPC)
727 .Cases({
"fps",
"fpsr"}, M68k::FPS)
728 .Cases({
"fpi",
"fpiar"}, M68k::FPIAR)
730 assert(RegNo != M68k::NoRegister &&
731 "Unrecognized FP control register name");
739ParseStatus M68kAsmParser::parseRegister(MCRegister &RegNo,
740 bool WithSizeSuffix) {
741 bool HasPercent =
false;
742 AsmToken PercentToken;
748 PercentToken = Lex();
755 getLexer().UnLex(PercentToken);
766 RegisterName = RegisterName.
drop_back(2);
769 if (!parseRegisterName(RegNo, Parser.
getLexer().
getLoc(), RegisterName)) {
771 getLexer().UnLex(PercentToken);
776 RegNo = MRI->
getSubReg(RegNo, M68k::MxSubRegIndex16Lo);
782bool M68kAsmParser::parseRegister(MCRegister &
Reg, SMLoc &StartLoc,
784 ParseStatus
Result = tryParseRegister(
Reg, StartLoc, EndLoc);
786 return Error(StartLoc,
"expected register");
791ParseStatus M68kAsmParser::tryParseRegister(MCRegister &
Reg, SMLoc &StartLoc,
793 StartLoc = getLexer().getLoc();
795 EndLoc = getLexer().getLoc();
799bool M68kAsmParser::isExpr() {
812ParseStatus M68kAsmParser::parseImm(
OperandVector &Operands) {
815 SMLoc
Start = getLexer().getLoc();
821 if (getParser().parseExpression(Expr, End))
824 Operands.
push_back(M68kOperand::createImm(Expr, Start, End));
828ParseStatus M68kAsmParser::parseMemOp(
OperandVector &Operands) {
829 SMLoc
Start = getLexer().getLoc();
833 MemOp.AtLeast68020 = STI->hasFeature(M68k::FeatureISA20);
837 ParseStatus
Result = parseRegOrMoveMask(Operands);
842 bool HasDisplacement =
false;
846 }
else if (isExpr()) {
849 HasDisplacement =
true;
853 if (HasDisplacement) {
854 MemOp.Op = M68kMemOp::Kind::Addr;
856 M68kOperand::createMemOp(MemOp, Start, getLexer().getLoc()));
860 return Error(getLexer().getLoc(),
"expected (");
867 if (!HasDisplacement && isExpr()) {
870 HasDisplacement =
true;
874 MemOp.Op = M68kMemOp::Kind::Addr;
876 M68kOperand::createMemOp(MemOp, Start, getLexer().getLoc()));
883 Result = parseRegister(MemOp.OuterReg);
888 return Error(getLexer().getLoc(),
"expected register");
895 Result = parseRegister(MemOp.InnerReg,
true);
900 return Error(getLexer().getLoc(),
"expected register");
905 const auto &ScaleTok = Parser.
Lex();
907 return Error(getLexer().getLoc(),
"expected scale");
908 int64_t ScaleVal = ScaleTok.getIntVal();
909 if (ScaleVal < 1 || ScaleVal > 8 || !
isPowerOf2_32(ScaleVal))
910 return Error(ScaleTok.getLoc(),
"expected scale to be 1, 2, 4, or 8");
911 MemOp.Scale =
static_cast<uint8_t
>(ScaleVal);
920 return Error(getLexer().getLoc(),
"expected )");
929 SMLoc End = getLexer().getLoc();
931 unsigned OpCount = IsPD + IsPI + (
HasIndex || HasDisplacement);
933 return Error(Start,
"only one of post-increment, pre-decrement or "
934 "displacement can be used");
937 MemOp.Op = M68kMemOp::Kind::RegPreDecrement;
939 MemOp.Op = M68kMemOp::Kind::RegPostIncrement;
940 }
else if (HasIndex) {
941 MemOp.Op = M68kMemOp::Kind::RegIndirectDisplacementIndex;
942 }
else if (HasDisplacement) {
943 MemOp.Op = M68kMemOp::Kind::RegIndirectDisplacement;
945 MemOp.Op = M68kMemOp::Kind::RegIndirect;
948 Operands.
push_back(M68kOperand::createMemOp(MemOp, Start, End));
952ParseStatus M68kAsmParser::parseRegOrMoveMask(
OperandVector &Operands) {
953 SMLoc
Start = getLexer().getLoc();
954 M68kMemOp MemOp(M68kMemOp::Kind::RegMask);
958 bool IsFirstRegister =
959 (MemOp.Op == M68kMemOp::Kind::RegMask) && (MemOp.RegMask == 0);
961 MCRegister FirstRegister;
962 ParseStatus
Result = parseRegister(FirstRegister);
963 if (IsFirstRegister &&
Result.isNoMatch())
966 return Error(getLexer().getLoc(),
"expected start register");
968 MCRegister LastRegister = FirstRegister;
970 Result = parseRegister(LastRegister);
972 return Error(getLexer().getLoc(),
"expected end register");
978 uint16_t NumNewBits = LastRegisterIndex - FirstRegisterIndex + 1;
979 uint16_t NewMaskBits = ((1 << NumNewBits) - 1) << FirstRegisterIndex;
981 if (IsFirstRegister && (FirstRegister == LastRegister)) {
984 MemOp.Op = M68kMemOp::Kind::Reg;
985 MemOp.OuterReg = FirstRegister;
987 if (MemOp.Op == M68kMemOp::Kind::Reg) {
990 MemOp.Op = M68kMemOp::Kind::RegMask;
993 if (MemOp.RegMask == 0)
994 return Error(getLexer().getLoc(),
995 "special registers cannot be used in register masks");
998 if ((FirstRegisterIndex >= 16) || (LastRegisterIndex >= 16))
999 return Error(getLexer().getLoc(),
1000 "special registers cannot be used in register masks");
1002 if (NewMaskBits & MemOp.RegMask)
1003 return Error(getLexer().getLoc(),
"conflicting masked registers");
1005 MemOp.RegMask |= NewMaskBits;
1013 M68kOperand::createMemOp(MemOp, Start, getLexer().getLoc()));
1017void M68kAsmParser::eatComma() {
1023bool M68kAsmParser::parseInstruction(ParseInstructionInfo &Info, StringRef Name,
1025 SMLoc
Start = getLexer().getLoc();
1026 Operands.
push_back(M68kOperand::createToken(Name, Start, Start));
1036 ParseStatus MatchResult = MatchOperandParserImpl(Operands, Name);
1041 SMLoc Loc = getLexer().getLoc();
1043 return Error(Loc,
"unexpected token parsing operands");
1051bool M68kAsmParser::invalidOperand(SMLoc Loc,
OperandVector const &Operands,
1052 uint64_t
const &ErrorInfo) {
1053 SMLoc ErrorLoc = Loc;
1054 char const *Diag = 0;
1056 if (ErrorInfo != ~0U) {
1057 if (ErrorInfo >= Operands.
size()) {
1058 Diag =
"too few operands for instruction.";
1060 auto const &
Op = (M68kOperand
const &)*Operands[ErrorInfo];
1061 if (
Op.getStartLoc() != SMLoc()) {
1062 ErrorLoc =
Op.getStartLoc();
1068 Diag =
"invalid operand for instruction";
1071 return Error(ErrorLoc, Diag);
1074bool M68kAsmParser::missingFeature(SMLoc Loc, uint64_t
const &ErrorInfo) {
1075 return Error(Loc,
"instruction requires a CPU feature not currently enabled");
1078bool M68kAsmParser::emit(MCInst &Inst, SMLoc Loc, MCStreamer &Out)
const {
1085bool M68kAsmParser::matchAndEmitInstruction(SMLoc Loc,
unsigned &Opcode,
1088 uint64_t &ErrorInfo,
1089 bool MatchingInlineAsm) {
1091 unsigned MatchResult =
1092 MatchInstructionImpl(Operands, Inst, ErrorInfo, MatchingInlineAsm);
1094 switch (MatchResult) {
1096 return emit(Inst, Loc, Out);
1097 case Match_MissingFeature:
1098 return missingFeature(Loc, ErrorInfo);
1099 case Match_InvalidOperand:
1100 return invalidOperand(Loc, Operands, ErrorInfo);
1101 case Match_MnemonicFail:
1102 return Error(Loc,
"invalid instruction");
1108void M68kOperand::print(raw_ostream &OS,
const MCAsmInfo &MAI)
const {
1110 case KindTy::Invalid:
1115 OS <<
"token '" << Token <<
"'";
1120 Expr->evaluateAsAbsolute(
Value);
1121 OS <<
"immediate " <<
Value;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static bool isNot(const MachineRegisterInfo &MRI, const MachineInstr &MI)
#define LLVM_EXTERNAL_VISIBILITY
static bool checkRegisterClass(unsigned RegNo, bool Data, bool Address, bool SP, bool FPDR=false, bool FPCR=false)
static cl::opt< bool > RegisterPrefixOptional("m68k-register-prefix-optional", cl::Hidden, cl::desc("Enable specifying registers without the % prefix"), cl::init(false))
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeM68kAsmParser()
static unsigned getRegisterByIndex(unsigned RegisterIndex)
static unsigned getRegisterIndex(unsigned Register)
This file contains the M68k implementation of the TargetInstrInfo class.
This file contains the declarations of the M68k MCAsmInfo properties.
This file contains the M68k implementation of the TargetRegisterInfo class.
static MCRegister getReg(const MCDisassembler *D, unsigned RC, unsigned RegNo)
static bool isReg(const MCInst &MI, unsigned OpNo)
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
SMLoc getLoc() const
Get the current source location.
bool isNot(TokenKind K) const
StringRef getString() const
Get the string for the current token, this includes all characters (for example, the quotes on string...
bool is(TokenKind K) const
TokenKind getKind() const
Base class for user error types.
virtual void Initialize(MCAsmParser &Parser)
Initialize the extension for parsing using the given Parser.
Generic assembler parser interface, for use by target specific assembly parsers.
virtual void eatToEndOfStatement()=0
Skip to the end of the current statement, for error recovery.
virtual bool parseExpression(const MCExpr *&Res, SMLoc &EndLoc)=0
Parse an arbitrary expression.
const AsmToken & getTok() const
Get the current AsmToken from the stream.
virtual const AsmToken & Lex()=0
Get the next AsmToken in the stream, possibly handling file inclusion first.
static LLVM_ABI const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Instances of this class represent a single low-level machine instruction.
void addOperand(const MCOperand Op)
Interface to description of machine instruction set.
static MCOperand createExpr(const MCExpr *Val)
static MCOperand createReg(MCRegister Reg)
static MCOperand createImm(int64_t Val)
MCParsedAsmOperand - This abstract class represents a source-level assembly instruction operand.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
MCRegister getSubReg(MCRegister Reg, unsigned Idx) const
Returns the physical register number of sub-register "Index" for physical register RegNo.
Wrapper class representing physical registers. Should be passed by value.
Streaming machine code generation interface.
virtual void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
Generic base class for all target subtargets.
const FeatureBitset & getFeatureBits() const
MCTargetAsmParser - Generic interface to target specific assembly parsers.
Ternary parse status returned by various parse* methods.
static constexpr StatusTy Failure
constexpr bool isSuccess() const
static constexpr StatusTy Success
static constexpr StatusTy NoMatch
Wrapper class representing virtual and physical registers.
Represents a location in source code.
void push_back(const T &Elt)
Represent a constant reference to a string, i.e.
LLVM_ABI std::string lower() const
StringRef drop_back(size_t N=1) const
Return a StringRef equal to 'this' but with the last N elements dropped.
LLVM_ABI bool ends_with_insensitive(StringRef Suffix) const
Check if this string ends with the given Suffix, ignoring case.
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.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr, unsigned DynamicVGPRBlockSize=0)
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
static bool isMem(const MachineInstr &MI, unsigned Op)
LLVM_ABI std::pair< StringRef, StringRef > getToken(StringRef Source, StringRef Delimiters=" \t\n\v\f\r")
getToken - This function extracts one token from source, ignoring any leading characters that appear ...
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
SmallVectorImpl< std::unique_ptr< MCParsedAsmOperand > > OperandVector
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
DWARFExpression::Operation Op
Target & getTheM68kTarget()
RegisterMCAsmParser - Helper template for registering a target specific assembly parser,...