Home | History | Annotate | Download | only in AsmParser

Lines Matching defs:Mnemonic

88   bool parseOperand(SmallVectorImpl<MCParsedAsmOperand*> &, StringRef Mnemonic);
98 StringRef splitMnemonic(StringRef Mnemonic, unsigned &PredicationCode,
101 void getMnemonicAcceptInfo(StringRef Mnemonic, bool &CanAcceptCarrySet,
206 bool shouldOmitCCOutOperand(StringRef Mnemonic,
3597 /// of the mnemonic.
3599 StringRef Mnemonic) {
3604 OperandMatchResultTy ResTy = MatchOperandParserImpl(Operands, Mnemonic);
3626 if (Mnemonic == "vmrs" && Parser.getTok().getString() == "apsr_nzcv") {
3727 /// \brief Given a mnemonic, split out possible predication code and carry
3728 /// setting letters to form a canonical mnemonic and flags.
3732 StringRef ARMAsmParser::splitMnemonic(StringRef Mnemonic,
3744 if ((Mnemonic == "movs" && isThumb()) ||
3745 Mnemonic == "teq" || Mnemonic == "vceq" || Mnemonic == "svc" ||
3746 Mnemonic == "mls" || Mnemonic == "smmls" || Mnemonic == "vcls" ||
3747 Mnemonic == "vmls" || Mnemonic == "vnmls" || Mnemonic == "vacge" ||
3748 Mnemonic == "vcge" || Mnemonic == "vclt" || Mnemonic == "vacgt" ||
3749 Mnemonic == "vcgt" || Mnemonic == "vcle" || Mnemonic == "smlal" ||
3750 Mnemonic == "umaal" || Mnemonic == "umlal" || Mnemonic == "vabal" ||
3751 Mnemonic == "vmlal" || Mnemonic == "vpadal" || Mnemonic == "vqdmlal")
3752 return Mnemonic;
3756 if (Mnemonic != "adcs" && Mnemonic != "bics" && Mnemonic != "movs" &&
3757 Mnemonic != "muls" && Mnemonic != "smlals" && Mnemonic != "smulls" &&
3758 Mnemonic != "umlals" && Mnemonic != "umulls" && Mnemonic != "lsls" &&
3759 Mnemonic != "sbcs" && Mnemonic != "rscs") {
3760 unsigned CC = StringSwitch<unsigned>(Mnemonic.substr(Mnemonic.size()-2))
3780 Mnemonic = Mnemonic.slice(0, Mnemonic.size() - 2);
3787 if (Mnemonic.endswith("s") &&
3788 !(Mnemonic == "cps" || Mnemonic == "mls" ||
3789 Mnemonic == "mrs" || Mnemonic == "smmls" || Mnemonic == "vabs" ||
3790 Mnemonic == "vcls" || Mnemonic == "vmls" || Mnemonic == "vmrs" ||
3791 Mnemonic == "vnmls" || Mnemonic == "vqabs" || Mnemonic == "vrecps" ||
3792 Mnemonic == "vrsqrts" || Mnemonic == "srs" ||
3793 (Mnemonic == "movs" && isThumb()))) {
3794 Mnemonic = Mnemonic.slice(0, Mnemonic.size() - 1);
3799 // the mnemonic. Check if this is the case, split it and parse the imod op
3800 if (Mnemonic.startswith("cps")) {
3803 StringSwitch<unsigned>(Mnemonic.substr(Mnemonic.size()-2, 2))
3808 Mnemonic = Mnemonic.slice(0, Mnemonic.size()-2);
3813 // The "it" instruction has the condition mask on the end of the mnemonic.
3814 if (Mnemonic.startswith("it")) {
3815 ITMask = Mnemonic.slice(2, Mnemonic.size());
3816 Mnemonic = Mnemonic.slice(0, 2);
3819 return Mnemonic;
3822 /// \brief Given a canonical mnemonic, determine if the instruction ever allows
3827 getMnemonicAcceptInfo(StringRef Mnemonic, bool &CanAcceptCarrySet,
3829 if (Mnemonic == "and" || Mnemonic == "lsl" || Mnemonic == "lsr" ||
3830 Mnemonic == "rrx" || Mnemonic == "ror" || Mnemonic == "sub" ||
3831 Mnemonic == "add" || Mnemonic == "adc" ||
3832 Mnemonic == "mul" || Mnemonic == "bic" || Mnemonic == "asr" ||
3833 Mnemonic == "orr" || Mnemonic == "mvn" ||
3834 Mnemonic == "rsb" || Mnemonic == "rsc" || Mnemonic == "orn" ||
3835 Mnemonic == "sbc" || Mnemonic == "eor" || Mnemonic == "neg" ||
3836 (!isThumb() && (Mnemonic == "smull" || Mnemonic == "mov" ||
3837 Mnemonic == "mla" || Mnemonic == "smlal" ||
3838 Mnemonic == "umlal" || Mnemonic == "umull"))) {
3843 if (Mnemonic == "cbnz" || Mnemonic == "setend" || Mnemonic == "dmb" ||
3844 Mnemonic == "cps" || Mnemonic == "mcr2" || Mnemonic == "it" ||
3845 Mnemonic == "mcrr2" || Mnemonic == "cbz" || Mnemonic == "cdp2" ||
3846 Mnemonic == "trap" || Mnemonic == "mrc2" || Mnemonic == "mrrc2" ||
3847 Mnemonic == "dsb" || Mnemonic == "isb" || Mnemonic == "setend" ||
3848 (Mnemonic == "clrex" && !isThumb()) ||
3849 (Mnemonic == "nop" && isThumbOne()) ||
3850 ((Mnemonic == "pld" || Mnemonic == "pli" || Mnemonic == "pldw" ||
3851 Mnemonic == "ldc2" || Mnemonic == "ldc2l" ||
3852 Mnemonic == "stc2" || Mnemonic == "stc2l") && !isThumb()) ||
3853 ((Mnemonic.startswith("rfe") || Mnemonic.startswith("srs")) &&
3855 Mnemonic.startswith("cps") || (Mnemonic == "movs" && isThumbOne())) {
3861 if (Mnemonic == "bkpt" || Mnemonic == "mcr" || Mnemonic == "mcrr" ||
3862 Mnemonic == "mrc" || Mnemonic == "mrrc" || Mnemonic == "cdp")
3867 bool ARMAsmParser::shouldOmitCCOutOperand(StringRef Mnemonic,
3872 // The 'mov' mnemonic is special. One variant has a cc_out operand, while
3880 if (Mnemonic == "mov" && Operands.size() > 4 && !isThumb() &&
3888 if (isThumb() && Mnemonic == "add" && Operands.size() == 5 &&
3897 if (((isThumb() && Mnemonic == "add") ||
3898 (isThumbTwo() && Mnemonic == "sub")) &&
3909 // selecting via the generic "add" mnemonic, so to know that we
3912 if (isThumbTwo() && (Mnemonic == "add" || Mnemonic == "sub") &&
3940 // if we have a "mul" mnemonic in Thumb mode, check if we'll be able to
3942 if (isThumbTwo() && Mnemonic == "mul" && Operands.size() == 6 &&
3967 if (isThumb() && (Mnemonic == "add" || Mnemonic == "sub") &&
3977 /// Parse an arm instruction mnemonic followed by its operands.
3980 // Create the leading tokens for the mnemonic, split by '.' characters.
3982 StringRef Mnemonic = Name.slice(Start, Next);
3984 // Split out the predication code and carry setting flag from the mnemonic.
3989 Mnemonic = splitMnemonic(Mnemonic, PredicationCode, CarrySetting,
3993 if (isThumbOne() && PredicationCode != ARMCC::AL && Mnemonic != "b") {
3998 Operands.push_back(ARMOperand::CreateToken(Mnemonic, NameLoc));
4005 if (Mnemonic == "it") {
4032 // ConditionCode operands to match the mnemonic "as written" and then we let
4036 getMnemonicAcceptInfo(Mnemonic, CanAcceptCarrySet, CanAcceptPredicationCode);
4042 return Error(NameLoc, "instruction '" + Mnemonic +
4049 return Error(NameLoc, "instruction '" + Mnemonic +
4055 SMLoc Loc = SMLoc::getFromPointer(NameLoc.getPointer() + Mnemonic.size());
4062 SMLoc Loc = SMLoc::getFromPointer(NameLoc.getPointer() + Mnemonic.size() +
4075 // Add the remaining tokens in the mnemonic.
4093 if (parseOperand(Operands, Mnemonic)) {
4102 if (parseOperand(Operands, Mnemonic)) {
4117 // Some instructions, mostly Thumb, have forms for the same mnemonic that
4122 // mnemonic, of course (CarrySetting == true). Reason number #317 the
4124 if (!CarrySetting && shouldOmitCCOutOperand(Mnemonic, Operands)) {
4132 // on the Mnemonic based checking to correctly figure out when to put
4135 if (!isThumb() && Mnemonic == "blx" && Operands.size() == 3 &&
4145 if ((Mnemonic == "vceq" || Mnemonic == "vcge" || Mnemonic == "vcgt" ||
4146 Mnemonic == "vcle" || Mnemonic == "vclt") && Operands.size() == 6 &&
4157 if ((Mnemonic == "vcmp" || Mnemonic == "vcmpe") && Operands.size() == 5 &&
4169 if (Mnemonic == "rsb" && isThumb() && Operands.size() == 6 &&