60 #define GET_ASSEMBLER_HEADER 61 #include "SparcGenAsmMatcher.inc" 66 bool MatchAndEmitInstruction(
SMLoc IDLoc,
unsigned &Opcode,
69 bool MatchingInlineAsm)
override;
70 bool ParseRegister(
unsigned &RegNo,
SMLoc &StartLoc,
SMLoc &EndLoc)
override;
73 bool ParseDirective(
AsmToken DirectiveID)
override;
76 unsigned Kind)
override;
86 parseSparcAsmOperand(std::unique_ptr<SparcOperand> &Operand,
96 bool matchRegisterName(
const AsmToken &Tok,
unsigned &RegNo,
99 bool matchSparcAsmModifiers(
const MCExpr *&EVal,
SMLoc &EndLoc);
122 setAvailableFeatures(ComputeAvailableFeatures(getSTI().getFeatureBits()));
129 Sparc::G0, Sparc::G1, Sparc::G2, Sparc::G3,
130 Sparc::G4, Sparc::G5, Sparc::G6, Sparc::G7,
131 Sparc::O0, Sparc::O1, Sparc::O2, Sparc::O3,
132 Sparc::O4, Sparc::O5, Sparc::O6, Sparc::O7,
133 Sparc::L0, Sparc::L1, Sparc::L2, Sparc::L3,
134 Sparc::L4, Sparc::L5, Sparc::L6, Sparc::L7,
135 Sparc::I0, Sparc::I1, Sparc::I2, Sparc::I3,
136 Sparc::I4, Sparc::I5, Sparc::I6, Sparc::I7 };
139 Sparc::F0, Sparc::F1, Sparc::F2, Sparc::F3,
140 Sparc::F4, Sparc::F5, Sparc::F6, Sparc::F7,
141 Sparc::F8, Sparc::F9, Sparc::F10, Sparc::F11,
142 Sparc::F12, Sparc::F13, Sparc::F14, Sparc::F15,
143 Sparc::F16, Sparc::F17, Sparc::F18, Sparc::F19,
144 Sparc::F20, Sparc::F21, Sparc::F22, Sparc::F23,
145 Sparc::F24, Sparc::F25, Sparc::F26, Sparc::F27,
146 Sparc::F28, Sparc::F29, Sparc::F30, Sparc::F31 };
149 Sparc::D0, Sparc::D1, Sparc::D2, Sparc::D3,
150 Sparc::D4, Sparc::D5, Sparc::D6, Sparc::D7,
151 Sparc::D8, Sparc::D9, Sparc::D10, Sparc::D11,
152 Sparc::D12, Sparc::D13, Sparc::D14, Sparc::D15,
153 Sparc::D16, Sparc::D17, Sparc::D18, Sparc::D19,
154 Sparc::D20, Sparc::D21, Sparc::D22, Sparc::D23,
155 Sparc::D24, Sparc::D25, Sparc::D26, Sparc::D27,
156 Sparc::D28, Sparc::D29, Sparc::D30, Sparc::D31 };
159 Sparc::Q0, Sparc::Q1, Sparc::Q2, Sparc::Q3,
160 Sparc::Q4, Sparc::Q5, Sparc::Q6, Sparc::Q7,
161 Sparc::Q8, Sparc::Q9, Sparc::Q10, Sparc::Q11,
162 Sparc::Q12, Sparc::Q13, Sparc::Q14, Sparc::Q15 };
165 SP::Y, SP::ASR1, SP::ASR2, SP::ASR3,
166 SP::ASR4, SP::ASR5, SP::ASR6, SP::ASR7,
167 SP::ASR8, SP::ASR9, SP::ASR10, SP::ASR11,
168 SP::ASR12, SP::ASR13, SP::ASR14, SP::ASR15,
169 SP::ASR16, SP::ASR17, SP::ASR18, SP::ASR19,
170 SP::ASR20, SP::ASR21, SP::ASR22, SP::ASR23,
171 SP::ASR24, SP::ASR25, SP::ASR26, SP::ASR27,
172 SP::ASR28, SP::ASR29, SP::ASR30, SP::ASR31};
175 Sparc::G0_G1, Sparc::G2_G3, Sparc::G4_G5, Sparc::G6_G7,
176 Sparc::O0_O1, Sparc::O2_O3, Sparc::O4_O5, Sparc::O6_O7,
177 Sparc::L0_L1, Sparc::L2_L3, Sparc::L4_L5, Sparc::L6_L7,
178 Sparc::I0_I1, Sparc::I2_I3, Sparc::I4_I5, Sparc::I6_I7};
181 Sparc::C0, Sparc::C1, Sparc::C2, Sparc::C3,
182 Sparc::C4, Sparc::C5, Sparc::C6, Sparc::C7,
183 Sparc::C8, Sparc::C9, Sparc::C10, Sparc::C11,
184 Sparc::C12, Sparc::C13, Sparc::C14, Sparc::C15,
185 Sparc::C16, Sparc::C17, Sparc::C18, Sparc::C19,
186 Sparc::C20, Sparc::C21, Sparc::C22, Sparc::C23,
187 Sparc::C24, Sparc::C25, Sparc::C26, Sparc::C27,
188 Sparc::C28, Sparc::C29, Sparc::C30, Sparc::C31 };
191 Sparc::C0_C1, Sparc::C2_C3, Sparc::C4_C5, Sparc::C6_C7,
192 Sparc::C8_C9, Sparc::C10_C11, Sparc::C12_C13, Sparc::C14_C15,
193 Sparc::C16_C17, Sparc::C18_C19, Sparc::C20_C21, Sparc::C22_C23,
194 Sparc::C24_C25, Sparc::C26_C27, Sparc::C28_C29, Sparc::C30_C31};
223 SMLoc StartLoc, EndLoc;
255 bool isToken()
const override {
return Kind == k_Token; }
256 bool isReg()
const override {
return Kind == k_Register; }
257 bool isImm()
const override {
return Kind == k_Immediate; }
258 bool isMem()
const override {
return isMEMrr() || isMEMri(); }
259 bool isMEMrr()
const {
return Kind == k_MemoryReg; }
260 bool isMEMri()
const {
return Kind == k_MemoryImm; }
261 bool isMembarTag()
const {
return Kind == k_Immediate; }
264 return (Kind == k_Register &&
Reg.Kind == rk_IntReg);
267 bool isFloatReg()
const {
268 return (Kind == k_Register &&
Reg.Kind == rk_FloatReg);
271 bool isFloatOrDoubleReg()
const {
272 return (Kind == k_Register && (
Reg.Kind == rk_FloatReg
273 ||
Reg.Kind == rk_DoubleReg));
276 bool isCoprocReg()
const {
277 return (Kind == k_Register &&
Reg.Kind == rk_CoprocReg);
281 assert(Kind == k_Token &&
"Invalid access!");
285 unsigned getReg()
const override {
286 assert((Kind == k_Register) &&
"Invalid access!");
290 const MCExpr *getImm()
const {
291 assert((Kind == k_Immediate) &&
"Invalid access!");
295 unsigned getMemBase()
const {
296 assert((Kind == k_MemoryReg || Kind == k_MemoryImm) &&
"Invalid access!");
300 unsigned getMemOffsetReg()
const {
301 assert((Kind == k_MemoryReg) &&
"Invalid access!");
302 return Mem.OffsetReg;
305 const MCExpr *getMemOff()
const {
306 assert((Kind == k_MemoryImm) &&
"Invalid access!");
311 SMLoc getStartLoc()
const override {
315 SMLoc getEndLoc()
const override {
321 case k_Token: OS <<
"Token: " <<
getToken() <<
"\n";
break;
322 case k_Register: OS <<
"Reg: #" <<
getReg() <<
"\n";
break;
323 case k_Immediate: OS <<
"Imm: " << getImm() <<
"\n";
break;
324 case k_MemoryReg: OS <<
"Mem: " << getMemBase() <<
"+" 325 << getMemOffsetReg() <<
"\n";
break;
326 case k_MemoryImm:
assert(getMemOff() !=
nullptr);
327 OS <<
"Mem: " << getMemBase()
328 <<
"+" << *getMemOff()
333 void addRegOperands(
MCInst &Inst,
unsigned N)
const {
334 assert(N == 1 &&
"Invalid number of operands!");
338 void addImmOperands(
MCInst &Inst,
unsigned N)
const {
339 assert(N == 1 &&
"Invalid number of operands!");
340 const MCExpr *Expr = getImm();
348 else if (
const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(Expr))
354 void addMEMrrOperands(
MCInst &Inst,
unsigned N)
const {
355 assert(N == 2 &&
"Invalid number of operands!");
359 assert(getMemOffsetReg() != 0 &&
"Invalid offset");
363 void addMEMriOperands(
MCInst &Inst,
unsigned N)
const {
364 assert(N == 2 &&
"Invalid number of operands!");
368 const MCExpr *Expr = getMemOff();
372 void addMembarTagOperands(
MCInst &Inst,
unsigned N)
const {
373 assert(N == 1 &&
"Invalid number of operands!");
374 const MCExpr *Expr = getImm();
378 static std::unique_ptr<SparcOperand> CreateToken(
StringRef Str,
SMLoc S) {
379 auto Op = std::make_unique<SparcOperand>(k_Token);
380 Op->Tok.Data = Str.
data();
381 Op->Tok.Length = Str.
size();
387 static std::unique_ptr<SparcOperand> CreateReg(
unsigned RegNum,
unsigned Kind,
389 auto Op = std::make_unique<SparcOperand>(k_Register);
390 Op->Reg.RegNum = RegNum;
397 static std::unique_ptr<SparcOperand> CreateImm(
const MCExpr *Val,
SMLoc S,
399 auto Op = std::make_unique<SparcOperand>(k_Immediate);
406 static bool MorphToIntPairReg(SparcOperand &
Op) {
407 unsigned Reg = Op.getReg();
408 assert(Op.Reg.Kind == rk_IntReg);
409 unsigned regIdx = 32;
410 if (Reg >= Sparc::G0 && Reg <= Sparc::G7)
411 regIdx = Reg - Sparc::G0;
412 else if (Reg >= Sparc::O0 && Reg <= Sparc::O7)
413 regIdx = Reg - Sparc::O0 + 8;
414 else if (Reg >= Sparc::L0 && Reg <= Sparc::L7)
415 regIdx = Reg - Sparc::L0 + 16;
416 else if (Reg >= Sparc::I0 && Reg <= Sparc::I7)
417 regIdx = Reg - Sparc::I0 + 24;
418 if (regIdx % 2 || regIdx > 31)
420 Op.Reg.RegNum = IntPairRegs[regIdx / 2];
421 Op.Reg.Kind = rk_IntPairReg;
425 static bool MorphToDoubleReg(SparcOperand &Op) {
426 unsigned Reg = Op.getReg();
427 assert(Op.Reg.Kind == rk_FloatReg);
428 unsigned regIdx = Reg - Sparc::F0;
429 if (regIdx % 2 || regIdx > 31)
431 Op.Reg.RegNum = DoubleRegs[regIdx / 2];
432 Op.Reg.Kind = rk_DoubleReg;
436 static bool MorphToQuadReg(SparcOperand &Op) {
437 unsigned Reg = Op.getReg();
439 switch (Op.Reg.Kind) {
442 regIdx = Reg - Sparc::F0;
443 if (regIdx % 4 || regIdx > 31)
445 Reg = QuadFPRegs[regIdx / 4];
448 regIdx = Reg - Sparc::D0;
449 if (regIdx % 2 || regIdx > 31)
451 Reg = QuadFPRegs[regIdx / 2];
455 Op.Reg.Kind = rk_QuadReg;
459 static bool MorphToCoprocPairReg(SparcOperand &Op) {
460 unsigned Reg = Op.getReg();
461 assert(Op.Reg.Kind == rk_CoprocReg);
462 unsigned regIdx = 32;
463 if (Reg >= Sparc::C0 && Reg <= Sparc::C31)
464 regIdx = Reg - Sparc::C0;
465 if (regIdx % 2 || regIdx > 31)
467 Op.Reg.RegNum = CoprocPairRegs[regIdx / 2];
468 Op.Reg.Kind = rk_CoprocPairReg;
472 static std::unique_ptr<SparcOperand>
473 MorphToMEMrr(
unsigned Base, std::unique_ptr<SparcOperand> Op) {
474 unsigned offsetReg = Op->getReg();
475 Op->Kind = k_MemoryReg;
477 Op->Mem.OffsetReg = offsetReg;
478 Op->Mem.Off =
nullptr;
482 static std::unique_ptr<SparcOperand>
484 auto Op = std::make_unique<SparcOperand>(k_MemoryReg);
486 Op->Mem.OffsetReg = Sparc::G0;
487 Op->Mem.Off =
nullptr;
493 static std::unique_ptr<SparcOperand>
494 MorphToMEMri(
unsigned Base, std::unique_ptr<SparcOperand> Op) {
495 const MCExpr *Imm = Op->getImm();
496 Op->Kind = k_MemoryImm;
498 Op->Mem.OffsetReg = 0;
506 bool SparcAsmParser::expandSET(
MCInst &Inst,
SMLoc IDLoc,
515 int64_t RawImmValue = IsImm ? MCValOp.
getImm() : 0;
518 if (RawImmValue < -2147483648LL || RawImmValue > 4294967295LL) {
520 "set: argument must be between -2147483648 and 4294967295");
525 int32_t ImmValue = RawImmValue;
529 bool IsEffectivelyImm13 =
530 IsImm && ((
is64Bit() ? 0 : -4096) <= ImmValue && ImmValue < 4096);
542 if (!IsEffectivelyImm13) {
563 if (!IsImm || IsEffectivelyImm13 || (ImmValue & 0x3ff)) {
566 if (IsEffectivelyImm13)
580 bool SparcAsmParser::MatchAndEmitInstruction(
SMLoc IDLoc,
unsigned &Opcode,
584 bool MatchingInlineAsm) {
587 unsigned MatchResult = MatchInstructionImpl(Operands, Inst, ErrorInfo,
589 switch (MatchResult) {
590 case Match_Success: {
597 if (expandSET(Inst, IDLoc, Instructions))
602 for (
const MCInst &
I : Instructions) {
608 case Match_MissingFeature:
610 "instruction requires a CPU feature not currently enabled");
612 case Match_InvalidOperand: {
613 SMLoc ErrorLoc = IDLoc;
614 if (ErrorInfo != ~0ULL) {
615 if (ErrorInfo >= Operands.
size())
616 return Error(IDLoc,
"too few operands for instruction");
618 ErrorLoc = ((SparcOperand &)*Operands[ErrorInfo]).getStartLoc();
619 if (ErrorLoc ==
SMLoc())
623 return Error(ErrorLoc,
"invalid operand for instruction");
625 case Match_MnemonicFail:
626 return Error(IDLoc,
"invalid instruction mnemonic");
631 bool SparcAsmParser::ParseRegister(
unsigned &RegNo,
SMLoc &StartLoc,
640 unsigned regKind = SparcOperand::rk_None;
641 if (matchRegisterName(Tok, RegNo, regKind)) {
646 return Error(StartLoc,
"invalid register name");
658 Operands.
push_back(SparcOperand::CreateToken(Name, NameLoc));
667 SMLoc Loc = getLexer().getLoc();
668 return Error(Loc,
"unexpected token");
672 SMLoc Loc = getLexer().getLoc();
673 return Error(Loc,
"unexpected token");
684 SMLoc Loc = getLexer().getLoc();
685 return Error(Loc,
"unexpected token");
690 SMLoc Loc = getLexer().getLoc();
691 return Error(Loc,
"unexpected token");
697 bool SparcAsmParser::
698 ParseDirective(
AsmToken DirectiveID)
702 if (IDVal ==
".register") {
707 if (IDVal ==
".proc") {
721 unsigned BaseReg = 0;
723 if (ParseRegister(BaseReg, S, E)) {
727 switch (getLexer().getKind()) {
733 Operands.
push_back(SparcOperand::CreateMEMr(BaseReg, S, E));
743 std::unique_ptr<SparcOperand>
Offset;
749 Offset->isImm() ? SparcOperand::MorphToMEMri(BaseReg, std::move(Offset))
750 : SparcOperand::MorphToMEMrr(BaseReg, std::move(Offset)));
760 std::unique_ptr<SparcOperand>
Mask;
762 if (!Mask->isImm() || !Mask->getImm()->evaluateAsAbsolute(ImmVal) ||
763 ImmVal < 0 || ImmVal > 127) {
764 Error(S,
"invalid membar mask number");
770 SMLoc TagStart = getLexer().getLoc();
773 .Case(
"LoadLoad", 0x1)
774 .
Case(
"StoreLoad", 0x2)
775 .
Case(
"LoadStore", 0x4)
776 .
Case(
"StoreStore", 0x8)
777 .
Case(
"Lookaside", 0x10)
778 .
Case(
"MemIssue", 0x20)
785 Error(TagStart,
"unknown membar tag");
797 Operands.
push_back(SparcOperand::CreateImm(EVal, S, E));
814 Operands.
push_back(SparcOperand::CreateToken(
"[",
818 if (Mnemonic ==
"cas" || Mnemonic ==
"casx" || Mnemonic ==
"casa") {
830 Operands.
push_back(SparcOperand::CreateReg(RegNo, RegKind, S, E));
833 ResTy = parseMEMOperand(Operands);
842 Operands.
push_back(SparcOperand::CreateToken(
"]",
848 std::unique_ptr<SparcOperand>
Op;
849 ResTy = parseSparcAsmOperand(Op,
false);
857 std::unique_ptr<SparcOperand>
Op;
859 ResTy = parseSparcAsmOperand(Op, (Mnemonic ==
"call"));
870 SparcAsmParser::parseSparcAsmOperand(std::unique_ptr<SparcOperand> &
Op,
877 switch (getLexer().getKind()) {
890 Op = SparcOperand::CreateReg(RegNo, RegKind, S, E);
893 Op = SparcOperand::CreateToken(
"%psr", S);
896 Op = SparcOperand::CreateToken(
"%fsr", S);
899 Op = SparcOperand::CreateToken(
"%fq", S);
902 Op = SparcOperand::CreateToken(
"%csr", S);
905 Op = SparcOperand::CreateToken(
"%cq", S);
908 Op = SparcOperand::CreateToken(
"%wim", S);
911 Op = SparcOperand::CreateToken(
"%tbr", S);
915 Op = SparcOperand::CreateToken(
"%xcc", S);
917 Op = SparcOperand::CreateToken(
"%icc", S);
922 if (matchSparcAsmModifiers(EVal, E)) {
924 Op = SparcOperand::CreateImm(EVal, S, E);
932 if (!getParser().parseExpression(EVal, E))
933 Op = SparcOperand::CreateImm(EVal, S, E);
938 if (!getParser().parseIdentifier(Identifier)) {
940 MCSymbol *Sym = getContext().getOrCreateSymbol(Identifier);
946 if (getContext().getObjectFileInfo()->isPositionIndependent()) {
955 Op = SparcOperand::CreateImm(Res, S, E);
964 SparcAsmParser::parseBranchModifiers(
OperandVector &Operands) {
973 if (modName ==
"a" || modName ==
"pn" || modName ==
"pt") {
974 Operands.
push_back(SparcOperand::CreateToken(modName,
982 bool SparcAsmParser::matchRegisterName(
const AsmToken &Tok,
unsigned &RegNo,
986 RegKind = SparcOperand::rk_None;
993 RegKind = SparcOperand::rk_IntReg;
999 RegKind = SparcOperand::rk_IntReg;
1005 RegKind = SparcOperand::rk_Special;
1011 && intVal > 0 && intVal < 32) {
1012 RegNo = ASRRegs[intVal];
1013 RegKind = SparcOperand::rk_Special;
1018 if (name.
equals(
"fprs")) {
1020 RegKind = SparcOperand::rk_Special;
1024 if (name.
equals(
"icc")) {
1026 RegKind = SparcOperand::rk_Special;
1030 if (name.
equals(
"psr")) {
1032 RegKind = SparcOperand::rk_Special;
1036 if (name.
equals(
"fsr")) {
1038 RegKind = SparcOperand::rk_Special;
1044 RegKind = SparcOperand::rk_Special;
1048 if (name.
equals(
"csr")) {
1049 RegNo = Sparc::CPSR;
1050 RegKind = SparcOperand::rk_Special;
1056 RegKind = SparcOperand::rk_Special;
1060 if (name.
equals(
"wim")) {
1062 RegKind = SparcOperand::rk_Special;
1066 if (name.
equals(
"tbr")) {
1068 RegKind = SparcOperand::rk_Special;
1072 if (name.
equals(
"xcc")) {
1075 RegKind = SparcOperand::rk_Special;
1084 RegNo = Sparc::FCC0 + intVal;
1085 RegKind = SparcOperand::rk_Special;
1093 RegNo = IntRegs[intVal];
1094 RegKind = SparcOperand::rk_IntReg;
1101 RegNo = IntRegs[8 + intVal];
1102 RegKind = SparcOperand::rk_IntReg;
1108 RegNo = IntRegs[16 + intVal];
1109 RegKind = SparcOperand::rk_IntReg;
1115 RegNo = IntRegs[24 + intVal];
1116 RegKind = SparcOperand::rk_IntReg;
1122 RegNo = FloatRegs[intVal];
1123 RegKind = SparcOperand::rk_FloatReg;
1129 && intVal >= 32 && intVal <= 62 && (intVal % 2 == 0)) {
1131 RegNo = DoubleRegs[intVal/2];
1132 RegKind = SparcOperand::rk_DoubleReg;
1139 RegNo = IntRegs[intVal];
1140 RegKind = SparcOperand::rk_IntReg;
1148 RegNo = CoprocRegs[intVal];
1149 RegKind = SparcOperand::rk_CoprocReg;
1153 if (name.
equals(
"tpc")) {
1155 RegKind = SparcOperand::rk_Special;
1158 if (name.
equals(
"tnpc")) {
1159 RegNo = Sparc::TNPC;
1160 RegKind = SparcOperand::rk_Special;
1163 if (name.
equals(
"tstate")) {
1164 RegNo = Sparc::TSTATE;
1165 RegKind = SparcOperand::rk_Special;
1170 RegKind = SparcOperand::rk_Special;
1173 if (name.
equals(
"tick")) {
1174 RegNo = Sparc::TICK;
1175 RegKind = SparcOperand::rk_Special;
1178 if (name.
equals(
"tba")) {
1180 RegKind = SparcOperand::rk_Special;
1183 if (name.
equals(
"pstate")) {
1184 RegNo = Sparc::PSTATE;
1185 RegKind = SparcOperand::rk_Special;
1190 RegKind = SparcOperand::rk_Special;
1193 if (name.
equals(
"pil")) {
1195 RegKind = SparcOperand::rk_Special;
1198 if (name.
equals(
"cwp")) {
1200 RegKind = SparcOperand::rk_Special;
1203 if (name.
equals(
"cansave")) {
1204 RegNo = Sparc::CANSAVE;
1205 RegKind = SparcOperand::rk_Special;
1208 if (name.
equals(
"canrestore")) {
1209 RegNo = Sparc::CANRESTORE;
1210 RegKind = SparcOperand::rk_Special;
1213 if (name.
equals(
"cleanwin")) {
1214 RegNo = Sparc::CLEANWIN;
1215 RegKind = SparcOperand::rk_Special;
1218 if (name.
equals(
"otherwin")) {
1219 RegNo = Sparc::OTHERWIN;
1220 RegKind = SparcOperand::rk_Special;
1223 if (name.
equals(
"wstate")) {
1224 RegNo = Sparc::WSTATE;
1225 RegKind = SparcOperand::rk_Special;
1237 if (
const SparcMCExpr *SE = dyn_cast<SparcMCExpr>(Expr))
1268 if (getContext().getObjectFileInfo()->isPositionIndependent()) {
1285 bool SparcAsmParser::matchSparcAsmModifiers(
const MCExpr *&EVal,
1307 EVal = adjustPICRelocation(VK, subExpr);
1317 #define GET_REGISTER_MATCHER 1318 #define GET_MATCHER_IMPLEMENTATION 1319 #include "SparcGenAsmMatcher.inc" 1323 SparcOperand &Op = (SparcOperand &)GOp;
1324 if (Op.isFloatOrDoubleReg()) {
1328 if (!Op.isFloatReg() || SparcOperand::MorphToDoubleReg(Op))
1332 if (SparcOperand::MorphToQuadReg(Op))
1337 if (Op.isIntReg() && Kind == MCK_IntPair) {
1338 if (SparcOperand::MorphToIntPairReg(Op))
1341 if (Op.isCoprocReg() && Kind == MCK_CoprocPair) {
1342 if (SparcOperand::MorphToCoprocPairReg(Op))
1345 return Match_InvalidOperand;
static bool isReg(const MCInst &MI, unsigned OpNo)
StringRef getString() const
Get the string for the current token, this includes all characters (for example, the quotes on string...
static const MCPhysReg IntRegs[32]
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
This class represents lattice values for constants.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
LLVM_NODISCARD bool equals_lower(StringRef RHS) const
equals_lower - Check for string equality, ignoring case.
Generic assembler parser interface, for use by target specific assembly parsers.
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.
void push_back(const T &Elt)
static const MCPhysReg CoprocPairRegs[]
const MCExpr * getLHS() const
Get the left-hand side expression of the binary operator.
virtual const AsmToken & Lex()=0
Get the next AsmToken in the stream, possibly handling file inclusion first.
const AsmToken & getTok() const
Get the current AsmToken from the stream.
static const MCPhysReg ASRRegs[32]
virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
StringSwitch & Case(StringLiteral S, T Value)
static const MCPhysReg QuadFPRegs[32]
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
static MCOperand createReg(unsigned Reg)
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)
Target independent representation for an assembler token.
Represent a reference to a symbol from inside an expression.
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.
const MCExpr * getRHS() const
Get the right-hand side expression of the binary operator.
LLVM_NODISCARD size_t size() const
size - Get the string size.
Target & getTheSparcTarget()
const MCExpr * getExpr() const
Instances of this class represent a single low-level machine instruction.
Analysis containing CSE Info
virtual void eatToEndOfStatement()=0
Skip to the end of the current statement, for error recovery.
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false)
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
virtual void addAliasForDirective(StringRef Directive, StringRef Alias)=0
const char * getPointer() const
A switch()-like statement whose cases are string literals.
Streaming machine code generation interface.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Container class for subtarget features.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Interface to description of machine instruction set.
Target & getTheSparcelTarget()
static VariantKind parseVariantKind(StringRef name)
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
static bool hasGOTReference(const MCExpr *Expr)
Binary assembler expressions.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeSparcAsmParser()
std::enable_if< std::numeric_limits< T >::is_signed, bool >::type getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
void setOpcode(unsigned Op)
const MCSymbol & getSymbol() const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
const MCOperand & getOperand(unsigned i) const
static const MCPhysReg CoprocRegs[32]
#define LLVM_EXTERNAL_VISIBILITY
bool is(TokenKind K) const
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
static const MCPhysReg IntPairRegs[]
Base class for user error types.
Target & getTheSparcV9Target()
static SMLoc getFromPointer(const char *Ptr)
LLVM_NODISCARD bool equals(StringRef RHS) const
equals - Check for string equality, this is more efficient than compare() when the relative ordering ...
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
Generic base class for all target subtargets.
References to labels and assigned expressions.
static const SparcMCExpr * create(VariantKind Kind, const MCExpr *Expr, MCContext &Ctx)
StringRef getName() const
getName - Get the symbol name.
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())
static const MCPhysReg FloatRegs[32]
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
static void applyMnemonicAliases(StringRef &Mnemonic, const FeatureBitset &Features, unsigned VariantID)
This class implements an extremely fast bulk output stream that can only output to a stream...
bool isIntReg(unsigned Reg)
void addOperand(const MCOperand &Op)
StringRef - Represent a constant reference to a string, i.e.
Target specific expression.
Represents a location in source code.
unsigned getOpcode() const
Instances of this class represent operands of the MCInst class.
virtual bool parseParenExpression(const MCExpr *&Res, SMLoc &EndLoc)=0
Parse an arbitrary expression, assuming that an initial '(' has already been consumed.
static MCOperand createImm(int64_t Val)
static bool is64Bit(const char *name)
TokenKind getKind() const
static const MCPhysReg DoubleRegs[32]