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

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


<s> bool isMemImm8s4Offset ( ) const { if ( isImm ( ) && ! isa < MCConstantExpr > ( getImm ( ) ) ) return true ; if ( ! isMem ( ) || 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 & <NUM_LIT> ) == <NUM_LIT> ) || Val == INT32_MIN ;


<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 . 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> ) ;


return Memory . OffsetRegNum == <NUM_LIT> && Memory . OffsetImm == <NUM_LIT> && ( alignOK || Memory . Alignment == <NUM_LIT> ) ;


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


<s> bool isMemPosImm8Offset ( ) const { if ( ! isMem ( ) || 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> ;


<s> if ( ! isMem ( ) || ! Memory . OffsetRegNum || Memory . Alignment != <NUM_LIT> ) return false ;


<s> bool isMemTBB ( ) const { if ( ! isMem ( ) || ! Memory . OffsetRegNum || Memory . isNegative || Memory . ShiftType != <STR_LIT> || Memory . Alignment != <NUM_LIT> ) return false ; return true ;


<s> if ( ! isMem ( ) || ! Memory . OffsetRegNum || Memory . isNegative || Memory . ShiftType != <STR_LIT> || Memory . Alignment != <NUM_LIT> ) return false ; return true ;


<s> if ( ! isMem ( ) || Memory . OffsetRegNum != <NUM_LIT> || ! is<ISA_LIT>LowRegister ( Memory . BaseRegNum ) || Memory . Alignment != <NUM_LIT> ) return false ;

if ( ! Memory . OffsetImm ) return true ;


return Val >= <NUM_LIT> && Val <= <NUM_LIT> && ( Val % <NUM_LIT> ) == <NUM_LIT> ;


<s> if ( ! isMem ( ) || ! Memory . OffsetRegNum || Memory . isNegative || Memory . ShiftType != <STR_LIT> || Memory . Alignment != <NUM_LIT> ) return false ; return is<ISA_LIT>LowRegister ( Memory . BaseRegNum ) && ( ! Memory . OffsetRegNum || is<ISA_LIT>LowRegister ( Memory . OffsetRegNum ) ) ;


<s> bool isMemThumbSPI ( ) const { if ( ! isMem ( ) || Memory . OffsetRegNum != <NUM_LIT> || Memory . BaseRegNum != <STR_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 % <NUM_LIT> ) == <NUM_LIT> ;


<s> bool isMemThumbSPI ( ) const { if ( ! isMem ( ) || Memory . OffsetRegNum != <NUM_LIT> || Memory . BaseRegNum != <STR_LIT> || Memory . Alignment != <NUM_LIT> ) return false ;


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

return ( Val >= <NUM_LIT> && Val < <NUM_LIT> ) ;


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


<s> bool isNEONi16splat ( ) const { if ( ! isImm ( ) ) return false ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! CE ) return false ; int64_t Value = CE -> getValue ( ) ; return ( Value >= <NUM_LIT> && Value < <NUM_LIT> ) || ( Value >= <NUM_LIT> && Value <= <NUM_LIT> ) ;


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

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


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


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

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


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


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


<s> uint64_t Value = CE -> getValue ( ) ; for ( unsigned i = <NUM_LIT> ; i < <NUM_LIT> ; ++ i ) if ( ( Value & <NUM_LIT> ) != <NUM_LIT> && ( Value & <NUM_LIT> ) != <NUM_LIT> ) return false ;


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

return Value >= <NUM_LIT> && Value < <NUM_LIT> ;


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


<s> bool isPKHASRImm ( ) const { if ( ! isImm ( ) ) return false ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! CE ) return false ;


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

return Value > <NUM_LIT> && Value <= <NUM_LIT> ;


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


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


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


<s> bool isPostIdxReg ( ) const { return Kind == k_PostIndexRegister && PostIdxReg . ShiftTy == <STR_LIT> ;


<s> bool isPostIdxRegShifted ( ) const {


<s> bool isRegShiftedReg ( ) const { return Kind == k_ShiftedRegister ;


<s> bool isRotImm ( ) const { return Kind == k_RotateImmediate ;


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


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


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


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


<s> if ( ! isImm ( ) ) return false ; if ( isa < MCSymbolRefExpr > ( Imm . Val ) ) return true ; if ( const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Imm . Val ) ) { int64_t Val = CE -> getValue ( ) ;


<s> int64_t Align = <NUM_LIT> << scale ; int64_t Max = Align * ( ( <NUM_LIT> << ( width - <NUM_LIT> ) ) - <NUM_LIT> ) ;

int64_t Min = - Align * ( <NUM_LIT> << ( width - <NUM_LIT> ) ) ;


<s> return Kind == k_VectorListAllLanes && ! VectorList . isDoubleSpaced ;


<s> bool isSingleSpacedVectorAllLanes ( ) const { return Kind == k_VectorListAllLanes && ! VectorList . isDoubleSpaced ;


<s> return Kind == k_VectorListIndexed && ! VectorList . isDoubleSpaced ;


<s> bool isSingleSpacedVectorIndexed ( ) const { return Kind == k_VectorListIndexed && ! VectorList . isDoubleSpaced ;


<s> if ( Memory . ShiftType == <STR_LIT> ) return true ; if ( Memory . ShiftType != <STR_LIT> || Memory . ShiftImm > <NUM_LIT> ) return false ;


<s> bool isT2MemRegOffset ( ) const { if ( ! isMem ( ) || ! Memory . OffsetRegNum || Memory . isNegative || Memory . Alignment != <NUM_LIT> ) return false ;

if ( Memory . ShiftType == <STR_LIT> ) return true ;


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


<s> bool isT2SOImmNeg ( ) const { if ( ! isImm ( ) ) return false ;

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


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


<s> bool isT2SOImmNot ( ) const { 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> && <STR_LIT> ( ~ Value ) != - <NUM_LIT> ;


<s> const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! CE ) return false ;


<s> return ( STI . getFeatureBits ( ) & <STR_LIT> ) != <NUM_LIT> ;


<s> bool isThumbMemPC ( ) const { int64_t Val = <NUM_LIT> ; if ( isImm ( ) ) { if ( isa < MCSymbolRefExpr > ( Imm . Val ) ) return true ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Imm . Val ) ; if ( ! CE ) return false ;


<s> if ( ! Memory . OffsetImm || Memory . OffsetRegNum ) return false ; if ( Memory . BaseRegNum != <STR_LIT> ) return false ; Val = Memory . OffsetImm -> getValue ( ) ; } else return false ;

return ( ( Val % <NUM_LIT> ) == <NUM_LIT> ) && ( Val >= <NUM_LIT> ) && ( Val <= <NUM_LIT> ) ;


<s> bool isThumbOne ( ) const { return isThumb ( ) && ( STI . getFeatureBits ( ) & <STR_LIT> ) == <NUM_LIT> ;


return isThumb ( ) && ( STI . getFeatureBits ( ) & <STR_LIT> ) == <NUM_LIT> ;


<s> return isThumb ( ) && ( STI . getFeatureBits ( ) & <STR_LIT> ) ;


<s> bool isUnsignedOffset ( ) const { if ( ! isImm ( ) ) return false ; if ( isa < MCSymbolRefExpr > ( Imm . Val ) ) return true ;

if ( const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Imm . Val ) ) {


<s> if ( isa < MCSymbolRefExpr > ( Imm . Val ) ) return true ; if ( const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Imm . Val ) ) { int64_t Val = CE -> getValue ( ) ; int64_t Align = <NUM_LIT> << scale ; int64_t Max = Align * ( ( <NUM_LIT> << width ) - <NUM_LIT> ) ; return ( ( Val % Align ) == <NUM_LIT> ) && ( Val >= <NUM_LIT> ) && ( Val <= Max ) ; } return false ;


<s> bool isVecListDPair ( ) const { if ( ! isSingleSpacedVectorList ( ) ) return false ; return ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( VectorList . RegNum ) ) ;


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

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


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


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


<s> bool isVecListDPairSpaced ( ) const { if ( isSingleSpacedVectorList ( ) ) return false ;


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

return VectorList . Count == <NUM_LIT> ;


<s> return VectorList . Count == <NUM_LIT> ;


<s> bool isVecListFourDAllLanes ( ) const { if ( ! isSingleSpacedVectorAllLanes ( ) ) return false ;


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

return VectorList . Count == <NUM_LIT> && VectorList . LaneIndex <= <NUM_LIT> ;


<s> bool isVecListFourDHWordIndexed ( ) const { if ( ! isSingleSpacedVectorIndexed ( ) ) return false ; return VectorList . Count == <NUM_LIT> && VectorList . LaneIndex <= <NUM_LIT> ;


<s> bool isVecListFourDWordIndexed ( ) const { if ( ! isSingleSpacedVectorIndexed ( ) ) return false ;


<s> bool isVecListFourQ ( ) const { if ( ! isDoubleSpacedVectorList ( ) ) return false ;


<s> if ( ! isDoubleSpacedVectorList ( ) ) return false ; return VectorList . Count == <NUM_LIT> ;


<s> bool isVecListFourQHWordIndexed ( ) const {

if ( ! isDoubleSpacedVectorIndexed ( ) ) return false ;


<s> bool isVecListFourQWordIndexed ( ) const { if ( ! isDoubleSpacedVectorIndexed ( ) ) return false ;


<s> bool isVecListFourQWordIndexed ( ) const {


if ( ! isSingleSpacedVectorList ( ) ) return false ;


<s> bool isVecListOneD ( ) const { if ( ! isSingleSpacedVectorList ( ) ) return false ; return VectorList . Count == <NUM_LIT> ;


<s> bool isVecListOneDAllLanes ( ) const { if ( ! isSingleSpacedVectorAllLanes ( ) ) return false ;


<s> bool isVecListOneDByteIndexed ( ) const { if ( ! isSingleSpacedVectorIndexed ( ) ) return false ; return VectorList . Count == <NUM_LIT> && VectorList . LaneIndex <= <NUM_LIT> ;


<s> bool isVecListOneDHWordIndexed ( ) const {

if ( ! isSingleSpacedVectorIndexed ( ) ) return false ;


<s> bool isVecListOneDWordIndexed ( ) const {


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


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


<s> bool isVecListThreeDByteIndexed ( ) const { if ( ! isSingleSpacedVectorIndexed ( ) ) return false ;


<s> bool isVecListThreeDHWordIndexed ( ) const { if ( ! isSingleSpacedVectorIndexed ( ) ) return false ;


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


<s> bool isVecListThreeQ ( ) const { if ( ! isDoubleSpacedVectorList ( ) ) return false ; return VectorList . Count == <NUM_LIT> ;


<s> bool isVecListThreeQAllLanes ( ) const {

if ( ! isDoubleSpacedVectorAllLanes ( ) ) return false ;


<s> bool isVecListThreeQAllLanes ( ) const { if ( ! isDoubleSpacedVectorAllLanes ( ) ) return false ;


<s> bool isVecListThreeQHWordIndexed ( ) const { if ( ! isDoubleSpacedVectorIndexed ( ) ) return false ; return VectorList . Count == <NUM_LIT> && VectorList . LaneIndex <= <NUM_LIT> ;


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


<s> if ( ! isDoubleSpacedVectorIndexed ( ) ) return false ; return VectorList . Count == <NUM_LIT> && VectorList . LaneIndex <= <NUM_LIT> ;


<s> bool isVecListTwoDByteIndexed ( ) const {


<s> return VectorList . Count == <NUM_LIT> && VectorList . LaneIndex <= <NUM_LIT> ;


<s> bool isVecListTwoDHWordIndexed ( ) const { if ( ! isSingleSpacedVectorIndexed ( ) ) return false ;


<s> if ( Kind != k_VectorIndex ) return false ;


<s> if ( Kind != k_VectorIndex ) return false ; return VectorIndex . Val < <NUM_LIT> ;


<s> bool isVectorIndex32 ( ) const { if ( Kind != k_VectorIndex ) return false ;


<s> unsigned OpReg = Inst . getOperand ( i ) . getReg ( ) ; if ( OpReg == Reg ) return true ; } return false ;


<s> void LLVMInitialize<ISA_LIT>AsmParser ( ) { RegisterMCAsmParser < <ISA_LIT>AsmParser > X ( The<ISA_LIT>Target ) ; RegisterMCAsmParser < <ISA_LIT>AsmParser > Y ( TheThumbTarget ) ;


<s> unsigned MatchResult ; MatchResult = MatchInstructionImpl ( Operands , Inst , ErrorInfo , MatchingInlineAsm ) ; switch ( MatchResult ) { default : break ; case Match_Success : if ( validateInstruction ( Inst , Operands ) ) { forwardITPosition ( ) ; return true ; } { bool wasInITBlock = inITBlock ( ) ; while ( processInstruction ( Inst , Operands ) ) ; if ( wasInITBlock && hasV8Ops ( ) && isThumb ( ) && ! isV8EligibleForIT ( & Inst ) ) { Warning ( IDLoc , <STR_LIT> ) ; } } forwardITPosition ( ) ; if ( Inst . getOpcode ( ) == <STR_LIT> ) return false ; Inst . setLoc ( IDLoc ) ; Out . EmitInstruction ( Inst , STI ) ; return false ; case Match_MissingFeature : { assert ( ErrorInfo && <STR_LIT> ) ; std :: string Msg = <STR_LIT> ; unsigned Mask = <NUM_LIT> ; for ( unsigned i = <NUM_LIT> ; i < ( sizeof ( ErrorInfo ) * <NUM_LIT> - <NUM_LIT> ) ; ++ i ) { if ( ErrorInfo & Mask ) { Msg += <STR_LIT> ; Msg += getSubtargetFeatureName ( ErrorInfo & Mask ) ; } Mask <<= <NUM_LIT> ; } return Error ( IDLoc , Msg ) ; } case Match_InvalidOperand : { SMLoc ErrorLoc = IDLoc ; if ( ErrorInfo != ~ <NUM_LIT> ) {

if ( ErrorInfo >= Operands . size ( ) ) return Error ( IDLoc , <STR_LIT> ) ;


<s> if ( Name [ <NUM_LIT> ] != CoprocOp ) return - <NUM_LIT> ; switch ( Name [ <NUM_LIT> ] ) { default : return - <NUM_LIT> ; case '0' : return <NUM_LIT> ; case '1' : return <NUM_LIT> ; case '2' : return <NUM_LIT> ; case '3' : return <NUM_LIT> ; case '4' : return <NUM_LIT> ; case '5' : return <NUM_LIT> ; case '6' : return <NUM_LIT> ; case '7' : return <NUM_LIT> ; case '8' : return <NUM_LIT> ; case '9' : return <NUM_LIT> ;


<s> return Parser . Note ( L , Msg , Ranges ) ;


<s> void Note ( SMLoc L , const Twine & Msg , ArrayRef < SMRange > Ranges = None ) { return Parser . Note ( L , Msg , Ranges ) ;


<s> void <ISA_LIT>AsmParser :: onLabelParsed ( MCSymbol * Symbol ) {


<s> getParser ( ) . getStreamer ( ) . EmitThumbFunc ( Symbol ) ; NextSymbolIsThumb = false ; }


<s> const MCExpr * Offset ; SMLoc E ; if ( getParser ( ) . parseExpression ( Offset , E ) ) return MatchOperand_ParseFail ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Offset ) ; if ( ! CE ) { Error ( S , <STR_LIT> ) ; return MatchOperand_ParseFail ; } int32_t Val = CE -> getValue ( ) ; if ( isNegative && Val == <NUM_LIT> ) Val = INT32_MIN ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( MCConstantExpr :: Create ( Val , getContext ( ) ) , S , E ) ) ; return MatchOperand_Success ; } bool haveEaten = false ; bool isAdd = true ; if ( Tok . is ( AsmToken :: Plus ) ) { Parser . Lex ( ) ; haveEaten = true ; } else if ( Tok . is ( AsmToken :: Minus ) ) {


<s> const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( LSBExpr ) ; if ( ! CE ) { Error ( E , <STR_LIT> ) ; return MatchOperand_ParseFail ; } int64_t LSB = CE -> getValue ( ) ; if ( LSB < <NUM_LIT> || LSB > <NUM_LIT> ) { Error ( E , <STR_LIT> ) ; return MatchOperand_ParseFail ; } E = Parser . getTok ( ) . getLoc ( ) ; if ( Parser . getTok ( ) . isNot ( AsmToken :: Comma ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } Parser . Lex ( ) ; if ( Parser . getTok ( ) . isNot ( AsmToken :: Hash ) && Parser . getTok ( ) . isNot ( AsmToken :: Dollar ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ;


<s> Error ( E , <STR_LIT> ) ; return MatchOperand_ParseFail ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( LSBExpr ) ; if ( ! CE ) { Error ( E , <STR_LIT> ) ; return MatchOperand_ParseFail ; } int64_t LSB = CE -> getValue ( ) ; if ( LSB < <NUM_LIT> || LSB > <NUM_LIT> ) { Error ( E , <STR_LIT> ) ; return MatchOperand_ParseFail ; } E = Parser . getTok ( ) . getLoc ( ) ; if ( Parser . getTok ( ) . isNot ( AsmToken :: Comma ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } Parser . Lex ( ) ; if ( Parser . getTok ( ) . isNot ( AsmToken :: Hash ) && Parser . getTok ( ) . isNot ( AsmToken :: Dollar ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } Parser . Lex ( ) ; const MCExpr * WidthExpr ; SMLoc EndLoc ; if ( getParser ( ) . parseExpression ( WidthExpr , EndLoc ) ) { Error ( E , <STR_LIT> ) ; return MatchOperand_ParseFail ;


<s> SMLoc S = Parser . getTok ( ) . getLoc ( ) ; const AsmToken & Tok = Parser . getTok ( ) ; if ( Tok . isNot ( AsmToken :: Identifier ) ) return MatchOperand_NoMatch ; int Num = MatchCoprocessorOperandName ( Tok . getString ( ) , 'p' ) ; if ( Num == - <NUM_LIT> ) return MatchOperand_NoMatch ;


<s> } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Expr ) ; if ( ! CE || CE -> getValue ( ) < <NUM_LIT> || CE -> getValue ( ) > <NUM_LIT> ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } int Val = CE -> getValue ( ) ; if ( Parser . getTok ( ) . isNot ( AsmToken :: RCurly ) ) return MatchOperand_ParseFail ; SMLoc E = Parser . getTok ( ) . getEndLoc ( ) ;


<s> SMLoc S = Parser . getTok ( ) . getLoc ( ) ; const AsmToken & Tok = Parser . getTok ( ) ; if ( Tok . isNot ( AsmToken :: Identifier ) ) return MatchOperand_NoMatch ; int Reg = MatchCoprocessorOperandName ( Tok . getString ( ) , 'c' ) ;

if ( Reg == - <NUM_LIT> ) return MatchOperand_NoMatch ;


<s> else if ( IDVal == <STR_LIT> ) return parseDirectiveSyntax ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveUnreq ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveArch ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveEabiAttr ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveCPU ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveFPU ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveFnStart ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveFnEnd ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveCantUnwind ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectivePersonality ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveHandlerData ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveSetFP ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectivePad ( DirectiveID . getLoc ( ) ) ;

else if ( IDVal == <STR_LIT> ) return parseDirectiveRegSave ( DirectiveID . getLoc ( ) , false ) ;


<s> else if ( IDVal == <STR_LIT> ) return parseDirectiveFnStart ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveFnEnd ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveCantUnwind ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectivePersonality ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveHandlerData ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveSetFP ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectivePad ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveRegSave ( DirectiveID . getLoc ( ) , false ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveRegSave ( DirectiveID . getLoc ( ) , true ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveInst ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveInst ( DirectiveID . getLoc ( ) , 'n' ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveInst ( DirectiveID . getLoc ( ) , 'w' ) ; else if ( IDVal == <STR_LIT> || IDVal == <STR_LIT> ) return parseDirectiveLtorg ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveEven ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectivePersonalityIndex ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveUnwindRaw ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveTLSDescSeq ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveMovSP ( DirectiveID . getLoc ( ) ) ;

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


<s> if ( getStreamer ( ) . getCurrentSection ( ) . first -> UseCodeAlign ( ) ) getStreamer ( ) . EmitCodeAlignment ( <NUM_LIT> , <NUM_LIT> ) ; else getStreamer ( ) . EmitValueToAlignment ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ;


<s> if ( ID == <STR_LIT> ) { Error ( L , <STR_LIT> ) ; return false ; } getTargetStreamer ( ) . emitArch ( ID ) ;


<s> if ( Extensions [ EI ] . Extension != Extension ) continue ; unsigned FB = getAvailableFeatures ( ) ; if ( ( FB & Extensions [ EI ] . ArchCheck ) != Extensions [ EI ] . ArchCheck ) { Error ( ExtLoc , <STR_LIT> + Extension + <STR_LIT> <STR_LIT> ) ; return false ; } if ( ! Extensions [ EI ] . Features ) report_fatal_error ( <STR_LIT> + Extension ) ; if ( EnableFeature ) FB |= ComputeAvailableFeatures ( Extensions [ EI ] . Features ) ; else FB &= ~ ComputeAvailableFeatures ( Extensions [ EI ] . Features ) ; setAvailableFeatures ( FB ) ; return false ; } Error ( ExtLoc , <STR_LIT> + Extension ) ; Parser . eatToEndOfStatement ( ) ; return false ;


<s> Error ( L , <STR_LIT> ) ; return false ; } Parser . Lex ( ) ; if ( ! has<ISA_LIT> ( ) ) { Error ( L , <STR_LIT> ) ; return false ; } if ( isThumb ( ) ) SwitchMode ( ) ; getParser ( ) . getStreamer ( ) . EmitAssemblerFlag ( MCAF_Code32 ) ; return false ;


<s> return false ; } int64_t Val = Parser . getTok ( ) . getIntVal ( ) ; if ( Val != <NUM_LIT> && Val != <NUM_LIT> ) { Error ( L , <STR_LIT> ) ; return false ; } Parser . Lex ( ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return false ; } Parser . Lex ( ) ; if ( Val == <NUM_LIT> ) {


<s> bool <ISA_LIT>AsmParser :: parseDirectiveCPU ( SMLoc L ) { StringRef CPU = getParser ( ) . parseStringToEndOfStatement ( ) . trim ( ) ;

getTargetStreamer ( ) . emitTextAttribute ( <STR_LIT> , CPU ) ;


<s> getTargetStreamer ( ) . emitTextAttribute ( <STR_LIT> , CPU ) ;


<s> SMLoc TagLoc ; TagLoc = Parser . getTok ( ) . getLoc ( ) ; if ( Parser . getTok ( ) . is ( AsmToken :: Identifier ) ) { StringRef Name = Parser . getTok ( ) . getIdentifier ( ) ; Tag = <STR_LIT> ( Name ) ; if ( Tag == - <NUM_LIT> ) { Error ( TagLoc , <STR_LIT> + Name ) ; Parser . eatToEndOfStatement ( ) ; return false ; } Parser . Lex ( ) ; } else { const MCExpr * AttrExpr ; TagLoc = Parser . getTok ( ) . getLoc ( ) ; if ( Parser . parseExpression ( AttrExpr ) ) { Parser . eatToEndOfStatement ( ) ; return false ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( AttrExpr ) ; if ( ! CE ) { Error ( TagLoc , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } Tag = CE -> getValue ( ) ; } if ( Parser . getTok ( ) . isNot ( AsmToken :: Comma ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } Parser . Lex ( ) ; 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> if ( ! Section ) { getStreamer ( ) . InitSections ( ) ; Section = getStreamer ( ) . getCurrentSection ( ) . first ; }

if ( Section -> UseCodeAlign ( ) ) getStreamer ( ) . EmitCodeAlignment ( <NUM_LIT> ) ;


<s> TokError ( <STR_LIT> ) ; return false ; } if ( ! Section ) { getStreamer ( ) . InitSections ( ) ; Section = getStreamer ( ) . getCurrentSection ( ) . first ; } if ( Section -> UseCodeAlign ( ) ) getStreamer ( ) . EmitCodeAlignment ( <NUM_LIT> ) ; else getStreamer ( ) . EmitValueToAlignment ( <NUM_LIT> ) ; return false ;


<s> getTargetStreamer ( ) . emitFnEnd ( ) ; UC . reset ( ) ;


<s> StringRef FPU = getParser ( ) . parseStringToEndOfStatement ( ) . trim ( ) ; unsigned ID = StringSwitch < unsigned > ( FPU ) . Default ( <STR_LIT> ) ; if ( ID == <STR_LIT> ) { Error ( L , <STR_LIT> ) ;


<s> } if ( UC . cantUnwind ( ) ) { Error ( L , <STR_LIT> ) ; UC . emitCantUnwindLocNotes ( ) ; return false ;


<s> getTargetStreamer ( ) . emitCurrentConstantPool ( ) ;


<s> if ( Parser . getTok ( ) . isNot ( AsmToken :: Hash ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } Parser . Lex ( ) ; const MCExpr * OffsetExpr ; SMLoc OffsetLoc = Parser . getTok ( ) . getLoc ( ) ; if ( Parser . parseExpression ( OffsetExpr ) ) { Parser . eatToEndOfStatement ( ) ; Error ( OffsetLoc , <STR_LIT> ) ; return false ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( OffsetExpr ) ; if ( ! CE ) { Parser . eatToEndOfStatement ( ) ; Error ( OffsetLoc , <STR_LIT> ) ; return false ; } Offset = CE -> getValue ( ) ; } getTargetStreamer ( ) . emitMovSP ( SPReg , Offset ) ; UC . saveFPReg ( SPReg ) ; return false ;


<s> Error ( getLexer ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } StringRef Arch = Parser . getTok ( ) . getString ( ) ; SMLoc ArchLoc = Parser . getTok ( ) . getLoc ( ) ; getLexer ( ) . Lex ( ) ; unsigned ID = StringSwitch < unsigned > ( Arch ) . Case ( NAME , <STR_LIT> ) . Case ( NAME , <STR_LIT> ) . Default ( <STR_LIT> ) ; if ( ID == <STR_LIT> ) { Error ( ArchLoc , <STR_LIT> + Arch + <STR_LIT> ) ;


<s> } if ( UC . hasHandlerData ( ) ) { Error ( L , <STR_LIT> ) ; return false ; } if ( Parser . getTok ( ) . isNot ( AsmToken :: Hash ) && Parser . getTok ( ) . isNot ( AsmToken :: Dollar ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return false ; } Parser . Lex ( ) ; const MCExpr * OffsetExpr ; SMLoc ExLoc = Parser . getTok ( ) . getLoc ( ) ; SMLoc EndLoc ;

if ( getParser ( ) . parseExpression ( OffsetExpr , EndLoc ) ) {


<s> Error ( L , <STR_LIT> ) ; UC . emitCantUnwindLocNotes ( ) ; return false ; } if ( UC . hasHandlerData ( ) ) { Error ( L , <STR_LIT> ) ; UC . emitHandlerDataLocNotes ( ) ; return false ; } if ( HasExistingPersonality ) { Parser . eatToEndOfStatement ( ) ; Error ( L , <STR_LIT> ) ; UC . emitPersonalityLocNotes ( ) ; return false ; } if ( Parser . getTok ( ) . isNot ( AsmToken :: Identifier ) ) { Parser . eatToEndOfStatement ( ) ; Error ( L , <STR_LIT> ) ; return false ; } StringRef Name ( Parser . getTok ( ) . getIdentifier ( ) ) ; Parser . Lex ( ) ;

MCSymbol * PR = getParser ( ) . getContext ( ) . GetOrCreateSymbol ( Name ) ;


<s> bool <ISA_LIT>AsmParser :: parseDirectiveRegSave ( SMLoc L , bool IsVector ) { if ( ! UC . hasFnStart ( ) ) { Error ( L , <STR_LIT> ) ; return false ; } if ( UC . hasHandlerData ( ) ) { Error ( L , <STR_LIT> ) ; return false ; } struct CleanupObject { SmallVector < MCParsedAsmOperand * , <NUM_LIT> > Operands ; ~ CleanupObject ( ) { for ( unsigned I = <NUM_LIT> , E = Operands . size ( ) ; I != E ; ++ I ) delete Operands [ I ] ; } } CO ; if ( parseRegisterList ( CO . Operands ) ) return false ;

<ISA_LIT>Operand * Op = ( <ISA_LIT>Operand * ) CO . Operands [ <NUM_LIT> ] ;


<s> Parser . Lex ( ) ; if ( RegisterReqs . GetOrCreateValue ( Name , Reg ) . getValue ( ) != Reg ) { Error ( SRegLoc , <STR_LIT> + Name + <STR_LIT> ) ; return false ; }


<s> int SPReg = tryParseRegister ( ) ; if ( SPReg == - <NUM_LIT> ) { Error ( SPRegLoc , <STR_LIT> ) ; return false ; } if ( SPReg != <STR_LIT> && SPReg != UC . getFPReg ( ) ) { Error ( SPRegLoc , <STR_LIT> ) ; return false ; } UC . saveFPReg ( FPReg ) ; int64_t Offset = <NUM_LIT> ; if ( Parser . getTok ( ) . is ( AsmToken :: Comma ) ) { Parser . Lex ( ) ; if ( Parser . getTok ( ) . isNot ( AsmToken :: Hash ) && Parser . getTok ( ) . isNot ( AsmToken :: Dollar ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return false ; }


<s> Error ( L , <STR_LIT> ) ; return false ; } SMLoc FPRegLoc = Parser . getTok ( ) . getLoc ( ) ; int FPReg = tryParseRegister ( ) ; if ( FPReg == - <NUM_LIT> ) { Error ( FPRegLoc , <STR_LIT> ) ; return false ; } if ( Parser . getTok ( ) . isNot ( AsmToken :: Comma ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return false ; } Parser . Lex ( ) ; SMLoc SPRegLoc = Parser . getTok ( ) . getLoc ( ) ; int SPReg = tryParseRegister ( ) ; if ( SPReg == - <NUM_LIT> ) {


<s> } else if ( Mode == <STR_LIT> || Mode == <STR_LIT> ) { Error ( L , <STR_LIT> ) ; return false ; } else { Error ( L , <STR_LIT> ) ; return false ; }

if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) {


<s> Error ( L , <STR_LIT> ) ; return false ; } if ( ! isThumb ( ) ) SwitchMode ( ) ; getParser ( ) . getStreamer ( ) . EmitAssemblerFlag ( MCAF_Code16 ) ; return false ;


<s> if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { Error ( L , <STR_LIT> ) ; return false ; } Parser . Lex ( ) ; if ( ! hasThumb ( ) ) { Error ( L , <STR_LIT> ) ; return false ; } if ( ! isThumb ( ) ) SwitchMode ( ) ;

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


<s> 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 ( ) ) ;


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


<s> Error ( L , <STR_LIT> ) ; return false ; } RegisterReqs . erase ( Parser . getTok ( ) . getIdentifier ( ) . lower ( ) ) ; Parser . Lex ( ) ; return false ;


<s> return false ; } RegisterReqs . erase ( Parser . getTok ( ) . getIdentifier ( ) . lower ( ) ) ;


<s> Error ( OffsetLoc , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( OffsetExpr ) ; if ( ! CE ) { Error ( OffsetLoc , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } StackOffset = CE -> getValue ( ) ; if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) { Error ( getLexer ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } Parser . Lex ( ) ; SmallVector < uint8_t , <NUM_LIT> > Opcodes ; for ( ; ; ) { const MCExpr * OE ; SMLoc OpcodeLoc = getLexer ( ) . getLoc ( ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) || Parser . parseExpression ( OE ) ) { Error ( OpcodeLoc , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } const MCConstantExpr * OC = dyn_cast < MCConstantExpr > ( OE ) ; if ( ! OC ) { Error ( OpcodeLoc , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } const int64_t Opcode = OC -> getValue ( ) ; if ( Opcode & ~ <NUM_LIT> ) { Error ( OpcodeLoc , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } Opcodes . push_back ( uint8_t ( Opcode ) ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ; if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) { Error ( getLexer ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; }


<s> for ( ; ; ) { const MCExpr * OE ; SMLoc OpcodeLoc = getLexer ( ) . getLoc ( ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) || Parser . parseExpression ( OE ) ) { Error ( OpcodeLoc , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } const MCConstantExpr * OC = dyn_cast < MCConstantExpr > ( OE ) ; if ( ! OC ) { Error ( OpcodeLoc , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } const int64_t Opcode = OC -> getValue ( ) ; if ( Opcode & ~ <NUM_LIT> ) { Error ( OpcodeLoc , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } Opcodes . push_back ( uint8_t ( Opcode ) ) ;

if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ;


<s> bool isVmovf = TyOp -> isToken ( ) && ( TyOp -> getToken ( ) == <STR_LIT> || TyOp -> getToken ( ) == <STR_LIT> ) ; <ISA_LIT>Operand * Mnemonic = static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) ; bool isFconst = Mnemonic -> isToken ( ) && ( Mnemonic -> getToken ( ) == <STR_LIT> || Mnemonic -> getToken ( ) == <STR_LIT> ) ; if ( ! ( isVmovf || isFconst ) ) return MatchOperand_NoMatch ; Parser . Lex ( ) ; bool isNegative = false ; if ( Parser . getTok ( ) . is ( AsmToken :: Minus ) ) { isNegative = true ; Parser . Lex ( ) ; } 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 ( ) ;


<s> Parser . Lex ( ) ; } else if ( Tok . is ( AsmToken :: Hash ) || Tok . is ( AsmToken :: Dollar ) || Tok . is ( AsmToken :: Integer ) ) { if ( Parser . getTok ( ) . isNot ( AsmToken :: Integer ) ) Parser . Lex ( ) ; SMLoc Loc = Parser . getTok ( ) . getLoc ( ) ; const MCExpr * ISBarrierID ; if ( getParser ( ) . parseExpression ( ISBarrierID ) ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( ISBarrierID ) ;


<s> parseInstSyncBarrierOptOperand ( SmallVectorImpl < MCParsedAsmOperand * > & Operands ) { SMLoc S = Parser . getTok ( ) . getLoc ( ) ; const AsmToken & Tok = Parser . getTok ( ) ; unsigned Opt ; if ( Tok . is ( AsmToken :: Identifier ) ) { StringRef OptStr = Tok . getString ( ) ; if ( OptStr . equals_lower ( <STR_LIT> ) ) Opt = <STR_LIT> ; else return MatchOperand_NoMatch ; Parser . Lex ( ) ; } else if ( Tok . is ( AsmToken :: Hash ) || Tok . is ( AsmToken :: Dollar ) || Tok . is ( AsmToken :: Integer ) ) { if ( Parser . getTok ( ) . isNot ( AsmToken :: Integer ) ) Parser . Lex ( ) ; SMLoc Loc = Parser . getTok ( ) . getLoc ( ) ; const MCExpr * ISBarrierID ; if ( getParser ( ) . parseExpression ( ISBarrierID ) ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( ISBarrierID ) ; if ( ! CE ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ; }


<s> const AsmToken & Tok = Parser . getTok ( ) ; if ( ! Tok . is ( AsmToken :: Identifier ) ) return MatchOperand_NoMatch ; unsigned CC = StringSwitch < unsigned > ( Tok . getString ( ) . lower ( ) ) . 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> ) return MatchOperand_NoMatch ; Parser . Lex ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateCondCode ( <STR_LIT> ( CC ) , S ) ) ; return MatchOperand_Success ;


<s> getParser ( ) . getStreamer ( ) . EmitValue ( Value , Size ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ; if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) { Error ( L , <STR_LIT> ) ; return false ; } Parser . Lex ( ) ;


<s> SMLoc S = Parser . getTok ( ) . getLoc ( ) ; const AsmToken & Tok = Parser . getTok ( ) ; unsigned Opt ; if ( Tok . is ( AsmToken :: Identifier ) ) { StringRef OptStr = Tok . getString ( ) ; Opt = StringSwitch < unsigned > ( OptStr . slice ( <NUM_LIT> , OptStr . size ( ) ) . lower ( ) ) . 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 ( ! hasV8Ops ( ) && ( Opt == <STR_LIT> || Opt == <STR_LIT> || Opt == <STR_LIT> || Opt == <STR_LIT> ) ) Opt = ~ <NUM_LIT> ; if ( Opt == ~ <NUM_LIT> ) return MatchOperand_NoMatch ; Parser . Lex ( ) ; } else if ( Tok . is ( AsmToken :: Hash ) || Tok . is ( AsmToken :: Dollar ) || Tok . is ( AsmToken :: Integer ) ) { if ( Parser . getTok ( ) . isNot ( AsmToken :: Integer ) ) Parser . Lex ( ) ; SMLoc Loc = Parser . getTok ( ) . getLoc ( ) ; const MCExpr * MemBarrierID ; if ( getParser ( ) . parseExpression ( MemBarrierID ) ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( MemBarrierID ) ; if ( ! CE ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } int Val = CE -> getValue ( ) ; if ( Val & ~ <NUM_LIT> ) {


<s> if ( Opt == ~ <NUM_LIT> ) return MatchOperand_NoMatch ; Parser . Lex ( ) ; } else if ( Tok . is ( AsmToken :: Hash ) || Tok . is ( AsmToken :: Dollar ) || Tok . is ( AsmToken :: Integer ) ) { if ( Parser . getTok ( ) . isNot ( AsmToken :: Integer ) ) Parser . Lex ( ) ; SMLoc Loc = Parser . getTok ( ) . getLoc ( ) ; const MCExpr * MemBarrierID ; if ( getParser ( ) . parseExpression ( MemBarrierID ) ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( MemBarrierID ) ; if ( ! CE ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } int Val = CE -> getValue ( ) ; if ( Val & ~ <NUM_LIT> ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ;


<s> if ( getParser ( ) . parseExpression ( Expr ) ) return true ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Expr ) ; if ( ! CE ) return Error ( Loc , <STR_LIT> ) ; int64_t Imm = CE -> getValue ( ) ; if ( Imm < <NUM_LIT> || ( ( St == <STR_LIT> || St == <STR_LIT> ) && Imm > <NUM_LIT> ) || ( ( St == <STR_LIT> || St == <STR_LIT> ) && Imm > <NUM_LIT> ) ) return Error ( Loc , <STR_LIT> ) ; if ( Imm == <NUM_LIT> ) St = <STR_LIT> ; if ( Imm == <NUM_LIT> ) Imm = <NUM_LIT> ; Amount = Imm ; } return false ;


<s> 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> ) . 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 ) ) ;


<s> OperandMatchResultTy parsePKHASRImm ( SmallVectorImpl < MCParsedAsmOperand * > & O ) {

return parsePKHImm ( O , <STR_LIT> , <NUM_LIT> , <NUM_LIT> ) ;


<s> if ( getParser ( ) . parseExpression ( ShiftAmount , EndLoc ) ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( ShiftAmount ) ; if ( ! CE ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } int Val = CE -> getValue ( ) ; if ( Val < Low || Val > High ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( CE , Loc , EndLoc ) ) ; return MatchOperand_Success ;


<s> isAdd = false ; haveEaten = true ; } SMLoc E = Parser . getTok ( ) . getEndLoc ( ) ; int Reg = tryParseRegister ( ) ; if ( Reg == - <NUM_LIT> ) { if ( ! haveEaten ) return MatchOperand_NoMatch ; Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } <STR_LIT> ShiftTy = <STR_LIT> ; unsigned ShiftImm = <NUM_LIT> ; if ( Parser . getTok ( ) . is ( AsmToken :: Comma ) ) { Parser . Lex ( ) ; if ( parseMemRegOffsetShift ( ShiftTy , ShiftImm ) ) return MatchOperand_ParseFail ; E = Parser . getTok ( ) . getLoc ( ) ; }

Operands . push_back ( <ISA_LIT>Operand :: CreatePostIdxReg ( Reg , isAdd , ShiftTy , ShiftImm , S , E ) ) ;


<s> unsigned ShiftImm = <NUM_LIT> ; if ( Parser . getTok ( ) . is ( AsmToken :: Comma ) ) { Parser . Lex ( ) ; if ( parseMemRegOffsetShift ( ShiftTy , ShiftImm ) ) return MatchOperand_ParseFail ; E = Parser . getTok ( ) . getLoc ( ) ; }


<s> Parser . Lex ( ) ; if ( getLexer ( ) . isNot ( AsmToken :: Identifier ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return true ; } StringRef IDVal = Parser . getTok ( ) . getIdentifier ( ) ; if ( IDVal == <STR_LIT> ) { RefKind = <ISA_LIT>MCExpr :: VK_<ISA_LIT>_LO16 ; } else if ( IDVal == <STR_LIT> ) { RefKind = <ISA_LIT>MCExpr :: VK_<ISA_LIT>_HI16 ; } else { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return true ; } Parser . Lex ( ) ; if ( getLexer ( ) . isNot ( AsmToken :: Colon ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return true ; } Parser . Lex ( ) ; return false ;


<s> if ( ! Tok . is ( AsmToken :: Identifier ) ) return MatchOperand_NoMatch ; StringRef IFlagsStr = Tok . getString ( ) ; unsigned IFlags = <NUM_LIT> ; if ( IFlagsStr != <STR_LIT> ) { for ( int i = <NUM_LIT> , e = IFlagsStr . size ( ) ; i != e ; ++ i ) { unsigned Flag = StringSwitch < unsigned > ( IFlagsStr . substr ( i , <NUM_LIT> ) ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( ~ <NUM_LIT> ) ; if ( Flag == ~ <NUM_LIT> || ( IFlags & Flag ) ) return MatchOperand_NoMatch ; IFlags |= Flag ;


<s> <ISA_LIT>AsmParser :: OperandMatchResultTy <ISA_LIT>AsmParser :: parseProcIFlagsOperand ( SmallVectorImpl < MCParsedAsmOperand * > & Operands ) { SMLoc S = Parser . getTok ( ) . getLoc ( ) ; const AsmToken & Tok = Parser . getTok ( ) ; if ( ! Tok . is ( AsmToken :: Identifier ) ) return MatchOperand_NoMatch ; StringRef IFlagsStr = Tok . getString ( ) ; unsigned IFlags = <NUM_LIT> ; if ( IFlagsStr != <STR_LIT> ) { for ( int i = <NUM_LIT> , e = IFlagsStr . size ( ) ; i != e ; ++ i ) { unsigned Flag = StringSwitch < unsigned > ( IFlagsStr . substr ( i , <NUM_LIT> ) ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( ~ <NUM_LIT> ) ;

if ( Flag == ~ <NUM_LIT> || ( IFlags & Flag ) ) return MatchOperand_NoMatch ;


<s> EndLoc = Parser . getTok ( ) . getEndLoc ( ) ; RegNo = tryParseRegister ( ) ;

return ( RegNo == ( unsigned ) - <NUM_LIT> ) ;


<s> 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 ( MRI -> getEncodingValue ( Reg ) < MRI -> getEncodingValue ( OldReg ) ) { if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Reg ) ) Warning ( RegLoc , <STR_LIT> ) ; else return Error ( RegLoc , <STR_LIT> ) ; } if ( MRI -> getEncodingValue ( Reg ) == MRI -> getEncodingValue ( 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> ) ; EReg = MRI -> getEncodingValue ( Reg ) ; Registers . push_back ( std :: pair < unsigned , unsigned > ( EReg , Reg ) ) ; if ( isQReg ) { EReg = MRI -> getEncodingValue ( ++ Reg ) ; Registers . push_back ( std :: pair < unsigned , unsigned > ( EReg , Reg ) ) ; } } if ( Parser . getTok ( ) . isNot ( AsmToken :: RCurly ) ) return Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; SMLoc E = Parser . getTok ( ) . getEndLoc ( ) ; Parser . Lex ( ) ;

Operands . push_back ( <ISA_LIT>Operand :: CreateRegList ( Registers , S , E ) ) ;


<s> if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Reg ) ) Warning ( RegLoc , <STR_LIT> ) ; else return Error ( RegLoc , <STR_LIT> ) ; } if ( MRI -> getEncodingValue ( Reg ) == MRI -> getEncodingValue ( 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> ) ; EReg = MRI -> getEncodingValue ( Reg ) ; Registers . push_back ( std :: pair < unsigned , unsigned > ( EReg , Reg ) ) ; if ( isQReg ) { EReg = MRI -> getEncodingValue ( ++ Reg ) ; Registers . push_back ( std :: pair < unsigned , unsigned > ( EReg , Reg ) ) ; } } if ( Parser . getTok ( ) . isNot ( AsmToken :: RCurly ) ) return Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; SMLoc E = Parser . getTok ( ) . getEndLoc ( ) ; Parser . Lex ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateRegList ( Registers , S , E ) ) ; if ( Parser . getTok ( ) . is ( AsmToken :: Caret ) ) { Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( <STR_LIT> , Parser . getTok ( ) . getLoc ( ) ) ) ; Parser . Lex ( ) ;


<s> int Val = StringSwitch < int > ( Tok . getString ( ) . lower ( ) ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Default ( - <NUM_LIT> ) ; Parser . Lex ( ) ; if ( Val == - <NUM_LIT> ) { Error ( S , <STR_LIT> ) ; return MatchOperand_ParseFail ; } Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( MCConstantExpr :: Create ( Val , getContext ( ) ) , S , Tok . getEndLoc ( ) ) ) ; return MatchOperand_Success ;


<s> Index = <NUM_LIT> ; if ( Parser . getTok ( ) . is ( AsmToken :: LBrac ) ) { Parser . Lex ( ) ; if ( Parser . getTok ( ) . is ( AsmToken :: RBrac ) ) { LaneKind = AllLanes ; EndLoc = Parser . getTok ( ) . getEndLoc ( ) ; Parser . Lex ( ) ; return MatchOperand_Success ; } if ( Parser . getTok ( ) . is ( AsmToken :: Hash ) ) Parser . Lex ( ) ; 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 ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } if ( Parser . getTok ( ) . isNot ( AsmToken :: RBrac ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } EndLoc = Parser . getTok ( ) . getEndLoc ( ) ; Parser . Lex ( ) ;


<s> return MatchOperand_ParseFail ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( LaneIndex ) ; if ( ! CE ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } if ( Parser . getTok ( ) . isNot ( AsmToken :: RBrac ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } EndLoc = Parser . getTok ( ) . getEndLoc ( ) ; Parser . Lex ( ) ; int64_t Val = CE -> getValue ( ) ; if ( Val < <NUM_LIT> || Val > <NUM_LIT> ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } Index = Val ; LaneKind = IndexedLane ;


<s> return MatchOperand_ParseFail ; } if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Reg ) ) { if ( ! Spacing ) Spacing = <NUM_LIT> ; else if ( Spacing == <NUM_LIT> ) { Error ( RegLoc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } Reg = getDRegFromQReg ( Reg ) ; if ( Reg != OldReg + <NUM_LIT> ) { Error ( RegLoc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } ++ Reg ; Count += <NUM_LIT> ; VectorLaneTy NextLaneKind ; unsigned NextLaneIndex ; SMLoc LaneLoc = Parser . getTok ( ) . getLoc ( ) ; if ( parseVectorLane ( NextLaneKind , NextLaneIndex , E ) != MatchOperand_Success ) return MatchOperand_ParseFail ; if ( NextLaneKind != LaneKind || LaneIndex != NextLaneIndex ) { Error ( LaneLoc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } continue ; } if ( ! Spacing ) Spacing = <NUM_LIT> + ( Reg == OldReg + <NUM_LIT> ) ; if ( Reg != OldReg + Spacing ) { Error ( RegLoc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } ++ Count ; VectorLaneTy NextLaneKind ; unsigned NextLaneIndex ; SMLoc EndLoc = Parser . getTok ( ) . getLoc ( ) ; if ( parseVectorLane ( NextLaneKind , NextLaneIndex , E ) != MatchOperand_Success ) return MatchOperand_ParseFail ; if ( NextLaneKind != LaneKind || LaneIndex != NextLaneIndex ) { Error ( EndLoc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } } if ( Parser . getTok ( ) . isNot ( AsmToken :: RCurly ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } E = Parser . getTok ( ) . getEndLoc ( ) ; Parser . Lex ( ) ; switch ( LaneKind ) { case NoLanes : if ( Count == <NUM_LIT> ) { const MCRegisterClass * RC = ( Spacing == <NUM_LIT> ) ? & <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] : & <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] ; FirstReg = MRI -> getMatchingSuperReg ( FirstReg , <STR_LIT> , RC ) ; } Operands . push_back ( <ISA_LIT>Operand :: CreateVectorList ( FirstReg , Count , ( Spacing == <NUM_LIT> ) , S , E ) ) ; break ; case AllLanes : if ( Count == <NUM_LIT> ) { const MCRegisterClass * RC = ( Spacing == <NUM_LIT> ) ? & <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] : & <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] ; FirstReg = MRI -> getMatchingSuperReg ( FirstReg , <STR_LIT> , RC ) ; } Operands . push_back ( <ISA_LIT>Operand :: CreateVectorListAllLanes ( FirstReg , Count , ( Spacing == <NUM_LIT> ) , S , E ) ) ; break ; case IndexedLane : Operands . push_back ( <ISA_LIT>Operand :: CreateVectorListIndexed ( FirstReg , Count , LaneIndex , ( Spacing == <NUM_LIT> ) , S , E ) ) ; break ; } return MatchOperand_Success ;


<s> void recordFnStart ( SMLoc L ) { FnStartLocs . push_back ( L ) ;


<s> void recordPersonality ( SMLoc L ) { PersonalityLocs . push_back ( L ) ;


<s> PersonalityIndexLocs . push_back ( L ) ;


<s> if ( Inst . startswith ( <STR_LIT> ) || Inst . startswith ( <STR_LIT> ) ) { StringRef AddressingMode = Inst . substr ( <NUM_LIT> , <NUM_LIT> ) ;

if ( AddressingMode == <STR_LIT> || AddressingMode == <STR_LIT> || AddressingMode == <STR_LIT> || AddressingMode == <STR_LIT> ) {


<s> PersonalityLocs = Locs ( ) ; HandlerDataLocs = Locs ( ) ;


<s> if ( Mnemonic == <STR_LIT> && Operands . size ( ) > <NUM_LIT> && ! isThumb ( ) && ! static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> is<ISA_LIT>SOImm ( ) && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> isImm0_65535Expr ( ) && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> getReg ( ) == <NUM_LIT> ) return true ; if ( isThumb ( ) && Mnemonic == <STR_LIT> && Operands . size ( ) == <NUM_LIT> && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> isReg ( ) && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> isReg ( ) && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> getReg ( ) == <NUM_LIT> ) return true ; if ( ( ( isThumb ( ) && Mnemonic == <STR_LIT> ) || ( isThumbTwo ( ) && Mnemonic == <STR_LIT> ) ) && Operands . size ( ) == <NUM_LIT> && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> isReg ( ) && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> isReg ( ) && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> getReg ( ) == <STR_LIT> && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> getReg ( ) == <NUM_LIT> && ( ( Mnemonic == <STR_LIT> && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> isReg ( ) ) || static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> isImm0_1020s4 ( ) ) ) return true ; if ( isThumbTwo ( ) && ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) && Operands . size ( ) == <NUM_LIT> && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> isReg ( ) && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> isReg ( ) && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> isImm ( ) ) { if ( inITBlock ( ) && is<ISA_LIT>LowRegister ( static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> getReg ( ) ) && is<ISA_LIT>LowRegister ( static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> getReg ( ) ) && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> isImm0_7 ( ) ) return false ;

if ( static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> getReg ( ) != <STR_LIT> && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> isT2SOImm ( ) ) return false ;


<s> if ( ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> getToken ( ) == <STR_LIT> ) { if ( static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> isToken ( ) && static_cast < <ISA_LIT>Operand * > ( Operands [ <NUM_LIT> ] ) -> getToken ( ) == <STR_LIT> ) RegIdx = <NUM_LIT> ;

if ( static_cast < <ISA_LIT>Operand * > ( Operands [ RegIdx ] ) -> isReg ( ) && ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( static_cast < <ISA_LIT>Operand * > ( Operands [ RegIdx ] ) -> getReg ( ) ) || <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( static_cast < <ISA_LIT>Operand * > ( Operands [ RegIdx ] ) -> getReg ( ) ) ) ) return true ;


<s> void SwitchMode ( ) { unsigned FB = ComputeAvailableFeatures ( STI . ToggleFeature ( <STR_LIT> ) ) ;


<s> if ( Tok . isNot ( AsmToken :: Identifier ) ) return - <NUM_LIT> ; std :: string lowerCase = Tok . getString ( ) . lower ( ) ; unsigned RegNum = MatchRegisterName ( lowerCase ) ; if ( ! RegNum ) { RegNum = StringSwitch < unsigned > ( 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> ) . 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 ( ! RegNum ) { StringMap < unsigned > :: const_iterator Entry = RegisterReqs . find ( lowerCase ) ; if ( Entry == RegisterReqs . end ( ) ) return - <NUM_LIT> ; Parser . Lex ( ) ; return Entry -> getValue ( ) ; }


<s> if ( ! RegNum ) { RegNum = StringSwitch < unsigned > ( 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> ) . 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 ( ! RegNum ) { StringMap < unsigned > :: const_iterator Entry = RegisterReqs . find ( lowerCase ) ; if ( Entry == RegisterReqs . end ( ) ) return - <NUM_LIT> ; Parser . Lex ( ) ; return Entry -> getValue ( ) ; } Parser . Lex ( ) ;


<s> const AsmToken & RegTok = Parser . getTok ( ) ; int RegNo = tryParseRegister ( ) ; if ( RegNo == - <NUM_LIT> ) return true ; Operands . push_back ( <ISA_LIT>Operand :: CreateReg ( RegNo , RegTok . getLoc ( ) , RegTok . getEndLoc ( ) ) ) ; const AsmToken & ExclaimTok = Parser . getTok ( ) ; if ( ExclaimTok . is ( AsmToken :: Exclaim ) ) { Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( ExclaimTok . getString ( ) , ExclaimTok . getLoc ( ) ) ) ; Parser . Lex ( ) ; return false ; } if ( Parser . getTok ( ) . is ( AsmToken :: LBrac ) ) { SMLoc SIdx = Parser . getTok ( ) . getLoc ( ) ; Parser . Lex ( ) ; 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 ( ) ) ) ;


<s> if ( ShiftTy == <STR_LIT> ) return <NUM_LIT> ; Parser . Lex ( ) ; OwningPtr < <ISA_LIT>Operand > PrevOp ( ( <ISA_LIT>Operand * ) Operands . pop_back_val ( ) ) ; 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 = <NUM_LIT> ; 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> ;


<s> UnwindContext ( MCAsmParser & P ) : Parser ( P ) , FPReg ( <STR_LIT> ) {


<s> int64_t Value ; if ( ! SOExpr -> EvaluateAsAbsolute ( Value ) ) return Match_Success ; assert ( ( Value >= INT32_MIN && Value <= INT32_MAX ) && <STR_LIT> ) ; } break ; case MCK_GPRPair :

if ( Op -> isReg ( ) && MRI -> getRegClass ( <STR_LIT> ) . contains ( Op -> getReg ( ) ) ) return Match_Success ;


<s> if ( ! SOExpr -> EvaluateAsAbsolute ( Value ) ) return Match_Success ; assert ( ( Value >= INT32_MIN && Value <= INT32_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 Warning ( SMLoc L , const Twine & Msg , ArrayRef < SMRange > Ranges = None ) {

return Parser . Warning ( L , Msg , Ranges ) ;


<s> return Parser . Warning ( L , Msg , Ranges ) ;


<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> ) { 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> && 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 ; }


<s> if ( ( Mnemonic == <STR_LIT> && isThumb ( ) ) || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) return Mnemonic ; 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> ) { 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> && isThumb ( ) ) ) ) {


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

Inst . addOperand ( MCOperand :: CreateImm ( unsigned ( getBankedReg ( ) ) ) ) ;


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


<s> if ( ! Expr ) Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ;

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


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


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


<s> uint32_t Enc = <STR_LIT> ( - CE -> getValue ( ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( Enc ) ) ;


<s> void addModImmNotOperands ( MCInst & Inst , unsigned N ) const {

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


<s> void addModImmOperands ( MCInst & Inst , unsigned N ) const {


<s> void addNEONi16splatNotOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ;


<s> void addNEONi16splatOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ;


<s> unsigned Value = CE -> getValue ( ) ; Value = <STR_LIT> ( Value ) ;

Inst . addOperand ( MCOperand :: CreateImm ( Value ) ) ;


<s> Value = <STR_LIT> ( ~ Value ) ; Inst . addOperand ( MCOperand :: CreateImm ( Value ) ) ;


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


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; unsigned Value = CE -> getValue ( ) ; Value = <STR_LIT> ( Value ) ; Inst . addOperand ( MCOperand :: CreateImm ( Value ) ) ;


<s> assert ( ( Inst . getOpcode ( ) == <STR_LIT> || Inst . getOpcode ( ) == <STR_LIT> ) && <STR_LIT> <STR_LIT> ) ; unsigned B = ( ( ~ Value ) & <NUM_LIT> ) ; B |= <NUM_LIT> ; Inst . addOperand ( MCOperand :: CreateImm ( B ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; unsigned Value = CE -> getValue ( ) ; assert ( ( Inst . getOpcode ( ) == <STR_LIT> || Inst . getOpcode ( ) == <STR_LIT> ) && <STR_LIT> <STR_LIT> ) ; unsigned B = Value & <NUM_LIT> ; B |= <NUM_LIT> ;

Inst . addOperand ( MCOperand :: CreateImm ( B ) ) ;


<s> <ISA_LIT>AsmParser ( MCSubtargetInfo & STI , MCAsmParser & Parser , const MCInstrInfo & MII , const MCTargetOptions & Options ) : STI ( STI ) , MII ( MII ) , UC ( Parser ) { MCAsmParserExtension :: Initialize ( Parser ) ; MRI = getContext ( ) . getRegisterInfo ( ) ; setAvailableFeatures ( ComputeAvailableFeatures ( STI . getFeatureBits ( ) ) ) ;


<s> case k_CCOut : case k_Register : Reg = o . Reg ; break ; case k_RegisterList : case k_DPRRegisterList : case k_SPRRegisterList : Registers = o . Registers ; break ; case k_VectorList : case k_VectorListAllLanes : case k_VectorListIndexed : VectorList = o . VectorList ; break ; case k_CoprocNum : case k_CoprocReg : Cop = o . Cop ; break ; case k_CoprocOption : CoprocOption = o . CoprocOption ; break ; case k_Immediate : Imm = o . Imm ; break ; case k_MemBarrierOpt : MBOpt = o . MBOpt ; break ; case k_InstSyncBarrierOpt : ISBOpt = o . ISBOpt ; case k_Memory : Memory = o . Memory ; break ; case k_PostIndexRegister : PostIdxReg = o . PostIdxReg ; break ; case k_MSRMask : MMask = o . MMask ; break ; case k_BankedReg : BankedReg = o . BankedReg ; break ; case k_ProcIFlags : IFlags = o . IFlags ; break ; case k_ShifterImmediate : ShifterImm = o . ShifterImm ; break ; case k_ShiftedRegister :


<s> case k_Memory : Memory = o . Memory ; break ; case k_PostIndexRegister : PostIdxReg = o . PostIdxReg ; break ; case k_MSRMask : MMask = o . MMask ; break ; case k_BankedReg : BankedReg = o . BankedReg ; break ; case k_ProcIFlags : IFlags = o . IFlags ; break ; case k_ShifterImmediate : ShifterImm = o . ShifterImm ; break ; case k_ShiftedRegister : RegShiftedReg = o . RegShiftedReg ; break ; case k_ShiftedImmediate : RegShiftedImm = o . RegShiftedImm ; break ; case k_RotateImmediate : RotImm = o . RotImm ; break ; case k_ModifiedImmediate : ModImm = o . ModImm ; break ; case k_BitfieldDescriptor : Bitfield = o . Bitfield ;


<s> const MCInstrDesc & MCID = MII . get ( Opc ) ; if ( MCID . TSFlags & <STR_LIT> ) { assert ( MCID . hasOptionalDef ( ) && <STR_LIT> ) ; assert ( MCID . NumOperands == Inst . getNumOperands ( ) && <STR_LIT> ) ; unsigned OpNo ; for ( OpNo = <NUM_LIT> ; ! MCID . OpInfo [ OpNo ] . isOptionalDef ( ) && OpNo < MCID . NumOperands ; ++ OpNo ) ; if ( isThumbOne ( ) && Inst . getOperand ( OpNo ) . getReg ( ) != <STR_LIT> ) return Match_MnemonicFail ; if ( isThumbTwo ( ) && Inst . getOperand ( OpNo ) . getReg ( ) != <STR_LIT> && ! inITBlock ( ) ) return Match_RequiresITBlock ;

if ( isThumbTwo ( ) && Inst . getOperand ( OpNo ) . getReg ( ) == <STR_LIT> && inITBlock ( ) ) return Match_RequiresNotITBlock ;


<s> unsigned <ISA_LIT>AsmParser :: checkTargetMatchPredicate ( MCInst & Inst ) { unsigned Opc = Inst . getOpcode ( ) ; const MCInstrDesc & MCID = MII . get ( Opc ) ; if ( MCID . TSFlags & <STR_LIT> ) { assert ( MCID . hasOptionalDef ( ) && <STR_LIT> ) ; assert ( MCID . NumOperands == Inst . getNumOperands ( ) && <STR_LIT> ) ; unsigned OpNo ; for ( OpNo = <NUM_LIT> ; ! MCID . OpInfo [ OpNo ] . isOptionalDef ( ) && OpNo < MCID . NumOperands ; ++ OpNo ) ; if ( isThumbOne ( ) && Inst . getOperand ( OpNo ) . getReg ( ) != <STR_LIT> ) return Match_MnemonicFail ; if ( isThumbTwo ( ) && Inst . getOperand ( OpNo ) . getReg ( ) != <STR_LIT> && ! inITBlock ( ) ) return Match_RequiresITBlock ; if ( isThumbTwo ( ) && Inst . getOperand ( OpNo ) . getReg ( ) == <STR_LIT> && inITBlock ( ) ) return Match_RequiresNotITBlock ; } else if ( Opc == <STR_LIT> && isThumbOne ( ) && ! hasV6MOps ( ) && is<ISA_LIT>LowRegister ( Inst . getOperand ( <NUM_LIT> ) . getReg ( ) ) && is<ISA_LIT>LowRegister ( Inst . getOperand ( <NUM_LIT> ) . getReg ( ) ) ) return Match_RequiresThumb2 ; else if ( Opc == <STR_LIT> && isThumbOne ( ) && ! hasV6Ops ( ) && is<ISA_LIT>LowRegister ( Inst . getOperand ( <NUM_LIT> ) . getReg ( ) ) && is<ISA_LIT>LowRegister ( Inst . getOperand ( <NUM_LIT> ) . getReg ( ) ) ) return Match_RequiresV6 ; return Match_Success ;


<s> bool hasD16 ( ) const { return STI . getFeatureBits ( ) & <STR_LIT> ;


<s> return STI . getFeatureBits ( ) & <STR_LIT> ;


<s> if ( isImm ( ) && ! isa < MCConstantExpr > ( getImm ( ) ) ) return true ;


<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> || <STR_LIT> ( - Value ) != - <NUM_LIT> ) ; ;


<s> switch ( MatchResult ) { case Match_Success : if ( validateInstruction ( Inst , Operands ) ) { forwardITPosition ( ) ; return true ; } { bool wasInITBlock = inITBlock ( ) ; while ( processInstruction ( Inst , Operands , Out ) ) ; if ( wasInITBlock && hasV8Ops ( ) && isThumb ( ) && ! isV8EligibleForIT ( & Inst ) ) { Warning ( IDLoc , <STR_LIT> ) ; } } forwardITPosition ( ) ; if ( Inst . getOpcode ( ) == <STR_LIT> ) return false ; Inst . setLoc ( IDLoc ) ; Out . EmitInstruction ( Inst , STI ) ; return false ; case Match_MissingFeature : { assert ( ErrorInfo && <STR_LIT> ) ; std :: string Msg = <STR_LIT> ; uint64_t Mask = <NUM_LIT> ; for ( unsigned i = <NUM_LIT> ; i < ( sizeof ( ErrorInfo ) * <NUM_LIT> - <NUM_LIT> ) ; ++ i ) { if ( ErrorInfo & Mask ) { Msg += <STR_LIT> ; Msg += getSubtargetFeatureName ( ErrorInfo & Mask ) ; } Mask <<= <NUM_LIT> ; } return Error ( IDLoc , Msg ) ; } 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 : return Error ( IDLoc , <STR_LIT> , ( ( <ISA_LIT>Operand & ) * Operands [ <NUM_LIT> ] ) . getLocRange ( ) ) ; case Match_RequiresNotITBlock : return Error ( IDLoc , <STR_LIT> ) ; case Match_RequiresITBlock : return Error ( IDLoc , <STR_LIT> ) ; case Match_RequiresV6 : return Error ( IDLoc , <STR_LIT> ) ; case Match_RequiresThumb2 : return Error ( IDLoc , <STR_LIT> ) ; case Match_ImmRange0_15 : { SMLoc ErrorLoc = ( ( <ISA_LIT>Operand & ) * Operands [ ErrorInfo ] ) . getStartLoc ( ) ; if ( ErrorLoc == SMLoc ( ) ) ErrorLoc = IDLoc ; return Error ( ErrorLoc , <STR_LIT> ) ;


<s> } } forwardITPosition ( ) ; if ( Inst . getOpcode ( ) == <STR_LIT> ) return false ; Inst . setLoc ( IDLoc ) ; Out . EmitInstruction ( Inst , STI ) ; return false ; case Match_MissingFeature : { assert ( ErrorInfo && <STR_LIT> ) ; std :: string Msg = <STR_LIT> ; uint64_t Mask = <NUM_LIT> ; for ( unsigned i = <NUM_LIT> ; i < ( sizeof ( ErrorInfo ) * <NUM_LIT> - <NUM_LIT> ) ; ++ i ) { if ( ErrorInfo & Mask ) { Msg += <STR_LIT> ; Msg += getSubtargetFeatureName ( ErrorInfo & Mask ) ; } Mask <<= <NUM_LIT> ; } return Error ( IDLoc , Msg ) ; } 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 : return Error ( IDLoc , <STR_LIT> , ( ( <ISA_LIT>Operand & ) * Operands [ <NUM_LIT> ] ) . getLocRange ( ) ) ; case Match_RequiresNotITBlock : return Error ( IDLoc , <STR_LIT> ) ; case Match_RequiresITBlock : return Error ( IDLoc , <STR_LIT> ) ; case Match_RequiresV6 : return Error ( IDLoc , <STR_LIT> ) ; case Match_RequiresThumb2 : return Error ( IDLoc , <STR_LIT> ) ; case Match_ImmRange0_15 : { SMLoc ErrorLoc = ( ( <ISA_LIT>Operand & ) * Operands [ ErrorInfo ] ) . getStartLoc ( ) ; if ( ErrorLoc == SMLoc ( ) ) ErrorLoc = IDLoc ; return Error ( ErrorLoc , <STR_LIT> ) ; } case Match_ImmRange0_239 : { SMLoc ErrorLoc = ( ( <ISA_LIT>Operand & ) * Operands [ ErrorInfo ] ) . getStartLoc ( ) ; if ( ErrorLoc == SMLoc ( ) ) ErrorLoc = IDLoc ; return Error ( ErrorLoc , <STR_LIT> ) ; } case Match_AlignedMemoryRequiresNone : case Match_DupAlignedMemoryRequiresNone : case Match_AlignedMemoryRequires16 : case Match_DupAlignedMemoryRequires16 : case Match_AlignedMemoryRequires32 : case Match_DupAlignedMemoryRequires32 : case Match_AlignedMemoryRequires64 : case Match_DupAlignedMemoryRequires64 : case Match_AlignedMemoryRequires64or128 : case Match_DupAlignedMemoryRequires64or128 : case Match_AlignedMemoryRequires64or128or256 : { SMLoc ErrorLoc = ( ( <ISA_LIT>Operand & ) * Operands [ ErrorInfo ] ) . getAlignmentLoc ( ) ; if ( ErrorLoc == SMLoc ( ) ) ErrorLoc = IDLoc ; switch ( MatchResult ) { default : llvm_unreachable ( <STR_LIT> ) ; case Match_AlignedMemoryRequiresNone : case Match_DupAlignedMemoryRequiresNone : return Error ( ErrorLoc , <STR_LIT> ) ; case Match_AlignedMemoryRequires16 : case Match_DupAlignedMemoryRequires16 : return Error ( ErrorLoc , <STR_LIT> ) ;


<s> haveEaten = true ; } else if ( Tok . is ( AsmToken :: Minus ) ) { Parser . Lex ( ) ; isAdd = false ; haveEaten = true ; } Tok = Parser . getTok ( ) ; int Reg = tryParseRegister ( ) ; if ( Reg == - <NUM_LIT> ) { if ( ! haveEaten ) return MatchOperand_NoMatch ; Error ( Tok . getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } Operands . push_back ( <ISA_LIT>Operand :: CreatePostIdxReg ( Reg , isAdd , <STR_LIT> , <NUM_LIT> , S , Tok . getEndLoc ( ) ) ) ; return MatchOperand_Success ;


<s> bool isNegative = Parser . getTok ( ) . is ( AsmToken :: Minus ) ; const MCExpr * Offset ; SMLoc E ; if ( getParser ( ) . parseExpression ( Offset , E ) ) return MatchOperand_ParseFail ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Offset ) ; if ( ! CE ) { Error ( S , <STR_LIT> ) ; return MatchOperand_ParseFail ; } int32_t Val = CE -> getValue ( ) ; if ( isNegative && Val == <NUM_LIT> ) Val = INT32_MIN ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( MCConstantExpr :: Create ( Val , getContext ( ) ) , S , E ) ) ; return MatchOperand_Success ; } bool haveEaten = false ; bool isAdd = true ; if ( Tok . is ( AsmToken :: Plus ) ) { Parser . Lex ( ) ; haveEaten = true ; } else if ( Tok . is ( AsmToken :: Minus ) ) { Parser . Lex ( ) ; isAdd = false ; haveEaten = true ; } Tok = Parser . getTok ( ) ; int Reg = tryParseRegister ( ) ; if ( Reg == - <NUM_LIT> ) { if ( ! haveEaten ) return MatchOperand_NoMatch ; Error ( Tok . getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ;


<s> StringRef Name = Parser . getTok ( ) . getString ( ) ; SMLoc ExtLoc = Parser . getTok ( ) . getLoc ( ) ; getLexer ( ) . Lex ( ) ; bool EnableFeature = true ; if ( Name . startswith_lower ( <STR_LIT> ) ) { EnableFeature = false ; Name = Name . substr ( <NUM_LIT> ) ; } for ( const auto & Extension : Extensions ) { if ( Extension . Name != Name ) continue ; if ( ! Extension . Features ) report_fatal_error ( <STR_LIT> + Name ) ; if ( ( getAvailableFeatures ( ) & Extension . ArchCheck ) != Extension . ArchCheck ) { Error ( ExtLoc , <STR_LIT> + Name + <STR_LIT> <STR_LIT> ) ;


<s> if ( ! STI . isCPUStringValid ( CPU ) ) { Error ( L , <STR_LIT> ) ; return false ; } STI . InitMCProcessorInfo ( CPU , <STR_LIT> ) ; STI . InitCPUSchedModel ( CPU ) ;

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


<s> SMLoc FPUNameLoc = getTok ( ) . getLoc ( ) ; StringRef FPU = getParser ( ) . parseStringToEndOfStatement ( ) . trim ( ) ; unsigned ID = StringSwitch < unsigned > ( FPU ) . Default ( <STR_LIT> ) ; if ( ID == <STR_LIT> ) {


<s> SMLoc FPUNameLoc = getTok ( ) . getLoc ( ) ; StringRef FPU = getParser ( ) . parseStringToEndOfStatement ( ) . trim ( ) ; unsigned ID = StringSwitch < unsigned > ( FPU ) . Default ( <STR_LIT> ) ; if ( ID == <STR_LIT> ) { Error ( FPUNameLoc , <STR_LIT> ) ; return false ; } for ( const auto & Entry : FPUs ) { if ( Entry . ID != ID ) continue ;

uint64_t Toggle = ( Entry . Enabled & ~ STI . getFeatureBits ( ) ) | ( Entry . Disabled & STI . getFeatureBits ( ) ) ;


<s> MCAsmParser & Parser = getParser ( ) ; if ( getLexer ( ) . isNot ( AsmToken :: Identifier ) ) { Error ( getLexer ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } StringRef Arch = Parser . getTok ( ) . getString ( ) ; SMLoc ArchLoc = Parser . getTok ( ) . getLoc ( ) ; getLexer ( ) . Lex ( ) ; unsigned ID = StringSwitch < unsigned > ( Arch ) . Case ( NAME , <STR_LIT> ) . Case ( NAME , <STR_LIT> ) . Default ( <STR_LIT> ) ; if ( ID == <STR_LIT> ) {

Error ( ArchLoc , <STR_LIT> + Arch + <STR_LIT> ) ;


<s> } StringRef Arch = Parser . getTok ( ) . getString ( ) ; SMLoc ArchLoc = Parser . getTok ( ) . getLoc ( ) ; getLexer ( ) . Lex ( ) ;

unsigned ID = StringSwitch < unsigned > ( Arch ) . Case ( NAME , <STR_LIT> ) . Case ( NAME , <STR_LIT> ) . Default ( <STR_LIT> ) ;


<s> } if ( UC . hasHandlerData ( ) ) { Error ( L , <STR_LIT> ) ; UC . emitHandlerDataLocNotes ( ) ; return false ; } if ( HasExistingPersonality ) { Parser . eatToEndOfStatement ( ) ; Error ( L , <STR_LIT> ) ; UC . emitPersonalityLocNotes ( ) ; return false ; } if ( Parser . getTok ( ) . isNot ( AsmToken :: Identifier ) ) { Parser . eatToEndOfStatement ( ) ;


<s> MCAsmParser & Parser = getParser ( ) ; 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 ) ) {


<s> return false ; } MCSymbol * Func = getParser ( ) . getContext ( ) . GetOrCreateSymbol ( Tok . getIdentifier ( ) ) ; getParser ( ) . getStreamer ( ) . EmitThumbFunc ( Func ) ; Parser . Lex ( ) ; return false ; } }

if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) {


<s> Lex ( ) ; const MCExpr * Value ; if ( Parser . parseExpression ( Value ) ) { TokError ( <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { TokError ( <STR_LIT> ) ;


<s> if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { TokError ( <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } Lex ( ) ; MCSymbol * Alias = getContext ( ) . GetOrCreateSymbol ( Name ) ;

getTargetStreamer ( ) . emitThumbSet ( Alias , Value ) ;


<s> } const MCSymbolRefExpr * SRE = MCSymbolRefExpr :: Create ( Parser . getTok ( ) . getIdentifier ( ) , MCSymbolRefExpr :: VK_<ISA_LIT>_TLSDESCSEQ , getContext ( ) ) ; Lex ( ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ;


<s> Parser . eatToEndOfStatement ( ) ; return false ; } const MCSymbolRefExpr * SRE = MCSymbolRefExpr :: Create ( Parser . getTok ( ) . getIdentifier ( ) , MCSymbolRefExpr :: VK_<ISA_LIT>_TLSDESCSEQ , getContext ( ) ) ;


<s> isNegative = true ; Parser . Lex ( ) ; } 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> if ( getParser ( ) . parseExpression ( Value ) ) { Parser . eatToEndOfStatement ( ) ; return false ; } getParser ( ) . getStreamer ( ) . EmitValue ( Value , Size ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ;

if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) {


<s> if ( ! Tok . is ( AsmToken :: Colon ) && ! Tok . is ( AsmToken :: Comma ) && ! Tok . is ( AsmToken :: RBrac ) ) return Error ( Tok . getLoc ( ) , <STR_LIT> ) ; if ( Tok . is ( AsmToken :: RBrac ) ) { E = Tok . getEndLoc ( ) ; Parser . Lex ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateMem ( BaseRegNum , nullptr , <NUM_LIT> , <STR_LIT> , <NUM_LIT> , <NUM_LIT> , false , S , E ) ) ; if ( Parser . getTok ( ) . is ( AsmToken :: Exclaim ) ) { Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( <STR_LIT> , Parser . getTok ( ) . getLoc ( ) ) ) ; Parser . Lex ( ) ; } return false ; } assert ( ( Tok . is ( AsmToken :: Colon ) || Tok . is ( AsmToken :: Comma ) ) && <STR_LIT> ) ; if ( Tok . is ( AsmToken :: Comma ) ) { Parser . Lex ( ) ; } if ( Parser . getTok ( ) . is ( AsmToken :: Colon ) ) { Parser . Lex ( ) ; E = Parser . getTok ( ) . getLoc ( ) ; SMLoc AlignmentLoc = Tok . getLoc ( ) ; const MCExpr * Expr ; if ( getParser ( ) . parseExpression ( Expr ) ) return true ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Expr ) ; if ( ! CE ) return Error ( E , <STR_LIT> ) ; unsigned Align = <NUM_LIT> ; switch ( CE -> getValue ( ) ) { default : return Error ( E , <STR_LIT> ) ; case <NUM_LIT> : Align = <NUM_LIT> ; break ; case <NUM_LIT> : Align = <NUM_LIT> ; break ; case <NUM_LIT> : Align = <NUM_LIT> ; break ; case <NUM_LIT> : Align = <NUM_LIT> ; break ; case <NUM_LIT> : Align = <NUM_LIT> ; break ; } if ( Parser . getTok ( ) . isNot ( AsmToken :: RBrac ) ) return Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; E = Parser . getTok ( ) . getEndLoc ( ) ; Parser . Lex ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateMem ( BaseRegNum , nullptr , <NUM_LIT> , <STR_LIT> , <NUM_LIT> , Align , false , S , E , AlignmentLoc ) ) ; if ( Parser . getTok ( ) . is ( AsmToken :: Exclaim ) ) { Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( <STR_LIT> , Parser . getTok ( ) . getLoc ( ) ) ) ; Parser . Lex ( ) ; }


<s> SMLoc S = Parser . getTok ( ) . getLoc ( ) ; const AsmToken & Tok = Parser . getTok ( ) ; if ( ! Tok . is ( AsmToken :: Identifier ) ) return MatchOperand_NoMatch ; 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> ) . 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 ( ! hasThumb2DSP ( ) && ( 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 ) ) ;


<s> case AsmToken :: LCurly : return parseRegisterList ( Operands ) ; case AsmToken :: Dollar : case AsmToken :: Hash : { S = Parser . getTok ( ) . getLoc ( ) ; 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 ( 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 ( ) ) ) ;


<s> 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 ( ) ; 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 ( 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 : { <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 ) ) ;


<s> MCAsmParser & Parser = getParser ( ) ; const AsmToken & Tok = Parser . getTok ( ) ; SMLoc S = Tok . getLoc ( ) ; if ( Tok . isNot ( AsmToken :: Identifier ) ) { Error ( S , <STR_LIT> ) ; return MatchOperand_ParseFail ; } int Val = StringSwitch < int > ( Tok . getString ( ) . lower ( ) ) . Case ( <STR_LIT> , <NUM_LIT> ) . Case ( <STR_LIT> , <NUM_LIT> ) . Default ( - <NUM_LIT> ) ; Parser . Lex ( ) ; if ( Val == - <NUM_LIT> ) { Error ( S , <STR_LIT> ) ; return MatchOperand_ParseFail ; }

Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( MCConstantExpr :: Create ( Val , getContext ( ) ) , S , Tok . getEndLoc ( ) ) ) ;


<s> 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 ) ; 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_ModifiedImmediate : OS << <STR_LIT> << ModImm . Bits << <STR_LIT> << ModImm . Rot << <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> ;


<s> unsigned RegIdx = <NUM_LIT> ; if ( ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) && static_cast < <ISA_LIT>Operand & > ( * Operands [ <NUM_LIT> ] ) . getToken ( ) == <STR_LIT> ) { if ( static_cast < <ISA_LIT>Operand & > ( * Operands [ <NUM_LIT> ] ) . isToken ( ) && static_cast < <ISA_LIT>Operand & > ( * Operands [ <NUM_LIT> ] ) . getToken ( ) == <STR_LIT> ) RegIdx = <NUM_LIT> ; if ( static_cast < <ISA_LIT>Operand & > ( * Operands [ RegIdx ] ) . isReg ( ) && ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( static_cast < <ISA_LIT>Operand & > ( * Operands [ RegIdx ] ) . getReg ( ) ) || <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( static_cast < <ISA_LIT>Operand & > ( * Operands [ RegIdx ] ) . getReg ( ) ) ) ) return true ; } return false ;


<s> unsigned RegIdx = <NUM_LIT> ; if ( ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) && static_cast < <ISA_LIT>Operand & > ( * Operands [ <NUM_LIT> ] ) . getToken ( ) == <STR_LIT> ) { if ( static_cast < <ISA_LIT>Operand & > ( * Operands [ <NUM_LIT> ] ) . isToken ( ) && static_cast < <ISA_LIT>Operand & > ( * Operands [ <NUM_LIT> ] ) . getToken ( ) == <STR_LIT> ) RegIdx = <NUM_LIT> ; if ( static_cast < <ISA_LIT>Operand & > ( * Operands [ RegIdx ] ) . isReg ( ) && ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( static_cast < <ISA_LIT>Operand & > ( * Operands [ RegIdx ] ) . getReg ( ) ) || <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( static_cast < <ISA_LIT>Operand & > ( * Operands [ RegIdx ] ) . getReg ( ) ) ) ) return true ;


<s> void SwitchMode ( ) { uint64_t FB = ComputeAvailableFeatures ( STI . ToggleFeature ( <STR_LIT> ) ) ; setAvailableFeatures ( FB ) ;


<s> uint64_t FB = ComputeAvailableFeatures ( STI . ToggleFeature ( <STR_LIT> ) ) ; setAvailableFeatures ( FB ) ;


<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 ; break ; case MCK_ModImm : if ( Op . isImm ( ) ) { 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> const <ISA_LIT>Operand & Op = static_cast < const <ISA_LIT>Operand & > ( * Operands [ ListNo ] ) ; bool HasWritebackToken = Op . isToken ( ) && Op . getToken ( ) == <STR_LIT> ; bool ListContainsSP = listContainsReg ( Inst , ListNo , <STR_LIT> ) ; bool ListContainsLR = listContainsReg ( Inst , ListNo , <STR_LIT> ) ; bool ListContainsPC = listContainsReg ( Inst , ListNo , <STR_LIT> ) ; if ( ! IsARPop && ListContainsSP ) return Error ( Operands [ ListNo + HasWritebackToken ] -> getStartLoc ( ) , <STR_LIT> ) ; else if ( ListContainsPC && ListContainsLR ) return Error ( Operands [ ListNo + HasWritebackToken ] -> getStartLoc ( ) , <STR_LIT> ) ; else if ( inITBlock ( ) && ! lastInITBlock ( ) && ListContainsPC ) return Error ( Operands [ ListNo + HasWritebackToken ] -> getStartLoc ( ) , <STR_LIT> <STR_LIT> ) ;


<s> bool ListContainsPC = listContainsReg ( Inst , ListNo , <STR_LIT> ) ; if ( ! IsARPop && ListContainsSP ) return Error ( Operands [ ListNo + HasWritebackToken ] -> getStartLoc ( ) , <STR_LIT> ) ;

else if ( ListContainsPC && ListContainsLR ) return Error ( Operands [ ListNo + HasWritebackToken ] -> getStartLoc ( ) , <STR_LIT> ) ;


<s> if ( ListContainsSP && ListContainsPC ) return Error ( Operands [ ListNo + HasWritebackToken ] -> getStartLoc ( ) , <STR_LIT> ) ; else if ( ListContainsSP ) return Error ( Operands [ ListNo + HasWritebackToken ] -> getStartLoc ( ) , <STR_LIT> ) ; else if ( ListContainsPC ) return Error ( Operands [ ListNo + HasWritebackToken ] -> getStartLoc ( ) , <STR_LIT> ) ;


<s> bool <ISA_LIT>AsmParser :: validatetSTMRegList ( MCInst Inst , const OperandVector & Operands , unsigned ListNo ) { const <ISA_LIT>Operand & Op = static_cast < const <ISA_LIT>Operand & > ( * Operands [ ListNo ] ) ; bool HasWritebackToken = Op . isToken ( ) && Op . getToken ( ) == <STR_LIT> ; bool ListContainsSP = listContainsReg ( Inst , ListNo , <STR_LIT> ) ; bool ListContainsPC = listContainsReg ( Inst , ListNo , <STR_LIT> ) ;

if ( ListContainsSP && ListContainsPC ) return Error ( Operands [ ListNo + HasWritebackToken ] -> getStartLoc ( ) , <STR_LIT> ) ;