<s> const MCExpr * ImmVal ; if ( getParser ( ) . parseExpression ( ImmVal ) ) return true ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( ImmVal ) ; if ( ! MCE ) return TokError ( <STR_LIT> ) ; if ( Parser . getTok ( ) . isNot ( AsmToken :: RBrac ) ) return Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; SMLoc E = Parser . getTok ( ) . getEndLoc ( ) ; Parser . Lex ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateVectorIndex ( MCE -> getValue ( ) , SIdx , E , getContext ( ) ) ) ; } return false ;


<s> SMLoc S = Parser . getTok ( ) . getLoc ( ) ; const AsmToken & Tok = Parser . getTok ( ) ; if ( Tok . isNot ( AsmToken :: Identifier ) ) return - <NUM_LIT> ; std :: string lowerCase = Tok . getString ( ) . lower ( ) ; <STR_LIT> ShiftTy = StringSwitch < <STR_LIT> > ( lowerCase ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( <STR_LIT> ) ; if ( ShiftTy == <STR_LIT> ) return <NUM_LIT> ; Parser . Lex ( ) ; std :: unique_ptr < <ISA_LIT>Operand > PrevOp ( ( <ISA_LIT>Operand * ) Operands . pop_back_val ( ) . release ( ) ) ; if ( ! PrevOp -> isReg ( ) ) return Error ( PrevOp -> getStartLoc ( ) , <STR_LIT> ) ; int SrcReg = PrevOp -> getReg ( ) ; SMLoc EndLoc ; int64_t Imm = <NUM_LIT> ; int ShiftReg = <NUM_LIT> ; if ( ShiftTy == <STR_LIT> ) { ShiftReg = SrcReg ; } else { if ( Parser . getTok ( ) . is ( AsmToken :: Hash ) || Parser . getTok ( ) . is ( AsmToken :: Dollar ) ) { Parser . Lex ( ) ; SMLoc ImmLoc = Parser . getTok ( ) . getLoc ( ) ; const MCExpr * ShiftExpr = nullptr ; if ( getParser ( ) . parseExpression ( ShiftExpr , EndLoc ) ) { Error ( ImmLoc , <STR_LIT> ) ; return - <NUM_LIT> ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( ShiftExpr ) ; if ( ! CE ) { Error ( ImmLoc , <STR_LIT> ) ; return - <NUM_LIT> ; } Imm = CE -> getValue ( ) ; if ( Imm < <NUM_LIT> || ( ( ShiftTy == <STR_LIT> || ShiftTy == <STR_LIT> ) && Imm > <NUM_LIT> ) || ( ( ShiftTy == <STR_LIT> || ShiftTy == <STR_LIT> ) && Imm > <NUM_LIT> ) ) { Error ( ImmLoc , <STR_LIT> ) ; return - <NUM_LIT> ; } if ( Imm == <NUM_LIT> ) ShiftTy = <STR_LIT> ; } else if ( Parser . getTok ( ) . is ( AsmToken :: Identifier ) ) { SMLoc L = Parser . getTok ( ) . getLoc ( ) ; EndLoc = Parser . getTok ( ) . getEndLoc ( ) ; ShiftReg = tryParseRegister ( ) ; if ( ShiftReg == - <NUM_LIT> ) { Error ( L , <STR_LIT> ) ; return - <NUM_LIT> ; } } else { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return - <NUM_LIT> ;


<s> std :: string lowerCase = Tok . getString ( ) . lower ( ) ; <STR_LIT> ShiftTy = StringSwitch < <STR_LIT> > ( lowerCase ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( <STR_LIT> ) ; if ( ShiftTy == <STR_LIT> ) return <NUM_LIT> ; Parser . Lex ( ) ; std :: unique_ptr < <ISA_LIT>Operand > PrevOp ( ( <ISA_LIT>Operand * ) Operands . pop_back_val ( ) . release ( ) ) ; if ( ! PrevOp -> isReg ( ) ) return Error ( PrevOp -> getStartLoc ( ) , <STR_LIT> ) ; int SrcReg = PrevOp -> getReg ( ) ; SMLoc EndLoc ; int64_t Imm = <NUM_LIT> ; int ShiftReg = <NUM_LIT> ; if ( ShiftTy == <STR_LIT> ) { ShiftReg = SrcReg ; } else { if ( Parser . getTok ( ) . is ( AsmToken :: Hash ) || Parser . getTok ( ) . is ( AsmToken :: Dollar ) ) { Parser . Lex ( ) ; SMLoc ImmLoc = Parser . getTok ( ) . getLoc ( ) ; const MCExpr * ShiftExpr = nullptr ; if ( getParser ( ) . parseExpression ( ShiftExpr , EndLoc ) ) { Error ( ImmLoc , <STR_LIT> ) ; return - <NUM_LIT> ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( ShiftExpr ) ; if ( ! CE ) { Error ( ImmLoc , <STR_LIT> ) ; return - <NUM_LIT> ; } Imm = CE -> getValue ( ) ; if ( Imm < <NUM_LIT> || ( ( ShiftTy == <STR_LIT> || ShiftTy == <STR_LIT> ) && Imm > <NUM_LIT> ) || ( ( ShiftTy == <STR_LIT> || ShiftTy == <STR_LIT> ) && Imm > <NUM_LIT> ) ) { Error ( ImmLoc , <STR_LIT> ) ; return - <NUM_LIT> ; } if ( Imm == <NUM_LIT> ) ShiftTy = <STR_LIT> ; } else if ( Parser . getTok ( ) . is ( AsmToken :: Identifier ) ) { SMLoc L = Parser . getTok ( ) . getLoc ( ) ; EndLoc = Parser . getTok ( ) . getEndLoc ( ) ; ShiftReg = tryParseRegister ( ) ; if ( ShiftReg == - <NUM_LIT> ) { Error ( L , <STR_LIT> ) ; return - <NUM_LIT> ; } } else { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return - <NUM_LIT> ; } } if ( ShiftReg && ShiftTy != <STR_LIT> ) Operands . push_back ( <ISA_LIT>Operand :: CreateShiftedRegister ( ShiftTy , SrcReg , ShiftReg , Imm , S , EndLoc ) ) ; else Operands . push_back ( <ISA_LIT>Operand :: CreateShiftedImmediate ( ShiftTy , SrcReg , Imm , S , EndLoc ) ) ;


<s> const MCExpr * SOExpr = Op . getImm ( ) ; int64_t Value ; if ( ! SOExpr -> EvaluateAsAbsolute ( Value ) ) return Match_Success ; assert ( ( Value >= INT32_MIN && Value <= UINT32_MAX ) && <STR_LIT> ) ; } break ; case MCK_GPRPair : if ( Op . isReg ( ) && MRI -> getRegClass ( <STR_LIT> ) . contains ( Op . getReg ( ) ) ) return Match_Success ; break ; } return Match_InvalidOperand ;


<s> bool <ISA_LIT>AsmParser :: parseDirectiveArch ( SMLoc L ) { StringRef Arch = getParser ( ) . parseStringToEndOfStatement ( ) . trim ( ) ; unsigned ID = <STR_LIT> ( Arch ) ;


<s> if ( ( getAvailableFeatures ( ) & Extension . ArchCheck ) != Extension . ArchCheck ) { Error ( ExtLoc , <STR_LIT> + Name + <STR_LIT> <STR_LIT> ) ; return false ; } FeatureBitset ToggleFeatures = EnableFeature ? ( ~ STI . getFeatureBits ( ) & Extension . Features ) : ( STI . getFeatureBits ( ) & Extension . Features ) ; uint64_t Features = ComputeAvailableFeatures ( STI . ToggleFeature ( ToggleFeatures ) ) ; setAvailableFeatures ( Features ) ; return false ; }


<s> Error ( FPUNameLoc , <STR_LIT> ) ; return false ; } for ( auto Feature : Features ) STI . ApplyFeatureFlag ( Feature ) ;

setAvailableFeatures ( ComputeAvailableFeatures ( STI . getFeatureBits ( ) ) ) ;


<s> StringRef FPU = getParser ( ) . parseStringToEndOfStatement ( ) . trim ( ) ; unsigned ID = <STR_LIT> ( FPU ) ; std :: vector < const char * > Features ; if ( ! <STR_LIT> ( ID , Features ) ) { Error ( FPUNameLoc , <STR_LIT> ) ;


<s> bool <ISA_LIT>AsmParser :: parseDirectiveObjectArch ( SMLoc L ) { MCAsmParser & Parser = getParser ( ) ; if ( getLexer ( ) . isNot ( AsmToken :: Identifier ) ) { Error ( getLexer ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ;


<s> SMLoc ArchLoc = Parser . getTok ( ) . getLoc ( ) ; getLexer ( ) . Lex ( ) ; unsigned ID = <STR_LIT> ( Arch ) ; if ( ID == <STR_LIT> ) { Error ( ArchLoc , <STR_LIT> + Arch + <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } getTargetStreamer ( ) . emitObjectArch ( ID ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { Error ( getLexer ( ) . getLoc ( ) , <STR_LIT> ) ;


<s> const auto Format = getContext ( ) . getObjectFileInfo ( ) -> getObjectFileType ( ) ; bool IsMachO = Format == MCObjectFileInfo :: IsMachO ; if ( IsMachO ) { const AsmToken & Tok = Parser . getTok ( ) ; if ( Tok . isNot ( AsmToken :: EndOfStatement ) ) { if ( Tok . isNot ( AsmToken :: Identifier ) && Tok . isNot ( AsmToken :: String ) ) { Error ( L , <STR_LIT> ) ; return false ; } MCSymbol * Func = getParser ( ) . getContext ( ) . GetOrCreateSymbol ( Tok . getIdentifier ( ) ) ; getParser ( ) . getStreamer ( ) . EmitThumbFunc ( Func ) ; Parser . Lex ( ) ; return false ; } } if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ;


<s> unsigned CC = <ISA_LIT>CondCodeFromString ( Mnemonic . substr ( Mnemonic . size ( ) - <NUM_LIT> ) ) ; if ( CC != ~ <NUM_LIT> ) { Mnemonic = Mnemonic . slice ( <NUM_LIT> , Mnemonic . size ( ) - <NUM_LIT> ) ; PredicationCode = CC ; } } if ( Mnemonic . endswith ( <STR_LIT> ) && ! ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || ( Mnemonic == <STR_LIT> && isThumb ( ) ) ) ) { Mnemonic = Mnemonic . slice ( <NUM_LIT> , Mnemonic . size ( ) - <NUM_LIT> ) ; CarrySetting = true ; } if ( Mnemonic . startswith ( <STR_LIT> ) ) { unsigned IMod = StringSwitch < unsigned > ( Mnemonic . substr ( Mnemonic . size ( ) - <NUM_LIT> , <NUM_LIT> ) ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( ~ <NUM_LIT> ) ; if ( IMod != ~ <NUM_LIT> ) { Mnemonic = Mnemonic . slice ( <NUM_LIT> , Mnemonic . size ( ) - <NUM_LIT> ) ; ProcessorIMod = IMod ; } } if ( isMnemonicVPTPredicable ( Mnemonic , ExtraToken ) && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> ) { unsigned CC = <ISA_LIT>VectorCondCodeFromString ( Mnemonic . substr ( Mnemonic . size ( ) - <NUM_LIT> ) ) ; if ( CC != ~ <NUM_LIT> ) { Mnemonic = Mnemonic . slice ( <NUM_LIT> , Mnemonic . size ( ) - <NUM_LIT> ) ; VPTPredicationCode = CC ; } return Mnemonic ; } if ( Mnemonic . startswith ( <STR_LIT> ) ) { ITMask = Mnemonic . slice ( <NUM_LIT> , Mnemonic . size ( ) ) ; Mnemonic = Mnemonic . slice ( <NUM_LIT> , <NUM_LIT> ) ; } if ( Mnemonic . startswith ( <STR_LIT> ) ) { ITMask = Mnemonic . slice ( <NUM_LIT> , Mnemonic . size ( ) ) ; Mnemonic = Mnemonic . slice ( <NUM_LIT> , <NUM_LIT> ) ; }

else if ( Mnemonic . startswith ( <STR_LIT> ) ) {


<s> MatchResult = MatchInstruction ( Operands , Inst , NearMisses , MatchingInlineAsm , PendConditionalInstruction , Out ) ; switch ( MatchResult ) { case Match_Success : LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ; Inst . dump_pretty ( dbgs ( ) , MII . getName ( Inst . getOpcode ( ) ) ) ; dbgs ( ) << <STR_LIT> ) ; if ( validateInstruction ( Inst , Operands ) ) { forwardITPosition ( ) ; forwardVPTPosition ( ) ; return true ; } { bool wasInITBlock = inITBlock ( ) ; while ( processInstruction ( Inst , Operands , Out ) ) LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ; Inst . dump_pretty ( dbgs ( ) , MII . getName ( Inst . getOpcode ( ) ) ) ; dbgs ( ) << <STR_LIT> ) ; if ( wasInITBlock && hasV8Ops ( ) && isThumb ( ) && ! isV8EligibleForIT ( & Inst ) && ! getTargetOptions ( ) . MCNoDeprecatedWarn ) { Warning ( IDLoc , <STR_LIT> ) ;


<s> } continue ; } Parser . Lex ( ) ; RegLoc = Parser . getTok ( ) . getLoc ( ) ; int OldReg = Reg ; const AsmToken RegTok = Parser . getTok ( ) ; Reg = tryParseRegister ( ) ; if ( Reg == - <NUM_LIT> ) return Error ( RegLoc , <STR_LIT> ) ; if ( ! AllowRAAC && Reg == <STR_LIT> ) return Error ( RegLoc , <STR_LIT> ) ; bool isQReg = false ; if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Reg ) ) { Reg = getDRegFromQReg ( Reg ) ; isQReg = true ; } if ( Reg != <STR_LIT> && ! RC -> contains ( Reg ) && RC -> getID ( ) == <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . getID ( ) && <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Reg ) ) { RC = & <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] ; } if ( Reg == <STR_LIT> && ( RC == & <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] || RC == & <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] || RC == & <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] ) ) { RC = & <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] ; EReg = MRI -> getEncodingValue ( Reg ) ; if ( ! insertNoDuplicates ( Registers , EReg , Reg ) ) { Warning ( RegLoc , <STR_LIT> + RegTok . getString ( ) + <STR_LIT> ) ; } continue ; } if ( ( Reg == <STR_LIT> && RC != & <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] ) || ( Reg != <STR_LIT> && ! RC -> contains ( Reg ) ) ) return Error ( RegLoc , <STR_LIT> ) ; if ( EnforceOrder && MRI -> getEncodingValue ( Reg ) < MRI -> getEncodingValue ( OldReg ) ) { if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Reg ) ) Warning ( RegLoc , <STR_LIT> ) ; else if ( ! <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Reg ) ) return Error ( RegLoc , <STR_LIT> ) ; } if ( RC != & <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] && RC != & <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] && Reg != OldReg + <NUM_LIT> ) return Error ( RegLoc , <STR_LIT> ) ; EReg = MRI -> getEncodingValue ( Reg ) ; if ( ! insertNoDuplicates ( Registers , EReg , Reg ) ) { Warning ( RegLoc , <STR_LIT> + RegTok . getString ( ) + <STR_LIT> ) ; } if ( isQReg ) { EReg = MRI -> getEncodingValue ( ++ Reg ) ; Registers . emplace_back ( EReg , Reg ) ;


<s> <ISA_LIT>Operand * Op = ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ; if ( ! IsVector && ! Op -> isRegList ( ) ) return Error ( L , <STR_LIT> ) ;

if ( IsVector && ! Op -> isDPRRegList ( ) ) return Error ( L , <STR_LIT> ) ;


<s> } if ( ExtraToken != <STR_LIT> && ( isThumb ( ) || ExtraToken != <STR_LIT> ) ) { SMLoc Loc = SMLoc :: getFromPointer ( NameLoc . getPointer ( ) + Start ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( ExtraToken , Loc ) ) ; } } if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { if ( parseOperand ( Operands , Mnemonic ) ) { Parser . eatToEndOfStatement ( ) ; return true ; } while ( getLexer ( ) . is ( AsmToken :: Comma ) ) { Parser . Lex ( ) ; if ( parseOperand ( Operands , Mnemonic ) ) { Parser . eatToEndOfStatement ( ) ; return true ; } } } if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { SMLoc Loc = getLexer ( ) . getLoc ( ) ; Parser . eatToEndOfStatement ( ) ; return Error ( Loc , <STR_LIT> ) ; } Parser . Lex ( ) ; if ( ! CarrySetting && shouldOmitCCOutOperand ( Mnemonic , Operands ) ) { <ISA_LIT>Operand * Op = static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) ; Operands . erase ( Operands . begin ( ) + <NUM_LIT> ) ; delete Op ; } if ( ! isThumb ( ) && Mnemonic == <STR_LIT> && Operands . size ( ) == <NUM_LIT> && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> isImm ( ) ) { <ISA_LIT>Operand * Op = static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) ; Operands . erase ( Operands . begin ( ) + <NUM_LIT> ) ; delete Op ; } if ( ! isThumb ( ) && Operands . size ( ) > <NUM_LIT> && ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) ) { bool isLoad = ( Mnemonic == <STR_LIT> ) ; unsigned Idx = isLoad ? <NUM_LIT> : <NUM_LIT> ; <ISA_LIT>Operand * Op1 = static_cast < <ISA_LIT>Operand * > ( Operands [ Idx ] ) ; <ISA_LIT>Operand * Op2 = static_cast < <ISA_LIT>Operand * > ( Operands [ Idx + <NUM_LIT> ] ) ; const MCRegisterClass & MRC = MRI -> getRegClass ( <STR_LIT> ) ; if ( Op1 -> isReg ( ) && Op2 -> isReg ( ) && MRC . contains ( Op1 -> getReg ( ) ) && MRC . contains ( Op2 -> getReg ( ) ) ) { unsigned Reg1 = Op1 -> getReg ( ) ; unsigned Reg2 = Op2 -> getReg ( ) ; unsigned Rt = MRI -> getEncodingValue ( Reg1 ) ;

unsigned Rt2 = MRI -> getEncodingValue ( Reg2 ) ;


<s> bool isAddrMode3 ( ) const { if ( isImm ( ) && ! isa < MCConstantExpr > ( getImm ( ) ) ) return true ; if ( ! isMemory ( ) || Memory . Alignment != <NUM_LIT> ) return false ; if ( Memory . ShiftType != <STR_LIT> ) return false ;

if ( Memory . OffsetRegNum ) return true ;


<s> if ( Memory . OffsetRegNum ) return true ; if ( ! Memory . OffsetImm ) return true ; int64_t Val = Memory . OffsetImm -> getValue ( ) ;

return Val > - <NUM_LIT> && Val < <NUM_LIT> ;


<s> if ( ! Memory . OffsetImm ) return true ; int64_t Val = Memory . OffsetImm -> getValue ( ) ;

return ( Val >= - <NUM_LIT> && Val <= <NUM_LIT> && ( ( Val & <NUM_LIT> ) == <NUM_LIT> ) ) || Val == INT32_MIN ;


<s> if ( isImm ( ) && ! isa < MCConstantExpr > ( getImm ( ) ) ) return true ; if ( ! isMemory ( ) || Memory . Alignment != <NUM_LIT> ) return false ; if ( Memory . OffsetRegNum ) return false ; if ( ! Memory . OffsetImm ) return true ;

int64_t Val = Memory . OffsetImm -> getValue ( ) ;


<s> if ( ! isMemory ( ) || Memory . OffsetRegNum != <NUM_LIT> || Memory . Alignment != <NUM_LIT> ) return false ; if ( ! Memory . OffsetImm ) return true ; int64_t Val = Memory . OffsetImm -> getValue ( ) ; return ( Val > - <NUM_LIT> && Val < <NUM_LIT> ) || ( Val == INT32_MIN ) ;


<s> bool isMemImm12Offset ( ) const { if ( isImm ( ) && ! isa < MCConstantExpr > ( getImm ( ) ) ) return true ; if ( ! isMemory ( ) || Memory . OffsetRegNum != <NUM_LIT> || Memory . Alignment != <NUM_LIT> ) return false ;

if ( ! Memory . OffsetImm ) return true ;


<s> if ( ! Memory . OffsetImm ) return true ; int64_t Val = Memory . OffsetImm -> getValue ( ) ; return ( Val == INT32_MIN ) || ( Val > - <NUM_LIT> && Val < <NUM_LIT> ) ;


<s> if ( ! isMemory ( ) || Memory . OffsetRegNum != <NUM_LIT> || Memory . Alignment != <NUM_LIT> ) return false ; if ( Memory . BaseRegNum == <STR_LIT> ) return false ; if ( ! Memory . OffsetImm ) return false ; int64_t Val = Memory . OffsetImm -> getValue ( ) ;

return ( Val == INT32_MIN ) || ( Val > - <NUM_LIT> && Val < <NUM_LIT> ) ;


<s> int64_t Val = Memory . OffsetImm -> getValue ( ) ;

return ( Val > - <NUM_LIT> && Val < <NUM_LIT> ) || ( Val == INT32_MIN ) ;


<s> SMLoc ErrorLoc = IDLoc ; if ( ErrorInfo != ~ <NUM_LIT> ) { if ( ErrorInfo >= Operands . size ( ) ) return Error ( IDLoc , <STR_LIT> ) ; ErrorLoc = ( ( <ISA_LIT>Operand * ) Operands [ ErrorInfo ] ) -> getStartLoc ( ) ; if ( ErrorLoc == SMLoc ( ) ) ErrorLoc = IDLoc ; } return Error ( ErrorLoc , <STR_LIT> ) ; } case Match_MnemonicFail : return Error ( IDLoc , <STR_LIT> ) ;


<s> return true ; } while ( processInstruction ( Inst , Operands ) ) ; forwardITPosition ( ) ; if ( Inst . getOpcode ( ) == <STR_LIT> ) return false ; Inst . setLoc ( IDLoc ) ; Out . EmitInstruction ( Inst ) ; return false ; case Match_MissingFeature : Error ( IDLoc , <STR_LIT> ) ; return true ; case Match_InvalidOperand : { SMLoc ErrorLoc = IDLoc ; if ( ErrorInfo != ~ <NUM_LIT> ) { if ( ErrorInfo >= Operands . size ( ) ) return Error ( IDLoc , <STR_LIT> ) ; ErrorLoc = ( ( <ISA_LIT>Operand * ) Operands [ ErrorInfo ] ) -> getStartLoc ( ) ; if ( ErrorLoc == SMLoc ( ) ) ErrorLoc = IDLoc ; } return Error ( ErrorLoc , <STR_LIT> ) ; } case Match_MnemonicFail :


<s> if ( Tok . isNot ( AsmToken :: Identifier ) ) return true ; StringRef ShiftName = Tok . getString ( ) ; if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> || ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = <STR_LIT> ; else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = <STR_LIT> ; else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = <STR_LIT> ; else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = <STR_LIT> ; else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = <STR_LIT> ; else return Error ( Loc , <STR_LIT> ) ; Parser . Lex ( ) ; Amount = <NUM_LIT> ; if ( St != <STR_LIT> ) { Loc = Parser . getTok ( ) . getLoc ( ) ; const AsmToken & HashTok = Parser . getTok ( ) ; if ( HashTok . isNot ( AsmToken :: Hash ) && HashTok . isNot ( AsmToken :: Dollar ) ) return Error ( HashTok . getLoc ( ) , <STR_LIT> ) ; Parser . Lex ( ) ; const MCExpr * Expr ; if ( getParser ( ) . ParseExpression ( Expr ) ) return true ;

const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Expr ) ;


<s> FlagsVal = StringSwitch < unsigned > ( Flags ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Default ( ~ <NUM_LIT> ) ; if ( FlagsVal == ~ <NUM_LIT> ) { if ( ! Flags . empty ( ) ) return MatchOperand_NoMatch ; else FlagsVal = <NUM_LIT> ; } } else if ( SpecReg == <STR_LIT> || SpecReg == <STR_LIT> ) { if ( Flags == <STR_LIT> || Flags == <STR_LIT> ) Flags = <STR_LIT> ; for ( int i = <NUM_LIT> , e = Flags . size ( ) ; i != e ; ++ i ) { unsigned Flag = StringSwitch < unsigned > ( Flags . substr ( i , <NUM_LIT> ) ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Default ( ~ <NUM_LIT> ) ; if ( FlagsVal == ~ <NUM_LIT> || ( FlagsVal & Flag ) ) return MatchOperand_NoMatch ; FlagsVal |= Flag ; } } else return MatchOperand_NoMatch ; if ( SpecReg == <STR_LIT> ) FlagsVal |= <NUM_LIT> ; Parser . Lex ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateMSRMask ( FlagsVal , S ) ) ;


<s> assert ( Tok . is ( AsmToken :: Identifier ) && <STR_LIT> ) ; StringRef Mask = Tok . getString ( ) ; if ( isMClass ( ) ) { std :: string Name = Mask . lower ( ) ; unsigned FlagsVal = StringSwitch < unsigned > ( Name ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Default ( ~ <NUM_LIT> ) ; if ( FlagsVal == ~ <NUM_LIT> ) return MatchOperand_NoMatch ; if ( ! hasV7Ops ( ) && FlagsVal >= <NUM_LIT> && FlagsVal <= <NUM_LIT> ) return MatchOperand_NoMatch ; Parser . Lex ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateMSRMask ( FlagsVal , S ) ) ; return MatchOperand_Success ; } size_t Start = <NUM_LIT> , Next = Mask . find ( '_' ) ; StringRef Flags = <STR_LIT> ; std :: string SpecReg = Mask . slice ( Start , Next ) . lower ( ) ; if ( Next != StringRef :: npos ) Flags = Mask . slice ( Next + <NUM_LIT> , Mask . size ( ) ) ; unsigned FlagsVal = <NUM_LIT> ; if ( SpecReg == <STR_LIT> ) { FlagsVal = StringSwitch < unsigned > ( Flags ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Default ( ~ <NUM_LIT> ) ; if ( FlagsVal == ~ <NUM_LIT> ) { if ( ! Flags . empty ( ) ) return MatchOperand_NoMatch ; else FlagsVal = <NUM_LIT> ; } } else if ( SpecReg == <STR_LIT> || SpecReg == <STR_LIT> ) { if ( Flags == <STR_LIT> || Flags == <STR_LIT> ) Flags = <STR_LIT> ; for ( int i = <NUM_LIT> , e = Flags . size ( ) ; i != e ; ++ i ) { unsigned Flag = StringSwitch < unsigned > ( Flags . substr ( i , <NUM_LIT> ) ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Default ( ~ <NUM_LIT> ) ; if ( FlagsVal == ~ <NUM_LIT> || ( FlagsVal & Flag ) ) return MatchOperand_NoMatch ; FlagsVal |= Flag ; } } else return MatchOperand_NoMatch ; if ( SpecReg == <STR_LIT> ) FlagsVal |= <NUM_LIT> ; Parser . Lex ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateMSRMask ( FlagsVal , S ) ) ;


<s> case AsmToken :: Identifier : { if ( ! tryParseRegisterWithWriteBack ( Operands ) ) return false ; int Res = tryParseShiftRegister ( Operands ) ; if ( Res == <NUM_LIT> ) return false ; else if ( Res == - <NUM_LIT> ) return true ; if ( Mnemonic == <STR_LIT> && Parser . getTok ( ) . getString ( ) . equals_lower ( <STR_LIT> ) ) { S = Parser . getTok ( ) . getLoc ( ) ; Parser . Lex ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( <STR_LIT> , S ) ) ; return false ; } } case AsmToken :: LParen : case AsmToken :: Integer : case AsmToken :: String : case AsmToken :: Dot : { const MCExpr * IdVal ; S = Parser . getTok ( ) . getLoc ( ) ; if ( getParser ( ) . ParseExpression ( IdVal ) ) return true ; E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( IdVal , S , E ) ) ; return false ; } case AsmToken :: LBrac : return parseMemory ( Operands ) ; case AsmToken :: LCurly : return parseRegisterList ( Operands ) ; case AsmToken :: Dollar : case AsmToken :: Hash : { S = Parser . getTok ( ) . getLoc ( ) ; Parser . Lex ( ) ; bool isNegative = Parser . getTok ( ) . is ( AsmToken :: Minus ) ; const MCExpr * ImmVal ; if ( getParser ( ) . ParseExpression ( ImmVal ) ) return true ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( ImmVal ) ; if ( CE ) { int32_t Val = CE -> getValue ( ) ; if ( isNegative && Val == <NUM_LIT> ) ImmVal = MCConstantExpr :: Create ( INT32_MIN , getContext ( ) ) ; } E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( ImmVal , S , E ) ) ; return false ; } case AsmToken :: Colon : { <ISA_LIT>MCExpr :: VariantKind RefKind ; if ( parsePrefix ( RefKind ) ) return true ;


<s> Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( <STR_LIT> , S ) ) ; return false ; } } case AsmToken :: LParen : case AsmToken :: Integer : case AsmToken :: String : case AsmToken :: Dot : { const MCExpr * IdVal ; S = Parser . getTok ( ) . getLoc ( ) ; if ( getParser ( ) . ParseExpression ( IdVal ) ) return true ; E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( IdVal , S , E ) ) ; return false ; } case AsmToken :: LBrac : return parseMemory ( Operands ) ; case AsmToken :: LCurly : return parseRegisterList ( Operands ) ; case AsmToken :: Dollar : case AsmToken :: Hash : { S = Parser . getTok ( ) . getLoc ( ) ; Parser . Lex ( ) ; bool isNegative = Parser . getTok ( ) . is ( AsmToken :: Minus ) ; const MCExpr * ImmVal ;

if ( getParser ( ) . ParseExpression ( ImmVal ) ) return true ;


<s> int EndReg = tryParseRegister ( ) ; if ( EndReg == - <NUM_LIT> ) return Error ( EndLoc , <STR_LIT> ) ; if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( EndReg ) ) EndReg = getDRegFromQReg ( EndReg ) + <NUM_LIT> ; if ( Reg == EndReg ) continue ; if ( ! RC -> contains ( EndReg ) ) return Error ( EndLoc , <STR_LIT> ) ; if ( get<ISA_LIT>RegisterNumbering ( Reg ) > get<ISA_LIT>RegisterNumbering ( EndReg ) ) return Error ( EndLoc , <STR_LIT> ) ; while ( Reg != EndReg ) { Reg = getNextRegister ( Reg ) ; Registers . push_back ( std :: pair < unsigned , SMLoc > ( Reg , RegLoc ) ) ; } continue ; } Parser . Lex ( ) ; RegLoc = Parser . getTok ( ) . getLoc ( ) ; int OldReg = Reg ; const AsmToken RegTok = Parser . getTok ( ) ; Reg = tryParseRegister ( ) ; if ( Reg == - <NUM_LIT> ) return Error ( RegLoc , <STR_LIT> ) ; bool isQReg = false ; if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Reg ) ) { Reg = getDRegFromQReg ( Reg ) ; isQReg = true ; } if ( ! RC -> contains ( Reg ) ) return Error ( RegLoc , <STR_LIT> ) ; if ( get<ISA_LIT>RegisterNumbering ( Reg ) < get<ISA_LIT>RegisterNumbering ( OldReg ) ) { if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Reg ) ) Warning ( RegLoc , <STR_LIT> ) ; else return Error ( RegLoc , <STR_LIT> ) ; } if ( get<ISA_LIT>RegisterNumbering ( Reg ) == get<ISA_LIT>RegisterNumbering ( OldReg ) ) { Warning ( RegLoc , <STR_LIT> + RegTok . getString ( ) + <STR_LIT> ) ; continue ; }

if ( RC != & <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] && Reg != OldReg + <NUM_LIT> ) return Error ( RegLoc , <STR_LIT> ) ;


<s> case k_PostIndexRegister : OS << <STR_LIT> << ( PostIdxReg . isAdd ? <STR_LIT> : <STR_LIT> ) << PostIdxReg . RegNum ; if ( PostIdxReg . ShiftTy != <STR_LIT> ) OS << <STR_LIT> ( PostIdxReg . ShiftTy ) << <STR_LIT> << PostIdxReg . ShiftImm ; OS << <STR_LIT> ; break ; case k_ProcIFlags : { OS << <STR_LIT> ; unsigned IFlags = getProcIFlags ( ) ; for ( int i = <NUM_LIT> ; i >= <NUM_LIT> ; -- i ) if ( IFlags & ( <NUM_LIT> << i ) ) OS << <STR_LIT> ( <NUM_LIT> << i ) ; OS << <STR_LIT> ; break ; } case k_Register : OS << <STR_LIT> << getReg ( ) << <STR_LIT> ; break ; case k_ShifterImmediate : OS << <STR_LIT> << ( ShifterImm . isASR ? <STR_LIT> : <STR_LIT> ) << <STR_LIT> << ShifterImm . Imm << <STR_LIT> ; break ; case k_ShiftedRegister : OS << <STR_LIT> << RegShiftedReg . SrcReg << <STR_LIT> << <STR_LIT> ( RegShiftedReg . ShiftTy ) << <STR_LIT> << RegShiftedReg . ShiftReg << <STR_LIT> ; break ; case k_ShiftedImmediate : OS << <STR_LIT> << RegShiftedImm . SrcReg << <STR_LIT> << <STR_LIT> ( RegShiftedImm . ShiftTy ) << <STR_LIT> << RegShiftedImm . ShiftImm << <STR_LIT> ; break ; case k_RotateImmediate : OS << <STR_LIT> << <STR_LIT> << ( RotImm . Imm * <NUM_LIT> ) << <STR_LIT> ; break ; case k_BitfieldDescriptor : OS << <STR_LIT> << <STR_LIT> << Bitfield . LSB << <STR_LIT> << Bitfield . Width << <STR_LIT> ; break ; case k_RegisterList : case k_DPRRegisterList : case k_SPRRegisterList : { OS << <STR_LIT> ; const SmallVectorImpl < unsigned > & RegList = getRegList ( ) ; for ( SmallVectorImpl < unsigned > :: const_iterator I = RegList . begin ( ) , E = RegList . end ( ) ; I != E ; ) { OS << * I ; if ( ++ I < E ) OS << <STR_LIT> ; } OS << <STR_LIT> ; break ; } case k_VectorList : OS << <STR_LIT> << VectorList . Count << <STR_LIT> << VectorList . RegNum << <STR_LIT> ; break ; case k_VectorListAllLanes : OS << <STR_LIT> << VectorList . Count << <STR_LIT> << VectorList . RegNum << <STR_LIT> ; break ; case k_VectorListIndexed : OS << <STR_LIT> << VectorList . LaneIndex << <STR_LIT> << VectorList . Count << <STR_LIT> << VectorList . RegNum << <STR_LIT> ; break ; case k_Token : OS << <STR_LIT> << getToken ( ) << <STR_LIT> ; break ; case k_VectorIndex : OS << <STR_LIT> << getVectorIndex ( ) << <STR_LIT> ;


<s> OS << <STR_LIT> << <ISA_LIT>CondCodeToString ( getCondCode ( ) ) << <STR_LIT> ; break ; case k_CCOut : OS << <STR_LIT> << getReg ( ) << <STR_LIT> ; break ; case k_ITCondMask : { static const char * MaskStr [ ] = { <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> } ; assert ( ( ITMask . Mask & <NUM_LIT> ) == ITMask . Mask ) ; OS << <STR_LIT> << MaskStr [ ITMask . Mask ] << <STR_LIT> ; break ; } case k_CoprocNum : OS << <STR_LIT> << getCoproc ( ) << <STR_LIT> ; break ; case k_CoprocReg : OS << <STR_LIT> << getCoproc ( ) << <STR_LIT> ; break ; case k_CoprocOption : OS << <STR_LIT> << CoprocOption . Val << <STR_LIT> ; break ; case k_MSRMask : OS << <STR_LIT> << getMSRMask ( ) << <STR_LIT> ; break ; case k_Immediate : getImm ( ) -> print ( OS ) ; break ; case k_MemBarrierOpt : OS << <STR_LIT> << MemBOptToString ( getMemBarrierOpt ( ) ) << <STR_LIT> ; break ; case k_Memory : OS << <STR_LIT> << <STR_LIT> << Memory . BaseRegNum ; OS << <STR_LIT> ; break ; case k_PostIndexRegister : OS << <STR_LIT> << ( PostIdxReg . isAdd ? <STR_LIT> : <STR_LIT> ) << PostIdxReg . RegNum ; if ( PostIdxReg . ShiftTy != <STR_LIT> ) OS << <STR_LIT> ( PostIdxReg . ShiftTy ) << <STR_LIT> << PostIdxReg . ShiftImm ; OS << <STR_LIT> ; break ; case k_ProcIFlags : { OS << <STR_LIT> ; unsigned IFlags = getProcIFlags ( ) ;

for ( int i = <NUM_LIT> ; i >= <NUM_LIT> ; -- i ) if ( IFlags & ( <NUM_LIT> << i ) ) OS << <STR_LIT> ( <NUM_LIT> << i ) ;


<s> if ( Mnemonic . endswith ( <STR_LIT> ) && ! ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || ( Mnemonic == <STR_LIT> && isThumb ( ) ) ) ) { Mnemonic = Mnemonic . slice ( <NUM_LIT> , Mnemonic . size ( ) - <NUM_LIT> ) ; CarrySetting = true ; } if ( Mnemonic . startswith ( <STR_LIT> ) ) { unsigned IMod = StringSwitch < unsigned > ( Mnemonic . substr ( Mnemonic . size ( ) - <NUM_LIT> , <NUM_LIT> ) ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( ~ <NUM_LIT> ) ; if ( IMod != ~ <NUM_LIT> ) { Mnemonic = Mnemonic . slice ( <NUM_LIT> , Mnemonic . size ( ) - <NUM_LIT> ) ; ProcessorIMod = IMod ; } } if ( Mnemonic . startswith ( <STR_LIT> ) ) {

ITMask = Mnemonic . slice ( <NUM_LIT> , Mnemonic . size ( ) ) ;


<s> case <STR_LIT> : { unsigned Rt = get<ISA_LIT>RegisterNumbering ( Inst . getOperand ( <NUM_LIT> ) . getReg ( ) ) ; unsigned Rt2 = get<ISA_LIT>RegisterNumbering ( Inst . getOperand ( <NUM_LIT> ) . getReg ( ) ) ; if ( Rt2 != Rt + <NUM_LIT> ) return Error ( Operands [ <NUM_LIT> ] -> getStartLoc ( ) , <STR_LIT> ) ; return false ; } case <STR_LIT> : case <STR_LIT> : { unsigned lsb = Inst . getOperand ( <NUM_LIT> ) . getImm ( ) ; unsigned widthm1 = Inst . getOperand ( <NUM_LIT> ) . getImm ( ) ; if ( widthm1 >= <NUM_LIT> - lsb ) return Error ( Operands [ <NUM_LIT> ] -> getStartLoc ( ) , <STR_LIT> ) ; return false ; } case <STR_LIT> : { unsigned Rn = Inst . getOperand ( <NUM_LIT> ) . getReg ( ) ; bool hasWritebackToken = ( static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> isToken ( ) && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> getToken ( ) == <STR_LIT> ) ; bool listContainsBase ; if ( checkLowRegisterList ( Inst , <NUM_LIT> , Rn , <NUM_LIT> , listContainsBase ) && ! isThumbTwo ( ) ) return Error ( Operands [ <NUM_LIT> + hasWritebackToken ] -> getStartLoc ( ) , <STR_LIT> ) ; if ( ! listContainsBase && ! hasWritebackToken && ! isThumbTwo ( ) ) return Error ( Operands [ <NUM_LIT> ] -> getStartLoc ( ) , <STR_LIT> ) ; if ( listContainsBase && hasWritebackToken ) return Error ( Operands [ <NUM_LIT> ] -> getStartLoc ( ) , <STR_LIT> <STR_LIT> ) ; break ; } case <STR_LIT> : { if ( listContainsReg ( Inst , <NUM_LIT> , Inst . getOperand ( <NUM_LIT> ) . getReg ( ) ) ) return Error ( Operands [ <NUM_LIT> ] -> getStartLoc ( ) , <STR_LIT> <STR_LIT> ) ; break ; } case <STR_LIT> : { bool listContainsBase ; if ( checkLowRegisterList ( Inst , <NUM_LIT> , <NUM_LIT> , <STR_LIT> , listContainsBase ) && ! isThumbTwo ( ) ) return Error ( Operands [ <NUM_LIT> ] -> getStartLoc ( ) , <STR_LIT> ) ; break ; } case <STR_LIT> : { bool listContainsBase ; if ( checkLowRegisterList ( Inst , <NUM_LIT> , <NUM_LIT> , <STR_LIT> , listContainsBase ) && ! isThumbTwo ( ) ) return Error ( Operands [ <NUM_LIT> ] -> getStartLoc ( ) , <STR_LIT> ) ; break ; } case <STR_LIT> : { bool listContainsBase ; if ( checkLowRegisterList ( Inst , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , listContainsBase ) && ! isThumbTwo ( ) ) return Error ( Operands [ <NUM_LIT> ] -> getStartLoc ( ) , <STR_LIT> ) ; break ; } }


<s> if ( ! isImm ( ) ) return false ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! CE ) return false ; int64_t Value = CE -> getValue ( ) ;

return <STR_LIT> ( - Value ) != - <NUM_LIT> ;


<s> int64_t Value = CE -> getValue ( ) ;


<s> const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ;


<s> if ( ! CE ) return false ; int64_t Value = CE -> getValue ( ) ; return <STR_LIT> ( - Value ) != - <NUM_LIT> ;


<s> return ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( VectorList . RegNum ) ) ;


<s> if ( ! isSingleSpacedVectorList ( ) ) return false ;

return ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( VectorList . RegNum ) ) ;


<s> SMLoc S = Parser . getTok ( ) . getLoc ( ) ; const AsmToken & Tok = Parser . getTok ( ) ; assert ( Tok . is ( AsmToken :: Identifier ) && <STR_LIT> ) ; StringRef Mask = Tok . getString ( ) ; if ( isMClass ( ) ) { std :: string Name = Mask . lower ( ) ; unsigned FlagsVal = StringSwitch < unsigned > ( Name ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Default ( ~ <NUM_LIT> ) ; if ( FlagsVal == ~ <NUM_LIT> ) return MatchOperand_NoMatch ; if ( ! hasV7Ops ( ) && FlagsVal >= <NUM_LIT> && FlagsVal <= <NUM_LIT> ) return MatchOperand_NoMatch ; Parser . Lex ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateMSRMask ( FlagsVal , S ) ) ; return MatchOperand_Success ; } size_t Start = <NUM_LIT> , Next = Mask . find ( '_' ) ; StringRef Flags = <STR_LIT> ; std :: string SpecReg = Mask . slice ( Start , Next ) . lower ( ) ; if ( Next != StringRef :: npos ) Flags = Mask . slice ( Next + <NUM_LIT> , Mask . size ( ) ) ; unsigned FlagsVal = <NUM_LIT> ; if ( SpecReg == <STR_LIT> ) { FlagsVal = StringSwitch < unsigned > ( Flags ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Default ( ~ <NUM_LIT> ) ; if ( FlagsVal == ~ <NUM_LIT> ) {

if ( ! Flags . empty ( ) ) return MatchOperand_NoMatch ;


<s> Parser . Lex ( ) ; return MatchOperand_Success ; } const MCExpr * LaneIndex ; SMLoc Loc = Parser . getTok ( ) . getLoc ( ) ; if ( getParser ( ) . ParseExpression ( LaneIndex ) ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( LaneIndex ) ; if ( ! CE ) {


<s> <ISA_LIT>AsmParser ( const Target & T , MCAsmParser & _Parser ) : TargetAsmParser ( T ) , Parser ( _Parser ) {


<s> case Register : Reg = o . Reg ; break ; case Immediate : Imm = o . Imm ; break ; case Memory : Mem = o . Mem ; break ;


<s> Op -> Imm . Val = Val ; Op -> StartLoc = S ;


<s> Op -> Mem . ShiftType = ShiftType ; Op -> Mem . ShiftAmount = ShiftAmount ; Op -> Mem . Preindexed = Preindexed ; Op -> Mem . Postindexed = Postindexed ; Op -> Mem . Negative = Negative ; Op -> Mem . Writeback = Writeback ;


<s> Op -> Kind = Memory ; Op -> Mem . BaseRegNum = BaseRegNum ; Op -> Mem . OffsetIsReg = OffsetIsReg ; Op -> Mem . Offset = Offset ; Op -> Mem . OffsetRegNum = OffsetRegNum ; Op -> Mem . OffsetRegShifted = OffsetRegShifted ; Op -> Mem . ShiftType = ShiftType ; Op -> Mem . ShiftAmount = ShiftAmount ; Op -> Mem . Preindexed = Preindexed ; Op -> Mem . Postindexed = Postindexed ; Op -> Mem . Negative = Negative ; Op -> Mem . Writeback = Writeback ;


<s> Op -> Reg . RegNum = RegNum ; Op -> Reg . Writeback = Writeback ; Op -> StartLoc = S ; Op -> EndLoc = E ;


<s> const MCExpr * getImm ( ) const { assert ( Kind == Immediate && <STR_LIT> ) ;


<s> assert ( Kind == Immediate && <STR_LIT> ) ; return Imm . Val ;


<s> assert ( Kind == Register && <STR_LIT> ) ;


<s> StringRef getToken ( ) const { assert ( Kind == Token && <STR_LIT> ) ;

return StringRef ( Tok . Data , Tok . Length ) ;


<s> RegisterAsmParser < <ISA_LIT>AsmParser > X ( The<ISA_LIT>Target ) ; RegisterAsmParser < <ISA_LIT>AsmParser > Y ( TheThumbTarget ) ;


<s> RegisterAsmParser < <ISA_LIT>AsmParser > Y ( TheThumbTarget ) ; LLVMInitialize<ISA_LIT>AsmLexer ( ) ;


<s> const StringRef & Mnemonic = Op0 . getToken ( ) ; if ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) { Inst = MCInst ( ) ; Inst . setOpcode ( <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateReg ( <NUM_LIT> ) ) ; Inst . addOperand ( MCOperand :: CreateReg ( <NUM_LIT> ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ; Inst . addOperand ( MCOperand :: CreateReg ( <NUM_LIT> ) ) ; return false ; }


<s> bool <ISA_LIT>AsmParser :: MatchInstruction ( const SmallVectorImpl < MCParsedAsmOperand * > & Operands , MCInst & Inst ) { <ISA_LIT>Operand & Op0 = * ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ; assert ( Op0 . Kind == <ISA_LIT>Operand :: Token && <STR_LIT> ) ; const StringRef & Mnemonic = Op0 . getToken ( ) ; if ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) { Inst = MCInst ( ) ; Inst . setOpcode ( <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateReg ( <NUM_LIT> ) ) ; Inst . addOperand ( MCOperand :: CreateReg ( <NUM_LIT> ) ) ;

Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ;


<s> else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ;


<s> if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ; else if ( Name == <STR_LIT> || Name == <STR_LIT> ) return <NUM_LIT> ;


<s> const AsmToken & Tok = Parser . getTok ( ) ; assert ( Tok . is ( AsmToken :: Identifier ) && <STR_LIT> ) ; int RegNum ; RegNum = MatchRegisterName ( Tok . getString ( ) ) ; if ( RegNum == - <NUM_LIT> ) return true ; S = Tok . getLoc ( ) ;


<s> else if ( IDVal == <STR_LIT> ) return ParseDirectiveThumb ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return ParseDirectiveThumbFunc ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return ParseDirectiveCode ( DirectiveID . getLoc ( ) ) ;

else if ( IDVal == <STR_LIT> ) return ParseDirectiveSyntax ( DirectiveID . getLoc ( ) ) ;


<s> unified_syntax = false ; } else return Error ( L , <STR_LIT> ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) return Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . Lex ( ) ;


<s> if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) return Error ( L , <STR_LIT> ) ; Parser . Lex ( ) ; return false ;


<s> if ( Tok . isNot ( AsmToken :: Identifier ) && Tok . isNot ( AsmToken :: String ) ) return Error ( L , <STR_LIT> ) ; StringRef ATTRIBUTE_UNUSED SymbolName = Parser . getTok ( ) . getIdentifier ( ) ; Parser . Lex ( ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) return Error ( L , <STR_LIT> ) ; Parser . Lex ( ) ;


<s> bool <ISA_LIT>AsmParser :: ParseDirectiveWord ( unsigned Size , SMLoc L ) { if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { for ( ; ; ) { const MCExpr * Value ;

if ( getParser ( ) . ParseExpression ( Value ) ) return true ;


<s> if ( getParser ( ) . ParseExpression ( Value ) ) return true ; getParser ( ) . getStreamer ( ) . EmitValue ( Value , Size , <NUM_LIT> ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ;

if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) return Error ( L , <STR_LIT> ) ;


<s> Operands . push_back ( Op . take ( ) ) ; SMLoc Loc = Parser . getTok ( ) . getLoc ( ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { OwningPtr < <ISA_LIT>Operand > Op ; if ( ParseOperand ( Op ) ) return true ; Operands . push_back ( Op . take ( ) ) ; while ( getLexer ( ) . is ( AsmToken :: Comma ) ) { Parser . Lex ( ) ; if ( ParseOperand ( Op ) ) return true ; Operands . push_back ( Op . take ( ) ) ; }


<s> int BaseRegNum = Op -> getReg ( ) ; bool Preindexed = false ; bool Postindexed = false ; bool OffsetIsReg = false ; bool Negative = false ; bool Writeback = false ; const AsmToken & Tok = Parser . getTok ( ) ; if ( Tok . is ( AsmToken :: Comma ) ) { Preindexed = true ; Parser . Lex ( ) ; int OffsetRegNum ; bool OffsetRegShifted ; enum ShiftType ShiftType ; const MCExpr * ShiftAmount ; const MCExpr * Offset ; if ( ParseMemoryOffsetReg ( Negative , OffsetRegShifted , ShiftType , ShiftAmount , Offset , OffsetIsReg , OffsetRegNum , E ) ) return true ; const AsmToken & RBracTok = Parser . getTok ( ) ; if ( RBracTok . isNot ( AsmToken :: RBrac ) ) return Error ( RBracTok . getLoc ( ) , <STR_LIT> ) ; E = RBracTok . getLoc ( ) ; Parser . Lex ( ) ; const AsmToken & ExclaimTok = Parser . getTok ( ) ; if ( ExclaimTok . is ( AsmToken :: Exclaim ) ) { E = ExclaimTok . getLoc ( ) ; Writeback = true ; Parser . Lex ( ) ; }

<ISA_LIT>Operand :: CreateMem ( Op , BaseRegNum , OffsetIsReg , Offset , OffsetRegNum , OffsetRegShifted , ShiftType , ShiftAmount , Preindexed , Postindexed , Negative , Writeback , S , E ) ;


<s> OffsetIsReg = false ; OffsetRegNum = - <NUM_LIT> ; const AsmToken & NextTok = Parser . getTok ( ) ; E = NextTok . getLoc ( ) ; if ( NextTok . is ( AsmToken :: Plus ) ) Parser . Lex ( ) ; else if ( NextTok . is ( AsmToken :: Minus ) ) { Negative = true ; Parser . Lex ( ) ; } const AsmToken & OffsetRegTok = Parser . getTok ( ) ; if ( OffsetRegTok . is ( AsmToken :: Identifier ) ) { OffsetIsReg = ! MaybeParseRegister ( Op , false ) ; if ( OffsetIsReg ) { E = Op -> getEndLoc ( ) ; OffsetRegNum = Op -> getReg ( ) ; }


<s> const MCExpr * IdVal ; S = Parser . getTok ( ) . getLoc ( ) ; if ( getParser ( ) . ParseExpression ( IdVal ) ) return true ; E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; <ISA_LIT>Operand :: CreateImm ( Op , IdVal , S , E ) ; return false ; case AsmToken :: LBrac : return ParseMemory ( Op ) ; case AsmToken :: LCurly : return ParseRegisterList ( Op ) ; case AsmToken :: Hash : S = Parser . getTok ( ) . getLoc ( ) ; Parser . Lex ( ) ; const MCExpr * ImmVal ;


<s> bool <ISA_LIT>AsmParser :: ParseOperand ( OwningPtr < <ISA_LIT>Operand > & Op ) { SMLoc S , E ; switch ( getLexer ( ) . getKind ( ) ) { case AsmToken :: Identifier : if ( ! MaybeParseRegister ( Op , true ) ) return false ; const MCExpr * IdVal ; S = Parser . getTok ( ) . getLoc ( ) ; if ( getParser ( ) . ParseExpression ( IdVal ) ) return true ; E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; <ISA_LIT>Operand :: CreateImm ( Op , IdVal , S , E ) ; return false ; case AsmToken :: LBrac :


<s> bool <ISA_LIT>AsmParser :: ParseRegisterList ( OwningPtr < <ISA_LIT>Operand > & Op ) { SMLoc S , E ; assert ( Parser . getTok ( ) . is ( AsmToken :: LCurly ) && <STR_LIT> ) ; S = Parser . getTok ( ) . getLoc ( ) ; Parser . Lex ( ) ; const AsmToken & RegTok = Parser . getTok ( ) ; SMLoc RegLoc = RegTok . getLoc ( ) ; if ( RegTok . isNot ( AsmToken :: Identifier ) ) return Error ( RegLoc , <STR_LIT> ) ; int RegNum = MatchRegisterName ( RegTok . getString ( ) ) ; if ( RegNum == - <NUM_LIT> ) return Error ( RegLoc , <STR_LIT> ) ; Parser . Lex ( ) ; unsigned RegList = <NUM_LIT> << RegNum ;


<s> const StringRef & ShiftName = Tok . getString ( ) ; if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = Lsl ; else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = Lsr ; else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = Asr ; else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = Ror ; else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = Rrx ; else return true ; Parser . Lex ( ) ; if ( St == Rrx ) return false ; const AsmToken & HashTok = Parser . getTok ( ) ;

if ( HashTok . isNot ( AsmToken :: Hash ) ) return Error ( HashTok . getLoc ( ) , <STR_LIT> ) ;


<s> else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = Ror ; else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = Rrx ; else return true ; Parser . Lex ( ) ; if ( St == Rrx ) return false ; const AsmToken & HashTok = Parser . getTok ( ) ; if ( HashTok . isNot ( AsmToken :: Hash ) ) return Error ( HashTok . getLoc ( ) , <STR_LIT> ) ; Parser . Lex ( ) ; if ( getParser ( ) . ParseExpression ( ShiftAmount ) ) return true ; return false ;


<s> if ( Mnemonic . endswith ( <STR_LIT> ) && ! ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || ( Mnemonic == <STR_LIT> && isThumb ( ) ) ) ) { Mnemonic = Mnemonic . slice ( <NUM_LIT> , Mnemonic . size ( ) - <NUM_LIT> ) ; CarrySetting = true ; } if ( Mnemonic . startswith ( <STR_LIT> ) ) { unsigned IMod = StringSwitch < unsigned > ( Mnemonic . substr ( Mnemonic . size ( ) - <NUM_LIT> , <NUM_LIT> ) ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( ~ <NUM_LIT> ) ; if ( IMod != ~ <NUM_LIT> ) { Mnemonic = Mnemonic . slice ( <NUM_LIT> , Mnemonic . size ( ) - <NUM_LIT> ) ; ProcessorIMod = IMod ; } } if ( Mnemonic . startswith ( <STR_LIT> ) ) { ITMask = Mnemonic . slice ( <NUM_LIT> , Mnemonic . size ( ) ) ; Mnemonic = Mnemonic . slice ( <NUM_LIT> , <NUM_LIT> ) ; } return Mnemonic ;


<s> void addVecListFourDOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateReg ( VectorList . RegNum ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateReg ( VectorList . RegNum ) ) ;


<s> Inst . addOperand ( MCOperand :: CreateReg ( VectorList . RegNum ) ) ;


<s> void addVecListTwoQOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateReg ( VectorList . RegNum ) ) ;


<s> ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> addVecListTwoDOperands ( Inst , <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ; ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> addAlignedMemoryOperands ( Inst , <NUM_LIT> ) ; ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> addCondCodeOperands ( Inst , <NUM_LIT> ) ; return true ;


<s> bool <ISA_LIT>AsmParser :: cvtVLDwbFixed ( MCInst & Inst , unsigned Opcode , const SmallVectorImpl < MCParsedAsmOperand * > & Operands ) { ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> addVecListTwoDOperands ( Inst , <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ;

( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> addAlignedMemoryOperands ( Inst , <NUM_LIT> ) ;


<s> ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> addRegOperands ( Inst , <NUM_LIT> ) ; ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> addCondCodeOperands ( Inst , <NUM_LIT> ) ; return true ;


<s> ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> addVecListTwoDOperands ( Inst , <NUM_LIT> ) ; ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> addCondCodeOperands ( Inst , <NUM_LIT> ) ; return true ;


<s> ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> addRegOperands ( Inst , <NUM_LIT> ) ; ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> addVecListTwoDOperands ( Inst , <NUM_LIT> ) ; ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> addCondCodeOperands ( Inst , <NUM_LIT> ) ;


<s> CanAcceptPredicationCode = false ; } else if ( ! isThumb ( ) ) { CanAcceptPredicationCode = Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && ! Mnemonic . startswith ( <STR_LIT> ) && ! Mnemonic . startswith ( <STR_LIT> ) ; } else if ( isThumbOne ( ) ) { if ( hasV6MOps ( ) ) CanAcceptPredicationCode = Mnemonic != <STR_LIT> ; else CanAcceptPredicationCode = Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> ;

} else CanAcceptPredicationCode = true ;


<s> } else if ( ! isThumb ( ) ) { CanAcceptPredicationCode = Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && ! Mnemonic . startswith ( <STR_LIT> ) && ! Mnemonic . startswith ( <STR_LIT> ) ; } else if ( isThumbOne ( ) ) { if ( hasV6MOps ( ) ) CanAcceptPredicationCode = Mnemonic != <STR_LIT> ; else CanAcceptPredicationCode = Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> ;


<s> if ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || ( FullInst . startswith ( <STR_LIT> ) && FullInst . endswith ( <STR_LIT> ) ) || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || ( hasCDE ( ) && MS . isCDEInstr ( Mnemonic ) && ! MS . isITPredicableCDEInstr ( Mnemonic ) ) || ( hasMVE ( ) && ( Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) ) ) ) { CanAcceptPredicationCode = false ; } else if ( ! isThumb ( ) ) { CanAcceptPredicationCode = Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && ! Mnemonic . startswith ( <STR_LIT> ) && ! Mnemonic . startswith ( <STR_LIT> ) ; } else if ( isThumbOne ( ) ) { if ( hasV6MOps ( ) ) CanAcceptPredicationCode = Mnemonic != <STR_LIT> ; else CanAcceptPredicationCode = Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> ; } else CanAcceptPredicationCode = true ;


<s> if ( Section -> UseCodeAlign ( ) ) getStreamer ( ) . emitCodeAlignment ( <NUM_LIT> , <NUM_LIT> ) ; else getStreamer ( ) . emitValueToAlignment ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; return false ; } return true ;


<s> bool <ISA_LIT>AsmParser :: parseDirectiveAlign ( SMLoc L ) { if ( parseOptionalToken ( AsmToken :: EndOfStatement ) ) { const MCSection * Section = getStreamer ( ) . getCurrentSectionOnly ( ) ; assert ( Section && <STR_LIT> ) ; if ( Section -> UseCodeAlign ( ) ) getStreamer ( ) . emitCodeAlignment ( <NUM_LIT> , <NUM_LIT> ) ;

else getStreamer ( ) . emitValueToAlignment ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ;


<s> if ( ! Ret . hasValue ( ) ) { Error ( TagLoc , <STR_LIT> + Name ) ; return false ; } Tag = Ret . getValue ( ) ; Parser . Lex ( ) ; } else { const MCExpr * AttrExpr ; TagLoc = Parser . getTok ( ) . getLoc ( ) ; if ( Parser . parseExpression ( AttrExpr ) ) return true ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( AttrExpr ) ; if ( check ( ! CE , TagLoc , <STR_LIT> ) ) return true ; Tag = CE -> getValue ( ) ; } if ( Parser . parseToken ( AsmToken :: Comma , <STR_LIT> ) ) return true ; StringRef StringValue = <STR_LIT> ; bool IsStringValue = false ; int64_t IntegerValue = <NUM_LIT> ; bool IsIntegerValue = false ; if ( Tag == <STR_LIT> || Tag == <STR_LIT> ) IsStringValue = true ; else if ( Tag == <STR_LIT> ) { IsStringValue = true ; IsIntegerValue = true ; } else if ( Tag < <NUM_LIT> || Tag % <NUM_LIT> == <NUM_LIT> ) IsIntegerValue = true ; else if ( Tag % <NUM_LIT> == <NUM_LIT> ) IsStringValue = true ;


<s> bool IsIntegerValue = false ; if ( Tag == <STR_LIT> || Tag == <STR_LIT> ) IsStringValue = true ; else if ( Tag == <STR_LIT> ) { IsStringValue = true ; IsIntegerValue = true ; } else if ( Tag < <NUM_LIT> || Tag % <NUM_LIT> == <NUM_LIT> ) IsIntegerValue = true ; else if ( Tag % <NUM_LIT> == <NUM_LIT> ) IsStringValue = true ; else llvm_unreachable ( <STR_LIT> ) ; if ( IsIntegerValue ) { const MCExpr * ValueExpr ; SMLoc ValueExprLoc = Parser . getTok ( ) . getLoc ( ) ; if ( Parser . parseExpression ( ValueExpr ) ) return true ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( ValueExpr ) ; if ( ! CE ) return Error ( ValueExprLoc , <STR_LIT> ) ; IntegerValue = CE -> getValue ( ) ; } if ( Tag == <STR_LIT> ) {

if ( Parser . parseToken ( AsmToken :: Comma , <STR_LIT> ) ) return true ;


<s> bool <ISA_LIT>AsmParser :: parseDirectiveEven ( SMLoc L ) { const MCSection * Section = getStreamer ( ) . getCurrentSectionOnly ( ) ; if ( parseToken ( AsmToken :: EndOfStatement , <STR_LIT> ) ) return true ; if ( ! Section ) { getStreamer ( ) . InitSections ( false ) ;


<s> if ( IsMachO ) { if ( Parser . getTok ( ) . is ( AsmToken :: Identifier ) || Parser . getTok ( ) . is ( AsmToken :: String ) ) { MCSymbol * Func = getParser ( ) . getContext ( ) . getOrCreateSymbol ( Parser . getTok ( ) . getIdentifier ( ) ) ; getParser ( ) . getStreamer ( ) . emitThumbFunc ( Func ) ; Parser . Lex ( ) ;

if ( parseToken ( AsmToken :: EndOfStatement , <STR_LIT> ) ) return true ;


<s> Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( <STR_LIT> , S ) ) ; return false ; } } LLVM_FALLTHROUGH ; } case AsmToken :: LParen : case AsmToken :: Integer : case AsmToken :: String : case AsmToken :: Dot : { const MCExpr * IdVal ; S = Parser . getTok ( ) . getLoc ( ) ; if ( getParser ( ) . parseExpression ( IdVal ) ) return true ; E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( IdVal , S , E ) ) ; return false ; } case AsmToken :: LBrac : return parseMemory ( Operands ) ; case AsmToken :: LCurly : return parseRegisterList ( Operands , ! Mnemonic . startswith ( <STR_LIT> ) ) ; case AsmToken :: Dollar : case AsmToken :: Hash : { S = Parser . getTok ( ) . getLoc ( ) ; auto AdjacentToken = getLexer ( ) . peekTok ( false ) ; bool ExpectIdentifier = Parser . getTok ( ) . is ( AsmToken :: Dollar ) && ( AdjacentToken . is ( AsmToken :: Identifier ) || AdjacentToken . is ( AsmToken :: Integer ) ) ; if ( ! ExpectIdentifier ) { Parser . Lex ( ) ; } if ( Parser . getTok ( ) . isNot ( AsmToken :: Colon ) ) { bool IsNegative = Parser . getTok ( ) . is ( AsmToken :: Minus ) ; const MCExpr * ImmVal ; if ( getParser ( ) . parseExpression ( ImmVal ) ) return true ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( ImmVal ) ; if ( CE ) { int32_t Val = CE -> getValue ( ) ; if ( IsNegative && Val == <NUM_LIT> ) ImmVal = MCConstantExpr :: create ( std :: numeric_limits < int32_t > :: min ( ) , getContext ( ) ) ; } E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( ImmVal , S , E ) ) ; if ( Parser . getTok ( ) . is ( AsmToken :: Exclaim ) ) { Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( Parser . getTok ( ) . getString ( ) , Parser . getTok ( ) . getLoc ( ) ) ) ; Parser . Lex ( ) ; } return false ; } LLVM_FALLTHROUGH ; } case AsmToken :: Colon : { S = Parser . getTok ( ) . getLoc ( ) ; <ISA_LIT>MCExpr :: VariantKind RefKind ; if ( parsePrefix ( RefKind ) ) return true ; const MCExpr * SubExprVal ; if ( getParser ( ) . parseExpression ( SubExprVal ) ) return true ;

const MCExpr * ExprVal = <ISA_LIT>MCExpr :: create ( RefKind , SubExprVal , getContext ( ) ) ;


<s> if ( isImm ( ) ) { Inst . addOperand ( MCOperand :: createExpr ( getImm ( ) ) ) ; Inst . addOperand ( MCOperand :: createImm ( <NUM_LIT> ) ) ; return ; } int32_t Val = Memory . OffsetImm ? Memory . OffsetImm -> getValue ( ) / <NUM_LIT> : <NUM_LIT> ;


<s> if ( Val < <NUM_LIT> ) Val = - Val ; Val = <STR_LIT> ( AddSub , Val ) ; Inst . addOperand ( MCOperand :: createReg ( Memory . BaseRegNum ) ) ;

Inst . addOperand ( MCOperand :: createImm ( Val ) ) ;


<s> CanAcceptCarrySet = Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || ( ! isThumb ( ) && ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) ) ; if ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || ( FullInst . startswith ( <STR_LIT> ) && FullInst . endswith ( <STR_LIT> ) ) || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) { CanAcceptPredicationCode = false ; } else if ( ! isThumb ( ) ) { CanAcceptPredicationCode = Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && ! Mnemonic . startswith ( <STR_LIT> ) && ! Mnemonic . startswith ( <STR_LIT> ) ; } else if ( isThumbOne ( ) ) { if ( hasV6MOps ( ) ) CanAcceptPredicationCode = Mnemonic != <STR_LIT> ;

else CanAcceptPredicationCode = Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> ;


<s> int64_t Val = Memory . OffsetImm -> getValue ( ) ; return ( Val >= - <NUM_LIT> && Val <= <NUM_LIT> && ( ( Val & <NUM_LIT> ) == <NUM_LIT> ) ) || Val == INT32_MIN ;


<s> if ( ! Memory . OffsetImm ) return true ; int64_t Val = Memory . OffsetImm -> getValue ( ) ;

return ( Val >= - <NUM_LIT> && Val <= <NUM_LIT> && ( ( Val & <NUM_LIT> ) == <NUM_LIT> ) ) || Val == INT32_MIN ;


<s> bool <ISA_LIT>AsmParser :: parseDirectiveAlign ( SMLoc L ) { if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) return true ; const MCSection * Section = getStreamer ( ) . getCurrentSection ( ) . first ; assert ( Section && <STR_LIT> ) ; if ( Section -> UseCodeAlign ( ) ) getStreamer ( ) . EmitCodeAlignment ( <NUM_LIT> , <NUM_LIT> ) ; else getStreamer ( ) . EmitValueToAlignment ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ;


<s> bool <ISA_LIT>AsmParser :: parseDirectiveArch ( SMLoc L ) { StringRef Arch = getParser ( ) . parseStringToEndOfStatement ( ) . trim ( ) ; unsigned ID = <STR_LIT> ( Arch ) ; if ( ID == <STR_LIT> ) { Error ( L , <STR_LIT> ) ; return false ; } bool WasThumb = isThumb ( ) ;


<s> Error ( ExtLoc , <STR_LIT> + Name + <STR_LIT> <STR_LIT> ) ; return false ; } MCSubtargetInfo & STI = copySTI ( ) ; FeatureBitset ToggleFeatures = EnableFeature ? ( ~ STI . getFeatureBits ( ) & Extension . Features ) : ( STI . getFeatureBits ( ) & Extension . Features ) ; uint64_t Features = ComputeAvailableFeatures ( STI . ToggleFeature ( ToggleFeatures ) ) ; setAvailableFeatures ( Features ) ; return false ; } Error ( ExtLoc , <STR_LIT> + Name ) ; Parser . eatToEndOfStatement ( ) ; return false ;


<s> getTargetStreamer ( ) . emitTextAttribute ( <STR_LIT> , CPU ) ; if ( ! getSTI ( ) . isCPUStringValid ( CPU ) ) { Error ( L , <STR_LIT> ) ; return false ; } bool WasThumb = isThumb ( ) ; MCSubtargetInfo & STI = copySTI ( ) ; STI . setDefaultFeatures ( CPU , <STR_LIT> ) ; setAvailableFeatures ( ComputeAvailableFeatures ( STI . getFeatureBits ( ) ) ) ; FixModeAfterArchChange ( WasThumb , L ) ; return false ;


<s> return false ; } bool WasThumb = isThumb ( ) ; MCSubtargetInfo & STI = copySTI ( ) ; STI . setDefaultFeatures ( CPU , <STR_LIT> ) ; setAvailableFeatures ( ComputeAvailableFeatures ( STI . getFeatureBits ( ) ) ) ;

FixModeAfterArchChange ( WasThumb , L ) ;


<s> Error ( ArchLoc , <STR_LIT> + Arch + <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } getTargetStreamer ( ) . emitObjectArch ( ID ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { Error ( getLexer ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ;


<s> Error ( getLexer ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } StringRef Arch = Parser . getTok ( ) . getString ( ) ; SMLoc ArchLoc = Parser . getTok ( ) . getLoc ( ) ; Lex ( ) ; unsigned ID = <STR_LIT> ( Arch ) ; if ( ID == <STR_LIT> ) { Error ( ArchLoc , <STR_LIT> + Arch + <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } getTargetStreamer ( ) . emitObjectArch ( ID ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) {


<s> } const AsmToken & Tok = Parser . getTok ( ) ; SMLoc Loc = Tok . getLoc ( ) ; if ( Tok . is ( AsmToken :: Real ) && isVmovf ) { APFloat RealVal ( APFloat :: IEEEsingle , Tok . getString ( ) ) ; uint64_t IntVal = RealVal . bitcastToAPInt ( ) . getZExtValue ( ) ; IntVal ^= ( uint64_t ) isNegative << <NUM_LIT> ; Parser . Lex ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( MCConstantExpr :: create ( IntVal , getContext ( ) ) , S , Parser . getTok ( ) . getLoc ( ) ) ) ; return MatchOperand_Success ; } if ( Tok . is ( AsmToken :: Integer ) && isFconst ) { int64_t Val = Tok . getIntVal ( ) ; Parser . Lex ( ) ; if ( Val > <NUM_LIT> || Val < <NUM_LIT> ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ;


<s> const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( ImmVal ) ; if ( CE ) { int32_t Val = CE -> getValue ( ) ; if ( isNegative && Val == <NUM_LIT> ) ImmVal = MCConstantExpr :: create ( INT32_MIN , getContext ( ) ) ; } E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( ImmVal , S , E ) ) ; if ( Parser . getTok ( ) . is ( AsmToken :: Exclaim ) ) { Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( Parser . getTok ( ) . getString ( ) , Parser . getTok ( ) . getLoc ( ) ) ) ; Parser . Lex ( ) ; } return false ; } } case AsmToken :: Colon : { S = Parser . getTok ( ) . getLoc ( ) ; <ISA_LIT>MCExpr :: VariantKind RefKind ; if ( parsePrefix ( RefKind ) ) return true ; const MCExpr * SubExprVal ; if ( getParser ( ) . parseExpression ( SubExprVal ) ) return true ; const MCExpr * ExprVal = <ISA_LIT>MCExpr :: create ( RefKind , SubExprVal , getContext ( ) ) ; E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( ExprVal , S , E ) ) ; return false ; } case AsmToken :: Equal : { S = Parser . getTok ( ) . getLoc ( ) ; if ( Mnemonic != <STR_LIT> ) return Error ( S , <STR_LIT> ) ; Parser . Lex ( ) ; const MCExpr * SubExprVal ; if ( getParser ( ) . parseExpression ( SubExprVal ) ) return true ; E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateConstantPoolImm ( SubExprVal , S , E ) ) ; return false ; }


<s> unsigned CC = StringSwitch < unsigned > ( Mnemonic . substr ( Mnemonic . size ( ) - <NUM_LIT> ) ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( ~ <NUM_LIT> ) ; if ( CC != ~ <NUM_LIT> ) { Mnemonic = Mnemonic . slice ( <NUM_LIT> , Mnemonic . size ( ) - <NUM_LIT> ) ; PredicationCode = CC ; } } if ( Mnemonic . endswith ( <STR_LIT> ) && ! ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || ( Mnemonic == <STR_LIT> && isThumb ( ) ) ) ) { Mnemonic = Mnemonic . slice ( <NUM_LIT> , Mnemonic . size ( ) - <NUM_LIT> ) ; CarrySetting = true ; } if ( Mnemonic . startswith ( <STR_LIT> ) ) {

unsigned IMod = StringSwitch < unsigned > ( Mnemonic . substr ( Mnemonic . size ( ) - <NUM_LIT> , <NUM_LIT> ) ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( ~ <NUM_LIT> ) ;


<s> setAvailableFeatures ( ComputeAvailableFeatures ( STI . getFeatureBits ( ) ) ) ; ITState . CurPosition = ~ <NUM_LIT> ;

if ( MCELFStreamer * MES = dyn_cast < MCELFStreamer > ( & Parser . getStreamer ( ) ) ) MES -> getAssembler ( ) . setELFHeaderEFlags ( ELF :: EF_<ISA_LIT>_EABI_VER5 ) ;


<s> if ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || ( FullInst . startswith ( <STR_LIT> ) && FullInst . endswith ( <STR_LIT> ) ) ) { CanAcceptPredicationCode = false ; } else if ( ! isThumb ( ) ) { CanAcceptPredicationCode = Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && ! Mnemonic . startswith ( <STR_LIT> ) && ! Mnemonic . startswith ( <STR_LIT> ) ;


<s> if ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || ( ! isThumb ( ) && ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) ) ) { CanAcceptCarrySet = true ; } else CanAcceptCarrySet = false ; if ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || ( FullInst . startswith ( <STR_LIT> ) && FullInst . endswith ( <STR_LIT> ) ) ) {


return STI . getFeatureBits ( ) [ <STR_LIT> ] ;


<s> StringRef Arch = getParser ( ) . parseStringToEndOfStatement ( ) . trim ( ) ; unsigned ID = <STR_LIT> ( Arch ) ; if ( ID == <STR_LIT> ) { Error ( L , <STR_LIT> ) ; return false ;


<s> return false ; } Triple T ; STI . setDefaultFeatures ( T . get<ISA_LIT>CPUForArch ( Arch ) ) ; setAvailableFeatures ( ComputeAvailableFeatures ( STI . getFeatureBits ( ) ) ) ; getTargetStreamer ( ) . emitArch ( ID ) ; return false ;


<s> bool <ISA_LIT>AsmParser :: parseDirectiveThumbFunc ( SMLoc L ) { MCAsmParser & Parser = getParser ( ) ; const auto Format = getContext ( ) . getObjectFileInfo ( ) -> getObjectFileType ( ) ; bool IsMachO = Format == MCObjectFileInfo :: IsMachO ; if ( IsMachO ) { if ( Parser . getTok ( ) . is ( AsmToken :: Identifier ) || Parser . getTok ( ) . is ( AsmToken :: String ) ) { MCSymbol * Func = getParser ( ) . getContext ( ) . getOrCreateSymbol ( Parser . getTok ( ) . getIdentifier ( ) ) ; getParser ( ) . getStreamer ( ) . EmitThumbFunc ( Func ) ; Parser . Lex ( ) ; if ( parseToken ( AsmToken :: EndOfStatement , <STR_LIT> ) ) return true ; return false ; } } if ( parseToken ( AsmToken :: EndOfStatement , <STR_LIT> ) || check ( ! hasThumb ( ) , L , <STR_LIT> ) ) return true ; if ( ! isThumb ( ) ) SwitchMode ( ) ;

getParser ( ) . getStreamer ( ) . EmitAssemblerFlag ( MCAF_Code16 ) ;


<s> const auto Format = getContext ( ) . getObjectFileInfo ( ) -> getObjectFileType ( ) ; bool IsMachO = Format == MCObjectFileInfo :: IsMachO ; if ( IsMachO ) { if ( Parser . getTok ( ) . is ( AsmToken :: Identifier ) || Parser . getTok ( ) . is ( AsmToken :: String ) ) { MCSymbol * Func = getParser ( ) . getContext ( ) . getOrCreateSymbol ( Parser . getTok ( ) . getIdentifier ( ) ) ;

getParser ( ) . getStreamer ( ) . EmitThumbFunc ( Func ) ;


<s> void <ISA_LIT>AsmParser :: getMnemonicAcceptInfo ( StringRef Mnemonic , bool & CanAcceptCarrySet , bool & CanAcceptPredicationCode ) {

if ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || ( ! isThumb ( ) && ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) ) ) {


<s> } else if ( ! isThumb ( ) ) { CanAcceptPredicationCode = Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && ! Mnemonic . startswith ( <STR_LIT> ) && ! Mnemonic . startswith ( <STR_LIT> ) ; } else if ( isThumbOne ( ) ) {

CanAcceptPredicationCode = Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> ;


<s> void <ISA_LIT>AsmParser :: getMnemonicAcceptInfo ( StringRef Mnemonic , StringRef FullInst , bool & CanAcceptCarrySet , bool & CanAcceptPredicationCode ) { CanAcceptCarrySet = Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || ( ! isThumb ( ) && ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) ) ; if ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || ( FullInst . startswith ( <STR_LIT> ) && FullInst . endswith ( <STR_LIT> ) ) || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) { CanAcceptPredicationCode = false ; } else if ( ! isThumb ( ) ) { CanAcceptPredicationCode = Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && ! Mnemonic . startswith ( <STR_LIT> ) && ! Mnemonic . startswith ( <STR_LIT> ) ;


<s> if ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) || ( FullInst . startswith ( <STR_LIT> ) && FullInst . endswith ( <STR_LIT> ) ) || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) {


<s> unsigned <ISA_LIT>AsmParser :: validateTargetOperandClass ( MCParsedAsmOperand & AsmOp , unsigned Kind ) { <ISA_LIT>Operand & Op = static_cast < <ISA_LIT>Operand & > ( AsmOp ) ; switch ( Kind ) { default : break ; case MCK__35_0 : if ( Op . isImm ( ) ) if ( const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Op . getImm ( ) ) ) if ( CE -> getValue ( ) == <NUM_LIT> ) return Match_Success ;


<s> Inst . addOperand ( MCOperand :: CreateImm ( unsigned ( getCondCode ( ) ) ) ) ;

Inst . addOperand ( MCOperand :: CreateReg ( <NUM_LIT> ) ) ;


<s> void addExpr ( MCInst & Inst , const MCExpr * Expr ) const {

if ( const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Expr ) ) Inst . addOperand ( MCOperand :: CreateImm ( CE -> getValue ( ) ) ) ;


<s> <ISA_LIT>AsmParser ( const Target & T , MCAsmParser & _Parser , TargetMachine & _TM ) : TargetAsmParser ( T ) , Parser ( _Parser ) , TM ( _TM ) {


<s> Kind = o . Kind ; StartLoc = o . StartLoc ; EndLoc = o . EndLoc ; switch ( Kind ) { case CondCode : CC = o . CC ;


<s> <ISA_LIT>Operand ( const <ISA_LIT>Operand & o ) : MCParsedAsmOperand ( ) { Kind = o . Kind ; StartLoc = o . StartLoc ; EndLoc = o . EndLoc ; switch ( Kind ) { case CondCode : CC = o . CC ; break ; case Token : Tok = o . Tok ; break ; case Register : Reg = o . Reg ; break ; case Immediate :


<s> Op -> Kind = CondCode ; Op -> CC . Val = CC ;


<s> break ; case Immediate : getImm ( ) -> print ( OS ) ; break ; case Memory : OS << <STR_LIT> ; break ; case Register :

OS << <STR_LIT> << getReg ( ) << <STR_LIT> ;


<s> switch ( Kind ) { case CondCode : OS << <ISA_LIT>CondCodeToString ( getCondCode ( ) ) ; break ; case Immediate : getImm ( ) -> print ( OS ) ;


<s> <STR_LIT> getCondCode ( ) const { assert ( Kind == CondCode && <STR_LIT> ) ;


<s> bool isImm ( ) const { return Kind == Immediate ;


<s> bool MatchInstruction ( SMLoc IDLoc , const SmallVectorImpl < MCParsedAsmOperand * > & Operands , MCInst & Inst ) {

if ( ! MatchInstructionImpl ( Operands , Inst ) ) return false ;


<s> if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) return Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . Lex ( ) ;


<s> else return Error ( L , <STR_LIT> ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) return Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . Lex ( ) ;


<s> Operands . push_back ( Op . take ( ) ) ; <ISA_LIT>Operand :: CreateCondCode ( Op , <STR_LIT> ( CC ) , NameLoc ) ; Operands . push_back ( Op . take ( ) ) ; while ( Next != StringRef :: npos ) { Start = Next ; Next = Name . find ( '.' , Start + <NUM_LIT> ) ; Head = Name . slice ( Start , Next ) ; <ISA_LIT>Operand :: CreateToken ( Op , Head , NameLoc ) ; Operands . push_back ( Op . take ( ) ) ; } if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { OwningPtr < <ISA_LIT>Operand > Op ; if ( ParseOperand ( Op ) ) return true ; Operands . push_back ( Op . take ( ) ) ; while ( getLexer ( ) . is ( AsmToken :: Comma ) ) { Parser . Lex ( ) ; if ( ParseOperand ( Op ) ) return true ; Operands . push_back ( Op . take ( ) ) ;


<s> unsigned CC = StringSwitch < unsigned > ( Head . substr ( Head . size ( ) - <NUM_LIT> ) ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( ~ <NUM_LIT> ) ; if ( CC != ~ <NUM_LIT> ) { Head = Head . slice ( <NUM_LIT> , Head . size ( ) - <NUM_LIT> ) ; } else CC = <STR_LIT> ; <ISA_LIT>Operand :: CreateToken ( Op , Head , NameLoc ) ; Operands . push_back ( Op . take ( ) ) ; <ISA_LIT>Operand :: CreateCondCode ( Op , <STR_LIT> ( CC ) , NameLoc ) ; Operands . push_back ( Op . take ( ) ) ; while ( Next != StringRef :: npos ) { Start = Next ; Next = Name . find ( '.' , Start + <NUM_LIT> ) ; Head = Name . slice ( Start , Next ) ;


<s> else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = Lsr ; else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = Asr ; else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = Ror ; else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = Rrx ; else return true ; Parser . Lex ( ) ; if ( St == Rrx ) return false ; const AsmToken & HashTok = Parser . getTok ( ) ; if ( HashTok . isNot ( AsmToken :: Hash ) ) return Error ( HashTok . getLoc ( ) , <STR_LIT> ) ;


<s> if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = Lsl ; else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = Lsr ; else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = Asr ; else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = Ror ; else if ( ShiftName == <STR_LIT> || ShiftName == <STR_LIT> ) St = Rrx ; else return true ; Parser . Lex ( ) ;


<s> if ( Offset >= <NUM_LIT> ) Inst . addOperand ( MCOperand :: CreateImm ( <STR_LIT> ( <STR_LIT> , Offset ) ) ) ; else Inst . addOperand ( MCOperand :: CreateImm ( <STR_LIT> ( <STR_LIT> , - Offset ) ) ) ;


<s> const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getMemOffset ( ) ) ; ( void ) CE ;

assert ( ( CE || CE -> getValue ( ) == <NUM_LIT> ) && <STR_LIT> ) ;


<s> assert ( N == <NUM_LIT> && isMemMode7 ( ) && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateReg ( getMemBaseRegNum ( ) ) ) ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getMemOffset ( ) ) ;


<s> assert ( N == <NUM_LIT> && isMemModeImmThumb ( ) && <STR_LIT> ) ;

Inst . addOperand ( MCOperand :: CreateReg ( getMemBaseRegNum ( ) ) ) ;


<s> assert ( N == <NUM_LIT> && isMemModeRegThumb ( ) && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateReg ( getMemBaseRegNum ( ) ) ) ; Inst . addOperand ( MCOperand :: CreateReg ( getMemOffsetRegNum ( ) ) ) ;


<s> assert ( N == <NUM_LIT> && isMemModeRegThumb ( ) && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateReg ( getMemBaseRegNum ( ) ) ) ;

Inst . addOperand ( MCOperand :: CreateReg ( getMemOffsetRegNum ( ) ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( <STR_LIT> ( Shift . ShiftTy , <NUM_LIT> ) ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ;

Inst . addOperand ( MCOperand :: CreateImm ( <STR_LIT> ( Shift . ShiftTy , <NUM_LIT> ) ) ) ;


<s> const MCExpr * <ISA_LIT>AsmParser :: ApplyPrefixToExpr ( const MCExpr * E , MCSymbolRefExpr :: VariantKind Variant ) { if ( Variant == MCSymbolRefExpr :: VK_None ) return E ; switch ( E -> getKind ( ) ) { case MCExpr :: Target : llvm_unreachable ( <STR_LIT> ) ; case MCExpr :: Constant : llvm_unreachable ( <STR_LIT> ) ;


<s> <ISA_LIT>AsmParser ( const Target & T , MCAsmParser & _Parser , TargetMachine & _TM ) : TargetAsmParser ( T ) , Parser ( _Parser ) , TM ( _TM ) {

setAvailableFeatures ( ComputeAvailableFeatures ( & TM . getSubtarget < <ISA_LIT>Subtarget > ( ) ) ) ;


<s> break ; case Immediate : Imm = o . Imm ; break ; case MemBarrierOpt : MBOpt = o . MBOpt ; break ; case Memory : Mem = o . Mem ; break ; case MSRMask : MMask = o . MMask ; break ; case ProcIFlags : IFlags = o . IFlags ; break ; case Shifter :


<s> Op -> StartLoc = S ; Op -> EndLoc = S ; return Op ;


<s> Op -> CC . Val = CC ; Op -> StartLoc = S ; Op -> EndLoc = S ; return Op ;


<s> Op -> StartLoc = S ; Op -> EndLoc = S ;


<s> static <ISA_LIT>Operand * CreateCoprocNum ( unsigned CopVal , SMLoc S ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( CoprocNum ) ; Op -> Cop . Val = CopVal ; Op -> StartLoc = S ; Op -> EndLoc = S ;


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( CoprocReg ) ; Op -> Cop . Val = CopVal ;


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( Immediate ) ;


<s> static <ISA_LIT>Operand * CreateMem ( unsigned BaseRegNum , bool OffsetIsReg , const MCExpr * Offset , int OffsetRegNum , bool OffsetRegShifted , enum <STR_LIT> ShiftType , const MCExpr * ShiftAmount , bool Preindexed , bool Postindexed , bool Negative , bool Writeback , SMLoc S , SMLoc E ) { assert ( ( OffsetRegNum == - <NUM_LIT> || OffsetIsReg ) && <STR_LIT> ) ; assert ( ( ! OffsetRegShifted || OffsetIsReg ) && <STR_LIT> ) ; assert ( ( Offset || OffsetIsReg ) && <STR_LIT> ) ; assert ( ( ! ShiftAmount || ( OffsetIsReg && OffsetRegShifted ) ) && <STR_LIT> ) ; assert ( ( ! Offset || ! OffsetIsReg ) && <STR_LIT> ) ; <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( Memory ) ; Op -> Mem . BaseRegNum = BaseRegNum ; Op -> Mem . OffsetIsReg = OffsetIsReg ;

if ( OffsetIsReg ) Op -> Mem . Offset . RegNum = OffsetRegNum ;


<s> Op -> MBOpt . Val = Opt ; Op -> StartLoc = S ; Op -> EndLoc = S ;


<s> static <ISA_LIT>Operand * CreateMemBarrierOpt ( <STR_LIT> Opt , SMLoc S ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( MemBarrierOpt ) ; Op -> MBOpt . Val = Opt ; Op -> StartLoc = S ;


<s> Op -> MMask . Val = MMask ; Op -> StartLoc = S ; Op -> EndLoc = S ;


<s> static <ISA_LIT>Operand * CreateMSRMask ( unsigned MMask , SMLoc S ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( MSRMask ) ; Op -> MMask . Val = MMask ;


<s> static <ISA_LIT>Operand * CreateProcIFlags ( <STR_LIT> IFlags , SMLoc S ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( ProcIFlags ) ; Op -> IFlags . Val = IFlags ;


<s> Op -> IFlags . Val = IFlags ; Op -> StartLoc = S ; Op -> EndLoc = S ;


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( Register ) ;


<s> for ( SmallVectorImpl < std :: pair < unsigned , SMLoc > > :: const_iterator I = Regs . begin ( ) , E = Regs . end ( ) ; I != E ; ++ I ) Op -> Registers . push_back ( I -> first ) ; array_pod_sort ( Op -> Registers . begin ( ) , Op -> Registers . end ( ) ) ; Op -> StartLoc = StartLoc ; Op -> EndLoc = EndLoc ;


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( Shifter ) ; Op -> Shift . ShiftTy = ShTy ; Op -> StartLoc = S ;


<s> static <ISA_LIT>Operand * CreateToken ( StringRef Str , SMLoc S ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( Token ) ; Op -> Tok . Data = Str . data ( ) ; Op -> Tok . Length = Str . size ( ) ; Op -> StartLoc = S ; Op -> EndLoc = S ; return Op ;


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( Token ) ; Op -> Tok . Data = Str . data ( ) ; Op -> Tok . Length = Str . size ( ) ; Op -> StartLoc = S ;


<s> case ProcIFlags : { OS << <STR_LIT> ; unsigned IFlags = getProcIFlags ( ) ; for ( int i = <NUM_LIT> ; i >= <NUM_LIT> ; -- i ) if ( IFlags & ( <NUM_LIT> << i ) ) OS << <STR_LIT> ( <NUM_LIT> << i ) ; OS << <STR_LIT> ; break ; } case Register : OS << <STR_LIT> << getReg ( ) << <STR_LIT> ; break ; case Shifter : OS << <STR_LIT> << getShiftOpcStr ( Shift . ShiftTy ) << <STR_LIT> ; break ; case RegisterList : case DPRRegisterList : case SPRRegisterList : { OS << <STR_LIT> ; const SmallVectorImpl < unsigned > & RegList = getRegList ( ) ; for ( SmallVectorImpl < unsigned > :: const_iterator I = RegList . begin ( ) , E = RegList . end ( ) ; I != E ; ) { OS << * I ; if ( ++ I < E ) OS << <STR_LIT> ; } OS << <STR_LIT> ; break ; }


<s> <STR_LIT> getMemBarrierOpt ( ) const { assert ( Kind == MemBarrierOpt && <STR_LIT> ) ;


<s> unsigned getMemBaseRegNum ( ) const {


<s> assert ( ! Mem . OffsetIsReg && <STR_LIT> ) ; return Mem . Offset . Value ;


<s> assert ( Mem . OffsetIsReg && <STR_LIT> ) ;


<s> unsigned getMemOffsetRegShifted ( ) const { assert ( Mem . OffsetIsReg && <STR_LIT> ) ;


<s> unsigned getMemOffsetRegShifted ( ) const { assert ( Mem . OffsetIsReg && <STR_LIT> ) ; return Mem . OffsetRegShifted ;


<s> bool getMemPreindexed ( ) const { return Mem . Preindexed ;


<s> const MCExpr * getMemShiftAmount ( ) const { assert ( Mem . OffsetIsReg && Mem . OffsetRegShifted && <STR_LIT> ) ;


<s> const MCExpr * getMemShiftAmount ( ) const {

assert ( Mem . OffsetIsReg && Mem . OffsetRegShifted && <STR_LIT> ) ;


<s> assert ( Mem . OffsetIsReg && Mem . OffsetRegShifted && <STR_LIT> ) ;


<s> bool getMemWriteback ( ) const { return Mem . Writeback ;


<s> if ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) {


<s> } if ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic . startswith ( <STR_LIT> ) ) { CanAcceptPredicationCode = false ; } else { CanAcceptPredicationCode = true ; } if ( isThumb ) if ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) CanAcceptPredicationCode = false ;


<s> assert ( Kind == ProcIFlags && <STR_LIT> ) ; return IFlags . Val ;


<s> assert ( ( Kind == Register || Kind == CCOut ) && <STR_LIT> ) ; return Reg . RegNum ;


<s> const SmallVectorImpl < unsigned > & getRegList ( ) const { assert ( ( Kind == RegisterList || Kind == DPRRegisterList || Kind == SPRRegisterList ) && <STR_LIT> ) ; return Registers ;


<s> bool isMemBarrierOpt ( ) const { return Kind == MemBarrierOpt ;


<s> if ( ! CE ) return false ; int64_t Value = CE -> getValue ( ) ;

return ( ( Value & <NUM_LIT> ) == <NUM_LIT> && Value <= <NUM_LIT> && Value >= - <NUM_LIT> ) ;


<s> const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getMemOffset ( ) ) ; if ( ! CE ) return false ; int64_t Value = CE -> getValue ( ) ;


<s> if ( ! isMemory ( ) || getMemPreindexed ( ) || getMemPostindexed ( ) || getMemOffsetIsReg ( ) || getMemNegative ( ) || getMemWriteback ( ) ) return false ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getMemOffset ( ) ) ; if ( ! CE ) return false ; if ( CE -> getValue ( ) ) return false ; return true ;


<s> if ( ! isMemory ( ) || getMemOffsetIsReg ( ) || getMemWriteback ( ) ) return false ;

const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getMemOffset ( ) ) ;


<s> bool isMemModeRegThumb ( ) const { if ( ! isMemory ( ) || ! getMemOffsetIsReg ( ) || getMemWriteback ( ) ) return false ;


<s> bool isMemory ( ) const { return Kind == Memory ;


<s> bool isMSRMask ( ) const { return Kind == MSRMask ;


<s> bool isProcIFlags ( ) const { return Kind == ProcIFlags ;


<s> bool isRegList ( ) const { return Kind == RegisterList ;


<s> if ( MatchResult2 == Match_Success ) MatchResult = Match_Success ; else { <ISA_LIT>Operand * CCOut = ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) ; Operands . erase ( Operands . begin ( ) + <NUM_LIT> ) ; delete CCOut ; } } else if ( MatchResult == Match_MnemonicFail ) { StringRef Mnemonic = ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> getToken ( ) ; if ( Mnemonic . substr ( Mnemonic . size ( ) - <NUM_LIT> ) == <STR_LIT> ) { StringRef MnemonicNoS = Mnemonic . slice ( <NUM_LIT> , Mnemonic . size ( ) - <NUM_LIT> ) ; SMLoc NameLoc = ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> getStartLoc ( ) ; <ISA_LIT>Operand * OldMnemonic = ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) ; Operands . erase ( Operands . begin ( ) ) ; delete OldMnemonic ; Operands . insert ( Operands . begin ( ) , <ISA_LIT>Operand :: CreateToken ( MnemonicNoS , NameLoc ) ) ; Operands . insert ( Operands . begin ( ) + <NUM_LIT> , <ISA_LIT>Operand :: CreateCCOut ( <STR_LIT> , NameLoc ) ) ; MatchResult2 = MatchInstructionImpl ( Operands , Inst , ErrorInfo ) ; if ( MatchResult2 == Match_Success ) MatchResult = Match_Success ; else { <ISA_LIT>Operand * OldMnemonic = ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) ; Operands . erase ( Operands . begin ( ) ) ; delete OldMnemonic ; Operands . insert ( Operands . begin ( ) , <ISA_LIT>Operand :: CreateToken ( Mnemonic , NameLoc ) ) ; <ISA_LIT>Operand * CCOut = ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) ;


<s> if ( Val == <NUM_LIT> ) { assert ( TM . getSubtarget < <ISA_LIT>Subtarget > ( ) . isThumb ( ) && <STR_LIT> ) ; getParser ( ) . getStreamer ( ) . EmitAssemblerFlag ( MCAF_Code16 ) ; } else { assert ( ! TM . getSubtarget < <ISA_LIT>Subtarget > ( ) . isThumb ( ) && <STR_LIT> ) ; getParser ( ) . getStreamer ( ) . EmitAssemblerFlag ( MCAF_Code32 ) ; } return false ;


<s> assert ( TM . getSubtarget < <ISA_LIT>Subtarget > ( ) . isThumb ( ) && <STR_LIT> ) ; getParser ( ) . getStreamer ( ) . EmitAssemblerFlag ( MCAF_Code16 ) ; } else { assert ( ! TM . getSubtarget < <ISA_LIT>Subtarget > ( ) . isThumb ( ) && <STR_LIT> ) ;

getParser ( ) . getStreamer ( ) . EmitAssemblerFlag ( MCAF_Code32 ) ;