Home | History | Annotate | Download | only in AsmParser

Lines Matching refs:Mnemonic

102   bool parseOperand(SmallVectorImpl<MCParsedAsmOperand*> &, StringRef Mnemonic);
117 StringRef splitMnemonic(StringRef Mnemonic, unsigned &PredicationCode,
120 void getMnemonicAcceptInfo(StringRef Mnemonic, bool &CanAcceptCarrySet,
230 bool shouldOmitCCOutOperand(StringRef Mnemonic,
4575 /// of the mnemonic.
4577 StringRef Mnemonic) {
4582 OperandMatchResultTy ResTy = MatchOperandParserImpl(Operands, Mnemonic);
4604 if (Mnemonic == "vmrs" &&
4720 /// \brief Given a mnemonic, split out possible predication code and carry
4721 /// setting letters to form a canonical mnemonic and flags.
4725 StringRef ARMAsmParser::splitMnemonic(StringRef Mnemonic,
4737 if ((Mnemonic == "movs" && isThumb()) ||
4738 Mnemonic == "teq" || Mnemonic == "vceq" || Mnemonic == "svc" ||
4739 Mnemonic == "mls" || Mnemonic == "smmls" || Mnemonic == "vcls" ||
4740 Mnemonic == "vmls" || Mnemonic == "vnmls" || Mnemonic == "vacge" ||
4741 Mnemonic == "vcge" || Mnemonic == "vclt" || Mnemonic == "vacgt" ||
4742 Mnemonic == "vcgt" || Mnemonic == "vcle" || Mnemonic == "smlal" ||
4743 Mnemonic == "umaal" || Mnemonic == "umlal" || Mnemonic == "vabal" ||
4744 Mnemonic == "vmlal" || Mnemonic == "vpadal" || Mnemonic == "vqdmlal" ||
4745 Mnemonic == "fmuls")
4746 return Mnemonic;
4750 if (Mnemonic != "adcs" && Mnemonic != "bics" && Mnemonic != "movs" &&
4751 Mnemonic != "muls" && Mnemonic != "smlals" && Mnemonic != "smulls" &&
4752 Mnemonic != "umlals" && Mnemonic != "umulls" && Mnemonic != "lsls" &&
4753 Mnemonic != "sbcs" && Mnemonic != "rscs") {
4754 unsigned CC = StringSwitch<unsigned>(Mnemonic.substr(Mnemonic.size()-2))
4774 Mnemonic = Mnemonic.slice(0, Mnemonic.size() - 2);
4781 if (Mnemonic.endswith("s") &&
4782 !(Mnemonic == "cps" || Mnemonic == "mls" ||
4783 Mnemonic == "mrs" || Mnemonic == "smmls" || Mnemonic == "vabs" ||
4784 Mnemonic == "vcls" || Mnemonic == "vmls" || Mnemonic == "vmrs" ||
4785 Mnemonic == "vnmls" || Mnemonic == "vqabs" || Mnemonic == "vrecps" ||
4786 Mnemonic == "vrsqrts" || Mnemonic == "srs" || Mnemonic == "flds" ||
4787 Mnemonic == "fmrs" || Mnemonic == "fsqrts" || Mnemonic == "fsubs" ||
4788 Mnemonic == "fsts" || Mnemonic == "fcpys" || Mnemonic == "fdivs" ||
4789 Mnemonic == "fmuls" || Mnemonic == "fcmps" || Mnemonic == "fcmpzs" ||
4790 Mnemonic == "vfms" || Mnemonic == "vfnms" ||
4791 (Mnemonic == "movs" && isThumb()))) {
4792 Mnemonic = Mnemonic.slice(0, Mnemonic.size() - 1);
4797 // the mnemonic. Check if this is the case, split it and parse the imod op
4798 if (Mnemonic.startswith("cps")) {
4801 StringSwitch<unsigned>(Mnemonic.substr(Mnemonic.size()-2, 2))
4806 Mnemonic = Mnemonic.slice(0, Mnemonic.size()-2);
4811 // The "it" instruction has the condition mask on the end of the mnemonic.
4812 if (Mnemonic.startswith("it")) {
4813 ITMask = Mnemonic.slice(2, Mnemonic.size());
4814 Mnemonic = Mnemonic.slice(0, 2);
4817 return Mnemonic;
4820 /// \brief Given a canonical mnemonic, determine if the instruction ever allows
4825 getMnemonicAcceptInfo(StringRef Mnemonic, bool &CanAcceptCarrySet,
4827 if (Mnemonic == "and" || Mnemonic == "lsl" || Mnemonic == "lsr" ||
4828 Mnemonic == "rrx" || Mnemonic == "ror" || Mnemonic == "sub" ||
4829 Mnemonic == "add" || Mnemonic == "adc" ||
4830 Mnemonic == "mul" || Mnemonic == "bic" || Mnemonic == "asr" ||
4831 Mnemonic == "orr" || Mnemonic == "mvn" ||
4832 Mnemonic == "rsb" || Mnemonic == "rsc" || Mnemonic == "orn" ||
4833 Mnemonic == "sbc" || Mnemonic == "eor" || Mnemonic == "neg" ||
4834 Mnemonic == "vfm" || Mnemonic == "vfnm" ||
4835 (!isThumb() && (Mnemonic == "smull" || Mnemonic == "mov" ||
4836 Mnemonic == "mla" || Mnemonic == "smlal" ||
4837 Mnemonic == "umlal" || Mnemonic == "umull"))) {
4842 if (Mnemonic == "cbnz" || Mnemonic == "setend" || Mnemonic == "dmb" ||
4843 Mnemonic == "cps" || Mnemonic == "mcr2" || Mnemonic == "it" ||
4844 Mnemonic == "mcrr2" || Mnemonic == "cbz" || Mnemonic == "cdp2" ||
4845 Mnemonic == "trap" || Mnemonic == "mrc2" || Mnemonic == "mrrc2" ||
4846 Mnemonic == "dsb" || Mnemonic == "isb" || Mnemonic == "setend" ||
4847 (Mnemonic == "clrex" && !isThumb()) ||
4848 (Mnemonic == "nop" && isThumbOne()) ||
4849 ((Mnemonic == "pld" || Mnemonic == "pli" || Mnemonic == "pldw" ||
4850 Mnemonic == "ldc2" || Mnemonic == "ldc2l" ||
4851 Mnemonic == "stc2" || Mnemonic == "stc2l") && !isThumb()) ||
4852 ((Mnemonic.startswith("rfe") || Mnemonic.startswith("srs")) &&
4854 Mnemonic.startswith("cps") || (Mnemonic == "movs" && isThumbOne())) {
4860 if (Mnemonic == "bkpt" || Mnemonic == "mcr" || Mnemonic == "mcrr" ||
4861 Mnemonic == "mrc" || Mnemonic == "mrrc" || Mnemonic == "cdp")
4866 bool ARMAsmParser::shouldOmitCCOutOperand(StringRef Mnemonic,
4871 // The 'mov' mnemonic is special. One variant has a cc_out operand, while
4879 if (Mnemonic == "mov" && Operands.size() > 4 && !isThumb() &&
4887 if (isThumb() && Mnemonic == "add" && Operands.size() == 5 &&
4896 if (((isThumb() && Mnemonic == "add") ||
4897 (isThumbTwo() && Mnemonic == "sub")) &&
4903 ((Mnemonic == "add" &&static_cast<ARMOperand*>(Operands[5])->isReg()) ||
4908 // selecting via the generic "add" mnemonic, so to know that we
4911 if (isThumbTwo() && (Mnemonic == "add" || Mnemonic == "sub") &&
4941 // if we have a "mul" mnemonic in Thumb mode, check if we'll be able to
4943 if (isThumbTwo() && Mnemonic == "mul" && Operands.size() == 6 &&
4964 if (isThumbTwo() && Mnemonic == "mul" && Operands.size() == 5 &&
4983 if (isThumb() && (Mnemonic == "add" || Mnemonic == "sub") &&
5008 static bool doesIgnoreDataTypeSuffix(StringRef Mnemonic, StringRef DT) {
5009 return Mnemonic.startswith("vldm") || Mnemonic.startswith("vstm");
5012 static void applyMnemonicAliases(StringRef &Mnemonic, unsigned Features);
5013 /// Parse an arm instruction mnemonic followed by its operands.
5017 // Apply mnemonic aliases before doing anything else, as the destination
5034 // Create the leading tokens for the mnemonic, split by '.' characters.
5036 StringRef Mnemonic = Name.slice(Start, Next);
5038 // Split out the predication code and carry setting flag from the mnemonic.
5043 Mnemonic = splitMnemonic(Mnemonic, PredicationCode, CarrySetting,
5047 if (isThumbOne() && PredicationCode != ARMCC::AL && Mnemonic != "b") {
5052 Operands.push_back(ARMOperand::CreateToken(Mnemonic, NameLoc));
5059 if (Mnemonic == "it") {
5086 // ConditionCode operands to match the mnemonic "as written" and then we let
5090 getMnemonicAcceptInfo(Mnemonic, CanAcceptCarrySet, CanAcceptPredicationCode);
5096 return Error(NameLoc, "instruction '" + Mnemonic +
5103 return Error(NameLoc, "instruction '" + Mnemonic +
5109 SMLoc Loc = SMLoc::getFromPointer(NameLoc.getPointer() + Mnemonic.size());
5116 SMLoc Loc = SMLoc::getFromPointer(NameLoc.getPointer() + Mnemonic.size() +
5129 // Add the remaining tokens in the mnemonic.
5138 doesIgnoreDataTypeSuffix(Mnemonic, ExtraToken))
5150 if (parseOperand(Operands, Mnemonic)) {
5159 if (parseOperand(Operands, Mnemonic)) {
5174 // Some instructions, mostly Thumb, have forms for the same mnemonic that
5179 // mnemonic, of course (CarrySetting == true). Reason number #317 the
5181 if (!CarrySetting && shouldOmitCCOutOperand(Mnemonic, Operands)) {
5189 // on the Mnemonic based checking to correctly figure out when to put
5192 if (!isThumb() && Mnemonic == "blx" && Operands.size() == 3 &&
5206 (Mnemonic == "ldrexd" || Mnemonic == "strexd")) {
5207 bool isLoad = (Mnemonic == "ldrexd");
7064 // mnemonic was used (not "addw"), encoding T3 is preferred.
7073 // mnemonic was used (not "subw"), encoding T3 is preferred.