Home | History | Annotate | Download | only in AsmParser

Lines Matching defs:Mnemonic

197   bool parseOperand(OperandVector &, StringRef Mnemonic);
233 StringRef splitMnemonic(StringRef Mnemonic, unsigned &PredicationCode,
236 void getMnemonicAcceptInfo(StringRef Mnemonic, StringRef FullInst,
318 bool shouldOmitCCOutOperand(StringRef Mnemonic, OperandVector &Operands);
319 bool shouldOmitPredicateOperand(StringRef Mnemonic, OperandVector &Operands);
4740 ARMOperand &Mnemonic = static_cast<ARMOperand &>(*Operands[0]);
4741 bool isFconst = Mnemonic.isToken() && (Mnemonic.getToken() == "fconstd" ||
4742 Mnemonic.getToken() == "fconsts");
4790 /// of the mnemonic.
4791 bool ARMAsmParser::parseOperand(OperandVector &Operands, StringRef Mnemonic) {
4796 OperandMatchResultTy ResTy = MatchOperandParserImpl(Operands, Mnemonic);
4810 // If we've seen a branch mnemonic, the next operand must be a label. This
4813 bool ExpectLabel = Mnemonic == "b" || Mnemonic == "bl";
4823 if (Mnemonic == "vmrs" &&
4905 if (Mnemonic != "ldr") // only parse for ldr pseudo (e.g. ldr r0, =val)
4958 /// \brief Given a mnemonic, split out possible predication code and carry
4959 /// setting letters to form a canonical mnemonic and flags.
4963 StringRef ARMAsmParser::splitMnemonic(StringRef Mnemonic,
4975 if ((Mnemonic == "movs" && isThumb()) ||
4976 Mnemonic == "teq" || Mnemonic == "vceq" || Mnemonic == "svc" ||
4977 Mnemonic == "mls" || Mnemonic == "smmls" || Mnemonic == "vcls" ||
4978 Mnemonic == "vmls" || Mnemonic == "vnmls" || Mnemonic == "vacge" ||
4979 Mnemonic == "vcge" || Mnemonic == "vclt" || Mnemonic == "vacgt" ||
4980 Mnemonic == "vaclt" || Mnemonic == "vacle" || Mnemonic == "hlt" ||
4981 Mnemonic == "vcgt" || Mnemonic == "vcle" || Mnemonic == "smlal" ||
4982 Mnemonic == "umaal" || Mnemonic == "umlal" || Mnemonic == "vabal" ||
4983 Mnemonic == "vmlal" || Mnemonic == "vpadal" || Mnemonic == "vqdmlal" ||
4984 Mnemonic == "fmuls" || Mnemonic == "vmaxnm" || Mnemonic == "vminnm" ||
4985 Mnemonic == "vcvta" || Mnemonic == "vcvtn" || Mnemonic == "vcvtp" ||
4986 Mnemonic == "vcvtm" || Mnemonic == "vrinta" || Mnemonic == "vrintn" ||
4987 Mnemonic == "vrintp" || Mnemonic == "vrintm" || Mnemonic.startswith("vsel"))
4988 return Mnemonic;
4992 if (Mnemonic != "adcs" && Mnemonic != "bics" && Mnemonic != "movs" &&
4993 Mnemonic != "muls" && Mnemonic != "smlals" && Mnemonic != "smulls" &&
4994 Mnemonic != "umlals" && Mnemonic != "umulls" && Mnemonic != "lsls" &&
4995 Mnemonic != "sbcs" && Mnemonic != "rscs") {
4996 unsigned CC = StringSwitch<unsigned>(Mnemonic.substr(Mnemonic.size()-2))
5016 Mnemonic = Mnemonic.slice(0, Mnemonic.size() - 2);
5023 if (Mnemonic.endswith("s") &&
5024 !(Mnemonic == "cps" || Mnemonic == "mls" ||
5025 Mnemonic == "mrs" || Mnemonic == "smmls" || Mnemonic == "vabs" ||
5026 Mnemonic == "vcls" || Mnemonic == "vmls" || Mnemonic == "vmrs" ||
5027 Mnemonic == "vnmls" || Mnemonic == "vqabs" || Mnemonic == "vrecps" ||
5028 Mnemonic == "vrsqrts" || Mnemonic == "srs" || Mnemonic == "flds" ||
5029 Mnemonic == "fmrs" || Mnemonic == "fsqrts" || Mnemonic == "fsubs" ||
5030 Mnemonic == "fsts" || Mnemonic == "fcpys" || Mnemonic == "fdivs" ||
5031 Mnemonic == "fmuls" || Mnemonic == "fcmps" || Mnemonic == "fcmpzs" ||
5032 Mnemonic == "vfms" || Mnemonic == "vfnms" || Mnemonic == "fconsts" ||
5033 (Mnemonic == "movs" && isThumb()))) {
5034 Mnemonic = Mnemonic.slice(0, Mnemonic.size() - 1);
5039 // the mnemonic. Check if this is the case, split it and parse the imod op
5040 if (Mnemonic.startswith("cps")) {
5043 StringSwitch<unsigned>(Mnemonic.substr(Mnemonic.size()-2, 2))
5048 Mnemonic = Mnemonic.slice(0, Mnemonic.size()-2);
5053 // The "it" instruction has the condition mask on the end of the mnemonic.
5054 if (Mnemonic.startswith("it")) {
5055 ITMask = Mnemonic.slice(2, Mnemonic.size());
5056 Mnemonic = Mnemonic.slice(0, 2);
5059 return Mnemonic;
5062 /// \brief Given a canonical mnemonic, determine if the instruction ever allows
5067 getMnemonicAcceptInfo(StringRef Mnemonic, StringRef FullInst,
5069 if (Mnemonic == "and" || MnemonicMnemonic == "lsr" ||
5070 Mnemonic == "rrx" || Mnemonic == "ror" || Mnemonic == "sub" ||
5071 Mnemonic == "add" || Mnemonic == "adc" ||
5072 Mnemonic == "mul" || Mnemonic == "bic" || Mnemonic == "asr" ||
5073 Mnemonic == "orr" || Mnemonic == "mvn" ||
5074 Mnemonic == "rsb" || Mnemonic == "rsc" || Mnemonic == "orn" ||
5075 Mnemonic == "sbc" || Mnemonic == "eor" || Mnemonic == "neg" ||
5076 Mnemonic == "vfm" || Mnemonic == "vfnm" ||
5077 (!isThumb() && (Mnemonic == "smull" || Mnemonic == "mov" ||
5078 Mnemonic == "mla" || Mnemonic == "smlal" ||
5079 Mnemonic == "umlal" || Mnemonic == "umull"))) {
5084 if (Mnemonic == "bkpt" || Mnemonic == "cbnz" || Mnemonic == "setend" ||
5085 Mnemonic == "cps" || Mnemonic == "it" || Mnemonic == "cbz" ||
5086 Mnemonic == "trap" || Mnemonic == "hlt" || Mnemonic == "udf" ||
5087 Mnemonic.startswith("crc32") || Mnemonic.startswith("cps") ||
5088 Mnemonic.startswith("vsel") ||
5089 Mnemonic == "vmaxnm" || Mnemonic == "vminnm" || Mnemonic == "vcvta" ||
5090 Mnemonic == "vcvtn" || Mnemonic == "vcvtp" || Mnemonic == "vcvtm" ||
5091 Mnemonic == "vrinta" || Mnemonic == "vrintn" || Mnemonic == "vrintp" ||
5092 Mnemonic == "vrintm" || Mnemonic.startswith("aes") ||
5093 Mnemonic.startswith("sha1") || Mnemonic.startswith("sha256") ||
5100 = Mnemonic != "cdp2" && Mnemonic != "clrex" && Mnemonic != "mcr2" &&
5101 Mnemonic != "mcrr2" && Mnemonic != "mrc2" && Mnemonic != "mrrc2" &&
5102 Mnemonic != "dmb" && Mnemonic != "dsb" && Mnemonic != "isb" &&
5103 Mnemonic != "pld" && Mnemonic != "pli" && Mnemonic != "pldw" &&
5104 Mnemonic != "ldc2" && Mnemonic != "ldc2l" &&
5105 Mnemonic != "stc2" && Mnemonic != "stc2l" &&
5106 !Mnemonic.startswith("rfe") && !Mnemonic.startswith("srs");
5109 CanAcceptPredicationCode = Mnemonic != "movs";
5111 CanAcceptPredicationCode = Mnemonic != "nop" && Mnemonic != "movs";
5116 bool ARMAsmParser::shouldOmitCCOutOperand(StringRef Mnemonic,
5121 // The 'mov' mnemonic is special. One variant has a cc_out operand, while
5129 if (Mnemonic == "mov" && Operands.size() > 4 && !isThumb() &&
5137 if (isThumb() && Mnemonic == "add" && Operands.size() == 5 &&
5146 if (((isThumb() && Mnemonic == "add") ||
5147 (isThumbTwo() && Mnemonic == "sub")) &&
5152 ((Mnemonic == "add" && static_cast<ARMOperand &>(*Operands[5]).isReg()) ||
5157 // selecting via the generic "add" mnemonic, so to know that we
5160 if (isThumbTwo() && (Mnemonic == "add" || Mnemonic == "sub") &&
5185 // if we have a "mul" mnemonic in Thumb mode, check if we'll be able to
5187 if (isThumbTwo() && Mnemonic == "mul" && Operands.size() == 6 &&
5207 if (isThumbTwo() && Mnemonic == "mul" && Operands.size() == 5 &&
5226 if (isThumb() && (Mnemonic == "add" || Mnemonic == "sub") &&
5239 bool ARMAsmParser::shouldOmitPredicateOperand(StringRef Mnemonic,
5243 if ((Mnemonic == "vrintz" || Mnemonic == "vrintx" || Mnemonic == "vrintr") &&
5271 static bool doesIgnoreDataTypeSuffix(StringRef Mnemonic, StringRef DT) {
5272 return Mnemonic.startswith("vldm") || Mnemonic.startswith("vstm");
5274 static void applyMnemonicAliases(StringRef &Mnemonic, unsigned Features,
5296 /// Parse an arm instruction mnemonic followed by its operands.
5307 // Apply mnemonic aliases before doing anything else, as the destination
5308 // mnemonic may include suffices and we want to handle them normally.
5325 // Create the leading tokens for the mnemonic, split by '.' characters.
5327 StringRef Mnemonic = Name.slice(Start, Next);
5329 // Split out the predication code and carry setting flag from the mnemonic.
5334 Mnemonic = splitMnemonic(Mnemonic, PredicationCode, CarrySetting,
5338 if (isThumbOne() && PredicationCode != ARMCC::AL && Mnemonic != "b") {
5343 Operands.push_back(ARMOperand::CreateToken(Mnemonic, NameLoc));
5350 if (Mnemonic == "it") {
5377 // ConditionCode operands to match the mnemonic "as written" and then we let
5381 getMnemonicAcceptInfo(Mnemonic, Name, CanAcceptCarrySet, CanAcceptPredicationCode);
5387 return Error(NameLoc, "instruction '" + Mnemonic +
5394 return Error(NameLoc, "instruction '" + Mnemonic +
5400 SMLoc Loc = SMLoc::getFromPointer(NameLoc.getPointer() + Mnemonic.size());
5407 SMLoc Loc = SMLoc::getFromPointer(NameLoc.getPointer() + Mnemonic.size() +
5420 // Add the remaining tokens in the mnemonic.
5429 doesIgnoreDataTypeSuffix(Mnemonic, ExtraToken))
5452 if (parseOperand(Operands, Mnemonic)) {
5461 if (parseOperand(Operands, Mnemonic)) {
5486 // Some instructions, mostly Thumb, have forms for the same mnemonic that
5491 // mnemonic, of course (CarrySetting == true). Reason number #317 the
5493 if (!CarrySetting && shouldOmitCCOutOperand(Mnemonic, Operands))
5496 // Some instructions have the same mnemonic, but don't always
5499 if (shouldOmitPredicateOperand(Mnemonic, Operands))
5504 // on the Mnemonic based checking to correctly figure out when to put
5507 if (!isThumb() && Mnemonic == "blx" && Operands.size() == 3 &&
5518 (Mnemonic == "ldrexd" || Mnemonic == "strexd" || Mnemonic == "ldaexd" ||
5519 Mnemonic == "stlexd")) {
5520 bool isLoad = (Mnemonic == "ldrexd" || Mnemonic == "ldaexd");
5550 if ((Mnemonic == "ldrd" || Mnemonic == "strd")) {
5572 // so the Mnemonic is the original name "subs" and delete the predicate
5574 if (isThumbTwo() && Mnemonic == "sub" && Operands.size() == 6 &&
7559 // mnemonic was used (not "addw"), encoding T3 is preferred.
7568 // mnemonic was used (not "subw"), encoding T3 is preferred.