35 static unsigned RRegs[32] = {
36 PPC::R0, PPC::R1,
PPC::R2, PPC::R3,
38 PPC::R8, PPC::R9, PPC::R10, PPC::R11,
39 PPC::R12, PPC::R13, PPC::R14, PPC::R15,
40 PPC::R16, PPC::R17, PPC::R18, PPC::R19,
41 PPC::R20, PPC::R21, PPC::R22, PPC::R23,
42 PPC::R24, PPC::R25, PPC::R26, PPC::R27,
43 PPC::R28, PPC::R29, PPC::R30, PPC::R31
45 static unsigned RRegsNoR0[32] = {
49 PPC::R8, PPC::R9, PPC::R10, PPC::R11,
50 PPC::R12, PPC::R13, PPC::R14, PPC::R15,
51 PPC::R16, PPC::R17, PPC::R18, PPC::R19,
52 PPC::R20, PPC::R21, PPC::R22, PPC::R23,
53 PPC::R24, PPC::R25, PPC::R26, PPC::R27,
54 PPC::R28, PPC::R29, PPC::R30, PPC::R31
56 static unsigned XRegs[32] = {
57 PPC::X0, PPC::X1, PPC::X2, PPC::X3,
58 PPC::X4, PPC::X5, PPC::X6, PPC::X7,
59 PPC::X8, PPC::X9, PPC::X10, PPC::X11,
60 PPC::X12, PPC::X13, PPC::X14, PPC::X15,
61 PPC::X16, PPC::X17, PPC::X18, PPC::X19,
62 PPC::X20, PPC::X21, PPC::X22, PPC::X23,
63 PPC::X24, PPC::X25, PPC::X26, PPC::X27,
64 PPC::X28, PPC::X29, PPC::X30, PPC::X31
66 static unsigned XRegsNoX0[32] = {
68 PPC::X1, PPC::X2, PPC::X3,
69 PPC::X4, PPC::X5, PPC::X6, PPC::X7,
70 PPC::X8, PPC::X9, PPC::X10, PPC::X11,
71 PPC::X12, PPC::X13, PPC::X14, PPC::X15,
72 PPC::X16, PPC::X17, PPC::X18, PPC::X19,
73 PPC::X20, PPC::X21, PPC::X22, PPC::X23,
74 PPC::X24, PPC::X25, PPC::X26, PPC::X27,
75 PPC::X28, PPC::X29, PPC::X30, PPC::X31
77 static unsigned FRegs[32] = {
78 PPC::F0, PPC::F1, PPC::F2, PPC::F3,
79 PPC::F4, PPC::F5, PPC::F6, PPC::F7,
80 PPC::F8, PPC::F9, PPC::F10, PPC::F11,
81 PPC::F12, PPC::F13, PPC::F14, PPC::F15,
82 PPC::F16, PPC::F17, PPC::F18, PPC::F19,
83 PPC::F20, PPC::F21, PPC::F22, PPC::F23,
84 PPC::F24, PPC::F25, PPC::F26, PPC::F27,
85 PPC::F28, PPC::F29, PPC::F30, PPC::F31
87 static unsigned VRegs[32] = {
88 PPC::V0, PPC::V1,
PPC::V2, PPC::V3,
89 PPC::V4, PPC::V5, PPC::V6, PPC::V7,
90 PPC::V8, PPC::V9, PPC::V10, PPC::V11,
91 PPC::V12, PPC::V13, PPC::V14, PPC::V15,
92 PPC::V16, PPC::V17, PPC::V18, PPC::V19,
93 PPC::V20, PPC::V21, PPC::V22, PPC::V23,
94 PPC::V24, PPC::V25, PPC::V26, PPC::V27,
95 PPC::V28, PPC::V29, PPC::V30, PPC::V31
97 static unsigned CRBITRegs[32] = {
98 PPC::CR0LT, PPC::CR0GT, PPC::CR0EQ, PPC::CR0UN,
99 PPC::CR1LT, PPC::CR1GT, PPC::CR1EQ, PPC::CR1UN,
100 PPC::CR2LT, PPC::CR2GT, PPC::CR2EQ, PPC::CR2UN,
101 PPC::CR3LT, PPC::CR3GT, PPC::CR3EQ, PPC::CR3UN,
102 PPC::CR4LT, PPC::CR4GT, PPC::CR4EQ, PPC::CR4UN,
103 PPC::CR5LT, PPC::CR5GT, PPC::CR5EQ, PPC::CR5UN,
104 PPC::CR6LT, PPC::CR6GT, PPC::CR6EQ, PPC::CR6UN,
105 PPC::CR7LT, PPC::CR7GT, PPC::CR7EQ, PPC::CR7UN
107 static unsigned CRRegs[8] = {
108 PPC::CR0, PPC::CR1, PPC::CR2, PPC::CR3,
109 PPC::CR4, PPC::CR5, PPC::CR6, PPC::CR7
116 EvaluateCRExpr(
const MCExpr *E) {
122 int64_t Res = cast<MCConstantExpr>(E)->getValue();
123 return Res < 0 ? -1 : Res;
130 if (Name ==
"lt")
return 0;
131 if (Name ==
"gt")
return 1;
132 if (Name ==
"eq")
return 2;
133 if (Name ==
"so")
return 3;
134 if (Name ==
"un")
return 3;
136 if (Name ==
"cr0")
return 0;
137 if (Name ==
"cr1")
return 1;
138 if (Name ==
"cr2")
return 2;
139 if (Name ==
"cr3")
return 3;
140 if (Name ==
"cr4")
return 4;
141 if (Name ==
"cr5")
return 5;
142 if (Name ==
"cr6")
return 6;
143 if (Name ==
"cr7")
return 7;
153 int64_t LHSVal = EvaluateCRExpr(BE->
getLHS());
154 int64_t RHSVal = EvaluateCRExpr(BE->
getRHS());
157 if (LHSVal < 0 || RHSVal < 0)
166 return Res < 0 ? -1 : Res;
182 MCAsmLexer &getLexer()
const {
return Parser.getLexer(); }
184 void Warning(
SMLoc L,
const Twine &Msg) { Parser.Warning(L, Msg); }
187 bool isPPC64()
const {
return IsPPC64; }
190 unsigned &RegNo, int64_t &
IntVal);
192 virtual bool ParseRegister(
unsigned &RegNo,
SMLoc &StartLoc,
SMLoc &EndLoc);
197 bool ParseExpression(
const MCExpr *&EVal);
201 bool ParseDirectiveWord(
unsigned Size,
SMLoc L);
202 bool ParseDirectiveTC(
unsigned Size,
SMLoc L);
203 bool ParseDirectiveMachine(
SMLoc L);
205 bool MatchAndEmitInstruction(
SMLoc IDLoc,
unsigned &Opcode,
208 bool MatchingInlineAsm);
210 void ProcessInstruction(
MCInst &Inst,
216 #define GET_ASSEMBLER_HEADER
217 #include "PPCGenAsmMatcher.inc"
227 Triple TheTriple(STI.getTargetTriple());
231 setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits()));
238 virtual bool ParseDirective(
AsmToken DirectiveID);
242 virtual const MCExpr *applyModifierToExpr(
const MCExpr *E,
257 SMLoc StartLoc, EndLoc;
282 struct TLSRegOp TLSReg;
289 StartLoc = o.StartLoc;
309 SMLoc getStartLoc()
const {
return StartLoc; }
312 SMLoc getEndLoc()
const {
return EndLoc; }
315 bool isPPC64()
const {
return IsPPC64; }
317 int64_t getImm()
const {
318 assert(
Kind == Immediate &&
"Invalid access!");
322 const MCExpr *getExpr()
const {
323 assert(
Kind == Expression &&
"Invalid access!");
327 int64_t getExprCRVal()
const {
328 assert(
Kind == Expression &&
"Invalid access!");
332 const MCExpr *getTLSReg()
const {
333 assert(
Kind == TLSRegister &&
"Invalid access!");
338 assert(isRegNumber() &&
"Invalid access!");
339 return (
unsigned) Imm.Val;
342 unsigned getCCReg()
const {
343 assert(isCCRegNumber() &&
"Invalid access!");
344 return (
unsigned) (
Kind == Immediate ? Imm.Val : Expr.CRVal);
347 unsigned getCRBit()
const {
348 assert(isCRBitNumber() &&
"Invalid access!");
349 return (
unsigned) (
Kind == Immediate ? Imm.Val : Expr.CRVal);
352 unsigned getCRBitMask()
const {
353 assert(isCRBitMask() &&
"Invalid access!");
354 return 7 - countTrailingZeros<uint64_t>(Imm.Val);
357 bool isToken()
const {
return Kind == Token; }
358 bool isImm()
const {
return Kind == Immediate ||
Kind == Expression; }
359 bool isU5Imm()
const {
return Kind == Immediate && isUInt<5>(getImm()); }
360 bool isS5Imm()
const {
return Kind == Immediate && isInt<5>(getImm()); }
361 bool isU6Imm()
const {
return Kind == Immediate && isUInt<6>(getImm()); }
362 bool isU16Imm()
const {
return Kind == Expression ||
364 bool isS16Imm()
const {
return Kind == Expression ||
366 bool isS16ImmX4()
const {
return Kind == Expression ||
368 (getImm() & 3) == 0); }
369 bool isS17Imm()
const {
return Kind == Expression ||
370 (
Kind == Immediate && isInt<17>(getImm())); }
371 bool isTLSReg()
const {
return Kind == TLSRegister; }
372 bool isDirectBr()
const {
return Kind == Expression ||
373 (
Kind == Immediate && isInt<26>(getImm()) &&
374 (getImm() & 3) == 0); }
375 bool isCondBr()
const {
return Kind == Expression ||
377 (getImm() & 3) == 0); }
378 bool isRegNumber()
const {
return Kind == Immediate && isUInt<5>(getImm()); }
379 bool isCCRegNumber()
const {
return (
Kind == Expression
380 && isUInt<3>(getExprCRVal())) ||
382 && isUInt<3>(getImm())); }
383 bool isCRBitNumber()
const {
return (
Kind == Expression
384 && isUInt<5>(getExprCRVal())) ||
386 && isUInt<5>(getImm())); }
387 bool isCRBitMask()
const {
return Kind == Immediate &&
isUInt<8>(getImm()) &&
389 bool isMem()
const {
return false; }
390 bool isReg()
const {
return false; }
392 void addRegOperands(
MCInst &Inst,
unsigned N)
const {
396 void addRegGPRCOperands(
MCInst &Inst,
unsigned N)
const {
397 assert(N == 1 &&
"Invalid number of operands!");
401 void addRegGPRCNoR0Operands(
MCInst &Inst,
unsigned N)
const {
402 assert(N == 1 &&
"Invalid number of operands!");
406 void addRegG8RCOperands(
MCInst &Inst,
unsigned N)
const {
407 assert(N == 1 &&
"Invalid number of operands!");
411 void addRegG8RCNoX0Operands(
MCInst &Inst,
unsigned N)
const {
412 assert(N == 1 &&
"Invalid number of operands!");
416 void addRegGxRCOperands(
MCInst &Inst,
unsigned N)
const {
418 addRegG8RCOperands(Inst, N);
420 addRegGPRCOperands(Inst, N);
423 void addRegGxRCNoR0Operands(
MCInst &Inst,
unsigned N)
const {
425 addRegG8RCNoX0Operands(Inst, N);
427 addRegGPRCNoR0Operands(Inst, N);
430 void addRegF4RCOperands(
MCInst &Inst,
unsigned N)
const {
431 assert(N == 1 &&
"Invalid number of operands!");
435 void addRegF8RCOperands(
MCInst &Inst,
unsigned N)
const {
436 assert(N == 1 &&
"Invalid number of operands!");
440 void addRegVRRCOperands(
MCInst &Inst,
unsigned N)
const {
441 assert(N == 1 &&
"Invalid number of operands!");
445 void addRegCRBITRCOperands(
MCInst &Inst,
unsigned N)
const {
446 assert(N == 1 &&
"Invalid number of operands!");
450 void addRegCRRCOperands(
MCInst &Inst,
unsigned N)
const {
451 assert(N == 1 &&
"Invalid number of operands!");
455 void addCRBitMaskOperands(
MCInst &Inst,
unsigned N)
const {
456 assert(N == 1 &&
"Invalid number of operands!");
460 void addImmOperands(
MCInst &Inst,
unsigned N)
const {
461 assert(N == 1 &&
"Invalid number of operands!");
462 if (
Kind == Immediate)
468 void addBranchTargetOperands(
MCInst &Inst,
unsigned N)
const {
469 assert(N == 1 &&
"Invalid number of operands!");
470 if (
Kind == Immediate)
476 void addTLSRegOperands(
MCInst &Inst,
unsigned N)
const {
477 assert(N == 1 &&
"Invalid number of operands!");
482 assert(
Kind == Token &&
"Invalid access!");
488 static PPCOperand *CreateToken(
StringRef Str,
SMLoc S,
bool IsPPC64) {
489 PPCOperand *Op =
new PPCOperand(Token);
490 Op->Tok.Data = Str.
data();
491 Op->Tok.Length = Str.
size();
494 Op->IsPPC64 = IsPPC64;
498 static PPCOperand *CreateTokenWithStringCopy(
StringRef Str,
SMLoc S,
501 void *Mem = ::operator
new(
sizeof(PPCOperand) + Str.
size());
502 PPCOperand *Op =
new (Mem) PPCOperand(Token);
503 Op->Tok.Data = (
const char *)(Op + 1);
504 Op->Tok.Length = Str.
size();
508 Op->IsPPC64 = IsPPC64;
512 static PPCOperand *CreateImm(int64_t Val,
SMLoc S,
SMLoc E,
bool IsPPC64) {
513 PPCOperand *Op =
new PPCOperand(Immediate);
517 Op->IsPPC64 = IsPPC64;
521 static PPCOperand *CreateExpr(
const MCExpr *Val,
523 PPCOperand *Op =
new PPCOperand(Expression);
525 Op->Expr.CRVal = EvaluateCRExpr(Val);
528 Op->IsPPC64 = IsPPC64;
534 PPCOperand *Op =
new PPCOperand(TLSRegister);
535 Op->TLSReg.Sym = Sym;
538 Op->IsPPC64 = IsPPC64;
542 static PPCOperand *CreateFromMCExpr(
const MCExpr *Val,
545 return CreateImm(CE->getValue(), S, E, IsPPC64);
549 return CreateTLSReg(SRE, S, E, IsPPC64);
551 return CreateExpr(Val, S, E, IsPPC64);
566 getExpr()->print(OS);
569 getTLSReg()->print(OS);
576 ProcessInstruction(
MCInst &Inst,
634 TmpInst.
setOpcode(Opcode == PPC::EXTLWI? PPC::RLWINM : PPC::RLWINMo);
648 TmpInst.
setOpcode(Opcode == PPC::EXTRWI? PPC::RLWINM : PPC::RLWINMo);
662 TmpInst.
setOpcode(Opcode == PPC::INSLWI? PPC::RLWIMI : PPC::RLWIMIo);
677 TmpInst.
setOpcode(Opcode == PPC::INSRWI? PPC::RLWIMI : PPC::RLWIMIo);
691 TmpInst.
setOpcode(Opcode == PPC::ROTRWI? PPC::RLWINM : PPC::RLWINMo);
704 TmpInst.
setOpcode(Opcode == PPC::SLWI? PPC::RLWINM : PPC::RLWINMo);
717 TmpInst.
setOpcode(Opcode == PPC::SRWI? PPC::RLWINM : PPC::RLWINMo);
730 TmpInst.
setOpcode(Opcode == PPC::CLRRWI? PPC::RLWINM : PPC::RLWINMo);
740 case PPC::CLRLSLWIo: {
744 TmpInst.
setOpcode(Opcode == PPC::CLRLSLWI? PPC::RLWINM : PPC::RLWINMo);
758 TmpInst.
setOpcode(Opcode == PPC::EXTLDI? PPC::RLDICR : PPC::RLDICRo);
771 TmpInst.
setOpcode(Opcode == PPC::EXTRDI? PPC::RLDICL : PPC::RLDICLo);
784 TmpInst.
setOpcode(Opcode == PPC::INSRDI? PPC::RLDIMI : PPC::RLDIMIo);
797 TmpInst.
setOpcode(Opcode == PPC::ROTRDI? PPC::RLDICL : PPC::RLDICLo);
809 TmpInst.
setOpcode(Opcode == PPC::SLDI? PPC::RLDICR : PPC::RLDICRo);
821 TmpInst.
setOpcode(Opcode == PPC::SRDI? PPC::RLDICL : PPC::RLDICLo);
833 TmpInst.
setOpcode(Opcode == PPC::CLRRDI? PPC::RLDICR : PPC::RLDICRo);
842 case PPC::CLRLSLDIo: {
846 TmpInst.
setOpcode(Opcode == PPC::CLRLSLDI? PPC::RLDIC : PPC::RLDICo);
858 MatchAndEmitInstruction(
SMLoc IDLoc,
unsigned &Opcode,
861 bool MatchingInlineAsm) {
864 switch (MatchInstructionImpl(Operands, Inst, ErrorInfo, MatchingInlineAsm)) {
868 ProcessInstruction(Inst, Operands);
872 case Match_MissingFeature:
873 return Error(IDLoc,
"instruction use requires an option to be enabled");
874 case Match_MnemonicFail:
875 return Error(IDLoc,
"unrecognized instruction mnemonic");
876 case Match_InvalidOperand: {
877 SMLoc ErrorLoc = IDLoc;
878 if (ErrorInfo != ~0U) {
879 if (ErrorInfo >= Operands.
size())
880 return Error(IDLoc,
"too few operands for instruction");
882 ErrorLoc = ((PPCOperand*)Operands[ErrorInfo])->getStartLoc();
883 if (ErrorLoc ==
SMLoc()) ErrorLoc = IDLoc;
886 return Error(ErrorLoc,
"invalid operand for instruction");
899 RegNo = isPPC64()? PPC::LR8 : PPC::LR;
903 RegNo = isPPC64()? PPC::CTR8 : PPC::CTR;
933 ParseRegister(
unsigned &RegNo,
SMLoc &StartLoc,
SMLoc &EndLoc) {
934 const AsmToken &Tok = Parser.getTok();
945 return Error(StartLoc,
"invalid register name");
954 const MCExpr *PPCAsmParser::
955 ExtractModifierFromExpr(
const MCExpr *E,
957 MCContext &Context = getParser().getContext();
1008 const MCExpr *LHS = ExtractModifierFromExpr(BE->
getLHS(), LHSVariant);
1009 const MCExpr *RHS = ExtractModifierFromExpr(BE->
getRHS(), RHSVariant);
1014 if (!LHS) LHS = BE->
getLHS();
1015 if (!RHS) RHS = BE->
getRHS();
1018 Variant = RHSVariant;
1020 Variant = LHSVariant;
1021 else if (LHSVariant == RHSVariant)
1022 Variant = LHSVariant;
1037 const MCExpr *PPCAsmParser::
1038 FixupVariantKind(
const MCExpr *E) {
1039 MCContext &Context = getParser().getContext();
1087 ParseExpression(
const MCExpr *&EVal) {
1088 if (getParser().parseExpression(EVal))
1091 EVal = FixupVariantKind(EVal);
1094 const MCExpr *E = ExtractModifierFromExpr(EVal, Variant);
1103 SMLoc S = Parser.getTok().getLoc();
1109 switch (getLexer().getKind()) {
1118 Op = PPCOperand::CreateImm(IntVal, S, E, isPPC64());
1122 return Error(S,
"invalid register name");
1132 if (!ParseExpression(EVal))
1136 return Error(S,
"unknown operand");
1140 Op = PPCOperand::CreateFromMCExpr(EVal, S, E, isPPC64());
1144 bool TLSCall =
false;
1146 TLSCall = Ref->getSymbol().getName() ==
"__tls_get_addr";
1152 S = Parser.getTok().getLoc();
1153 if (ParseExpression(TLSSym))
1154 return Error(S,
"invalid TLS call expression");
1156 return Error(Parser.getTok().getLoc(),
"missing ')'");
1157 E = Parser.getTok().getLoc();
1160 Op = PPCOperand::CreateFromMCExpr(TLSSym, S, E, isPPC64());
1167 S = Parser.getTok().getLoc();
1170 switch (getLexer().getKind()) {
1175 return Error(S,
"invalid register name");
1180 if (getParser().parseAbsoluteExpression(IntVal) ||
1181 IntVal < 0 || IntVal > 31)
1182 return Error(S,
"invalid register number");
1186 return Error(S,
"invalid memory operand");
1190 return Error(Parser.getTok().getLoc(),
"missing ')'");
1191 E = Parser.getTok().getLoc();
1194 Op = PPCOperand::CreateImm(IntVal, S, E, isPPC64());
1208 std::string NewOpcode;
1223 size_t Dot = Name.
find(
'.');
1225 if (!NewOpcode.empty())
1227 PPCOperand::CreateTokenWithStringCopy(Mnemonic, NameLoc, isPPC64()));
1229 Operands.
push_back(PPCOperand::CreateToken(Mnemonic, NameLoc, isPPC64()));
1233 if (!NewOpcode.empty())
1235 PPCOperand::CreateTokenWithStringCopy(DotStr, DotLoc, isPPC64()));
1237 Operands.
push_back(PPCOperand::CreateToken(DotStr, DotLoc, isPPC64()));
1245 if (ParseOperand(Operands))
1254 if (ParseOperand(Operands))
1262 bool PPCAsmParser::ParseDirective(
AsmToken DirectiveID) {
1264 if (IDVal ==
".word")
1265 return ParseDirectiveWord(2, DirectiveID.
getLoc());
1266 if (IDVal ==
".llong")
1267 return ParseDirectiveWord(8, DirectiveID.
getLoc());
1269 return ParseDirectiveTC(isPPC64()? 8 : 4, DirectiveID.
getLoc());
1270 if (IDVal ==
".machine")
1271 return ParseDirectiveMachine(DirectiveID.
getLoc());
1277 bool PPCAsmParser::ParseDirectiveWord(
unsigned Size,
SMLoc L) {
1281 if (getParser().parseExpression(Value))
1284 getParser().getStreamer().EmitValue(Value, Size);
1290 return Error(L,
"unexpected token in directive");
1301 bool PPCAsmParser::ParseDirectiveTC(
unsigned Size,
SMLoc L) {
1307 return Error(L,
"unexpected token in directive");
1311 getParser().getStreamer().EmitValueToAlignment(Size);
1314 return ParseDirectiveWord(Size, L);
1319 bool PPCAsmParser::ParseDirectiveMachine(
SMLoc L) {
1322 return Error(L,
"unexpected token in directive");
1324 StringRef CPU = Parser.getTok().getIdentifier();
1332 if (CPU !=
"any" && CPU !=
"push" && CPU !=
"pop")
1333 return Error(L,
"unrecognized machine type");
1336 return Error(L,
"unexpected token in directive");
1348 #define GET_REGISTER_MATCHER
1349 #define GET_MATCHER_IMPLEMENTATION
1350 #include "PPCGenAsmMatcher.inc"
1361 case MCK_0: ImmVal = 0;
break;
1362 case MCK_1: ImmVal = 1;
break;
1363 case MCK_2: ImmVal = 2;
break;
1364 case MCK_3: ImmVal = 3;
break;
1365 default:
return Match_InvalidOperand;
1368 PPCOperand *Op =
static_cast<PPCOperand*
>(AsmOp);
1369 if (Op->isImm() && Op->getImm() == ImmVal)
1370 return Match_Success;
1372 return Match_InvalidOperand;
1376 PPCAsmParser::applyModifierToExpr(
const MCExpr *E,
static bool isReg(const MCInst &MI, unsigned OpNo)
bool isUInt< 8 >(uint64_t x)
void push_back(const T &Elt)
const MCSymbol & getSymbol() const
const char * getPointer() const
size_t size() const
size - Get the string size.
static unsigned MatchRegisterName(StringRef Name)
static MCOperand CreateReg(unsigned Reg)
MCTargetAsmParser - Generic interface to target specific assembly parsers.
size_t find(char C, size_t From=0) const
StringRef getString() const
static MCOperand CreateExpr(const MCExpr *Val)
StringRef substr(size_t Start, size_t N=npos) const
virtual void EmitInstruction(const MCInst &Inst)=0
std::pair< StringRef, StringRef > getToken(StringRef Source, StringRef Delimiters=" \t\n\v\f\r")
#define llvm_unreachable(msg)
AsmToken - Target independent representation for an assembler token.
const char * data() const
MCUnaryExpr - Unary assembler expressions.
static const MCSymbolRefExpr * Create(const MCSymbol *Symbol, MCContext &Ctx)
const MCExpr * getLHS() const
getLHS - Get the left-hand side expression of the binary operator.
static const PPCMCExpr * Create(VariantKind Kind, const MCExpr *Expr, bool isDarwin, MCContext &Ctx)
static const MCBinaryExpr * Create(Opcode Op, const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
static const MCUnaryExpr * Create(Opcode Op, const MCExpr *Expr, MCContext &Ctx)
void LLVMInitializePowerPCAsmParser()
Force static initialization.
enable_if_c< std::numeric_limits< T >::is_signed, bool >::type getAsInteger(unsigned Radix, T &Result) const
MCBinaryExpr - Binary assembler expressions.
void setOpcode(unsigned Op)
bool is(TokenKind K) const
unsigned getOpcode() const
static SMLoc getFromPointer(const char *Ptr)
const MCExpr * getRHS() const
getRHS - Get the right-hand side expression of the binary operator.
StringRef getIdentifier() const
const MCExpr * getSubExpr() const
getSubExpr - Get the child of this unary expression.
StringRef getName() const
getName - Get the symbol name.
bool equals_lower(StringRef RHS) const
equals_lower - Check for string equality, ignoring case.
static MCOperand CreateImm(int64_t Val)
Opcode getOpcode() const
getOpcode - Get the kind of this binary expression.
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
References to labels and assigned expressions.
static bool isMem(const MachineInstr *MI, unsigned Op)
bool isInt< 16 >(int64_t x)
VariantKind getKind() const
LLVM Value Representation.
bool isUInt< 16 >(uint64_t x)
bool isPowerOf2_32(uint32_t Value)
void addOperand(const MCOperand &Op)
Target specific expression.
StringRef slice(size_t Start, size_t End) const
Represents a location in source code.
bool startswith_lower(StringRef Prefix) const
Check if this string starts with the given Prefix, ignoring case.
const MCOperand & getOperand(unsigned i) const
Opcode getOpcode() const
getOpcode - Get the kind of this unary expression.