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 = 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 = 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 = 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 = 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");
657 Operands.
push_back(SparcOperand::CreateToken(Name, NameLoc));
666 SMLoc Loc = getLexer().getLoc();
667 return Error(Loc,
"unexpected token");
671 SMLoc Loc = getLexer().getLoc();
672 return Error(Loc,
"unexpected token");
683 SMLoc Loc = getLexer().getLoc();
684 return Error(Loc,
"unexpected token");
689 SMLoc Loc = getLexer().getLoc();
690 return Error(Loc,
"unexpected token");
696 bool SparcAsmParser::
697 ParseDirective(
AsmToken DirectiveID)
701 if (IDVal ==
".register") {
706 if (IDVal ==
".proc") {
720 unsigned BaseReg = 0;
722 if (ParseRegister(BaseReg, S, E)) {
726 switch (getLexer().getKind()) {
732 Operands.
push_back(SparcOperand::CreateMEMr(BaseReg, S, E));
742 std::unique_ptr<SparcOperand>
Offset;
748 Offset->isImm() ? SparcOperand::MorphToMEMri(BaseReg, std::move(Offset))
749 : SparcOperand::MorphToMEMrr(BaseReg, std::move(Offset)));
759 std::unique_ptr<SparcOperand>
Mask;
761 if (!Mask->isImm() || !Mask->getImm()->evaluateAsAbsolute(ImmVal) ||
762 ImmVal < 0 || ImmVal > 127) {
763 Error(S,
"invalid membar mask number");
769 SMLoc TagStart = getLexer().getLoc();
772 .Case(
"LoadLoad", 0x1)
773 .
Case(
"StoreLoad", 0x2)
774 .
Case(
"LoadStore", 0x4)
775 .
Case(
"StoreStore", 0x8)
776 .
Case(
"Lookaside", 0x10)
777 .
Case(
"MemIssue", 0x20)
784 Error(TagStart,
"unknown membar tag");
796 Operands.
push_back(SparcOperand::CreateImm(EVal, S, E));
813 Operands.
push_back(SparcOperand::CreateToken(
"[",
817 if (Mnemonic ==
"cas" || Mnemonic ==
"casx" || Mnemonic ==
"casa") {
829 Operands.
push_back(SparcOperand::CreateReg(RegNo, RegKind, S, E));
832 ResTy = parseMEMOperand(Operands);
841 Operands.
push_back(SparcOperand::CreateToken(
"]",
847 std::unique_ptr<SparcOperand>
Op;
848 ResTy = parseSparcAsmOperand(Op,
false);
856 std::unique_ptr<SparcOperand>
Op;
858 ResTy = parseSparcAsmOperand(Op, (Mnemonic ==
"call"));
869 SparcAsmParser::parseSparcAsmOperand(std::unique_ptr<SparcOperand> &
Op,
876 switch (getLexer().getKind()) {
889 Op = SparcOperand::CreateReg(RegNo, RegKind, S, E);
892 Op = SparcOperand::CreateToken(
"%psr", S);
895 Op = SparcOperand::CreateToken(
"%fsr", S);
898 Op = SparcOperand::CreateToken(
"%fq", S);
901 Op = SparcOperand::CreateToken(
"%csr", S);
904 Op = SparcOperand::CreateToken(
"%cq", S);
907 Op = SparcOperand::CreateToken(
"%wim", S);
910 Op = SparcOperand::CreateToken(
"%tbr", S);
914 Op = SparcOperand::CreateToken(
"%xcc", S);
916 Op = SparcOperand::CreateToken(
"%icc", S);
921 if (matchSparcAsmModifiers(EVal, E)) {
923 Op = SparcOperand::CreateImm(EVal, S, E);
931 if (!getParser().parseExpression(EVal, E))
932 Op = SparcOperand::CreateImm(EVal, S, E);
937 if (!getParser().parseIdentifier(Identifier)) {
939 MCSymbol *Sym = getContext().getOrCreateSymbol(Identifier);
945 if (getContext().getObjectFileInfo()->isPositionIndependent()) {
954 Op = SparcOperand::CreateImm(Res, S, E);
963 SparcAsmParser::parseBranchModifiers(
OperandVector &Operands) {
972 if (modName ==
"a" || modName ==
"pn" || modName ==
"pt") {
973 Operands.
push_back(SparcOperand::CreateToken(modName,
981 bool SparcAsmParser::matchRegisterName(
const AsmToken &Tok,
unsigned &RegNo,
985 RegKind = SparcOperand::rk_None;
992 RegKind = SparcOperand::rk_IntReg;
998 RegKind = SparcOperand::rk_IntReg;
1004 RegKind = SparcOperand::rk_Special;
1010 && intVal > 0 && intVal < 32) {
1011 RegNo = ASRRegs[intVal];
1012 RegKind = SparcOperand::rk_Special;
1017 if (name.
equals(
"fprs")) {
1019 RegKind = SparcOperand::rk_Special;
1023 if (name.
equals(
"icc")) {
1025 RegKind = SparcOperand::rk_Special;
1029 if (name.
equals(
"psr")) {
1031 RegKind = SparcOperand::rk_Special;
1035 if (name.
equals(
"fsr")) {
1037 RegKind = SparcOperand::rk_Special;
1043 RegKind = SparcOperand::rk_Special;
1047 if (name.
equals(
"csr")) {
1048 RegNo = Sparc::CPSR;
1049 RegKind = SparcOperand::rk_Special;
1055 RegKind = SparcOperand::rk_Special;
1059 if (name.
equals(
"wim")) {
1061 RegKind = SparcOperand::rk_Special;
1065 if (name.
equals(
"tbr")) {
1067 RegKind = SparcOperand::rk_Special;
1071 if (name.
equals(
"xcc")) {
1074 RegKind = SparcOperand::rk_Special;
1083 RegNo = Sparc::FCC0 + intVal;
1084 RegKind = SparcOperand::rk_Special;
1092 RegNo = IntRegs[intVal];
1093 RegKind = SparcOperand::rk_IntReg;
1100 RegNo = IntRegs[8 + intVal];
1101 RegKind = SparcOperand::rk_IntReg;
1107 RegNo = IntRegs[16 + intVal];
1108 RegKind = SparcOperand::rk_IntReg;
1114 RegNo = IntRegs[24 + intVal];
1115 RegKind = SparcOperand::rk_IntReg;
1121 RegNo = FloatRegs[intVal];
1122 RegKind = SparcOperand::rk_FloatReg;
1128 && intVal >= 32 && intVal <= 62 && (intVal % 2 == 0)) {
1130 RegNo = DoubleRegs[intVal/2];
1131 RegKind = SparcOperand::rk_DoubleReg;
1138 RegNo = IntRegs[intVal];
1139 RegKind = SparcOperand::rk_IntReg;
1147 RegNo = CoprocRegs[intVal];
1148 RegKind = SparcOperand::rk_CoprocReg;
1152 if (name.
equals(
"tpc")) {
1154 RegKind = SparcOperand::rk_Special;
1157 if (name.
equals(
"tnpc")) {
1158 RegNo = Sparc::TNPC;
1159 RegKind = SparcOperand::rk_Special;
1162 if (name.
equals(
"tstate")) {
1163 RegNo = Sparc::TSTATE;
1164 RegKind = SparcOperand::rk_Special;
1169 RegKind = SparcOperand::rk_Special;
1172 if (name.
equals(
"tick")) {
1173 RegNo = Sparc::TICK;
1174 RegKind = SparcOperand::rk_Special;
1177 if (name.
equals(
"tba")) {
1179 RegKind = SparcOperand::rk_Special;
1182 if (name.
equals(
"pstate")) {
1183 RegNo = Sparc::PSTATE;
1184 RegKind = SparcOperand::rk_Special;
1189 RegKind = SparcOperand::rk_Special;
1192 if (name.
equals(
"pil")) {
1194 RegKind = SparcOperand::rk_Special;
1197 if (name.
equals(
"cwp")) {
1199 RegKind = SparcOperand::rk_Special;
1202 if (name.
equals(
"cansave")) {
1203 RegNo = Sparc::CANSAVE;
1204 RegKind = SparcOperand::rk_Special;
1207 if (name.
equals(
"canrestore")) {
1208 RegNo = Sparc::CANRESTORE;
1209 RegKind = SparcOperand::rk_Special;
1212 if (name.
equals(
"cleanwin")) {
1213 RegNo = Sparc::CLEANWIN;
1214 RegKind = SparcOperand::rk_Special;
1217 if (name.
equals(
"otherwin")) {
1218 RegNo = Sparc::OTHERWIN;
1219 RegKind = SparcOperand::rk_Special;
1222 if (name.
equals(
"wstate")) {
1223 RegNo = Sparc::WSTATE;
1224 RegKind = SparcOperand::rk_Special;
1236 if (
const SparcMCExpr *SE = dyn_cast<SparcMCExpr>(Expr))
1267 if (getContext().getObjectFileInfo()->isPositionIndependent()) {
1284 bool SparcAsmParser::matchSparcAsmModifiers(
const MCExpr *&EVal,
1306 EVal = adjustPICRelocation(VK, subExpr);
1316 #define GET_REGISTER_MATCHER 1317 #define GET_MATCHER_IMPLEMENTATION 1318 #include "SparcGenAsmMatcher.inc" 1322 SparcOperand &Op = (SparcOperand &)GOp;
1323 if (Op.isFloatOrDoubleReg()) {
1327 if (!Op.isFloatReg() || SparcOperand::MorphToDoubleReg(Op))
1331 if (SparcOperand::MorphToQuadReg(Op))
1336 if (Op.isIntReg() && Kind == MCK_IntPair) {
1337 if (SparcOperand::MorphToIntPairReg(Op))
1340 if (Op.isCoprocReg() && Kind == MCK_CoprocPair) {
1341 if (SparcOperand::MorphToCoprocPairReg(Op))
1344 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.
static MCOperand createExpr(const MCExpr *Val)
MCTargetAsmParser - Generic interface to target specific assembly parsers.
void push_back(const T &Elt)
static const MCPhysReg CoprocPairRegs[]
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
const FeatureBitset Features
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]
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI, bool PrintSchedInfo=false)
Emit the given Instruction into the current section.
static const MCPhysReg QuadFPRegs[32]
static void applyMnemonicAliases(StringRef &Mnemonic, uint64_t Features, unsigned VariantID)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
amdgpu Simplify well known AMD library false Value Value const Twine & Name
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.
Target independent representation for an assembler token.
Represent a reference to a symbol from inside an expression.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(T Value)
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.
Target & getTheSparcTarget()
const MCExpr * getExpr() const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
Instances of this class represent a single low-level machine instruction.
Analysis containing CSE Info
void LLVMInitializeSparcAsmParser()
virtual void eatToEndOfStatement()=0
Skip to the end of the current statement, for error recovery.
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")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static bool is64Bit(const char *name)
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.
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]
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.
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(StringLiteral S, T Value)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool equals(StringRef RHS) const
equals - Check for string equality, this is more efficient than compare() when the relative ordering ...
Target & getTheSparcV9Target()
static SMLoc getFromPointer(const char *Ptr)
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.
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.
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 const MCConstantExpr * create(int64_t Value, MCContext &Ctx)
TokenKind getKind() const
static const MCPhysReg DoubleRegs[32]