<s> 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 ( std :: numeric_limits < int32_t > :: min ( ) , getContext ( ) ) ; } E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( ImmVal , S , E ) ) ; if ( Parser . getTok ( ) . is ( AsmToken :: Exclaim ) ) { Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( Parser . getTok ( ) . getString ( ) , Parser . getTok ( ) . getLoc ( ) ) ) ; Parser . Lex ( ) ; } return false ; } LLVM_FALLTHROUGH ; case AsmToken :: Colon : { S = Parser . getTok ( ) . getLoc ( ) ;

<ISA_LIT>MCExpr :: VariantKind RefKind ;


<s> enum { COFF = ( <NUM_LIT> << MCObjectFileInfo :: IsCOFF ) , ELF = ( <NUM_LIT> << MCObjectFileInfo :: IsELF ) , MACHO = ( <NUM_LIT> << MCObjectFileInfo :: IsMachO ) , WASM = ( <NUM_LIT> << MCObjectFileInfo :: IsWasm ) , } ; static const struct PrefixEntry { const char * Spelling ; <ISA_LIT>MCExpr :: VariantKind VariantKind ; uint8_t SupportedFormats ; } PrefixEntries [ ] = { { <STR_LIT> , <ISA_LIT>MCExpr :: VK_<ISA_LIT>_LO16 , COFF | ELF | MACHO } , { <STR_LIT> , <ISA_LIT>MCExpr :: VK_<ISA_LIT>_HI16 , COFF | ELF | MACHO } , } ; StringRef IDVal = Parser . getTok ( ) . getIdentifier ( ) ; const auto & Prefix = std :: find_if ( std :: begin ( PrefixEntries ) , std :: end ( PrefixEntries ) , [ & IDVal ] ( const PrefixEntry & PE ) { return PE . Spelling == IDVal ; } ) ; if ( Prefix == std :: end ( PrefixEntries ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return true ; } uint8_t CurrentFormat ; switch ( getContext ( ) . getObjectFileInfo ( ) -> getObjectFileType ( ) ) { case MCObjectFileInfo :: IsMachO : CurrentFormat = MACHO ; break ; case MCObjectFileInfo :: IsELF : CurrentFormat = ELF ; break ; case MCObjectFileInfo :: IsCOFF : CurrentFormat = COFF ; break ; case MCObjectFileInfo :: IsWasm : CurrentFormat = WASM ; break ; case MCObjectFileInfo :: IsXCOFF : llvm_unreachable ( <STR_LIT> ) ; break ; }

if ( ~ Prefix -> SupportedFormats & CurrentFormat ) {


<s> SMLoc S = Parser . getTok ( ) . getLoc ( ) ; const AsmToken & Tok = Parser . getTok ( ) ; if ( Tok . isNot ( AsmToken :: Identifier ) ) return MatchOperand_NoMatch ; if ( ! Tok . getString ( ) . equals_lower ( <STR_LIT> ) ) return MatchOperand_NoMatch ;


<s> if ( Tok . isNot ( AsmToken :: Identifier ) ) return MatchOperand_NoMatch ; if ( ! Tok . getString ( ) . equals_lower ( <STR_LIT> ) ) return MatchOperand_NoMatch ;


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

if ( isMnemonicVPTPredicable ( Mnemonic , ExtraToken ) && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> ) {


<s> int32_t Val = Memory . OffsetImm ? Memory . OffsetImm -> getValue ( ) : <NUM_LIT> ; if ( ! Memory . OffsetRegNum ) { <STR_LIT> AddSub = Val < <NUM_LIT> ? <STR_LIT> : <STR_LIT> ; if ( Val == INT32_MIN ) Val = <NUM_LIT> ;


<s> Val = <STR_LIT> ( AddSub , Val ) ; } else { Val = <STR_LIT> ( Memory . isNegative ? <STR_LIT> : <STR_LIT> , <NUM_LIT> ) ; } Inst . addOperand ( MCOperand :: createReg ( Memory . BaseRegNum ) ) ; Inst . addOperand ( MCOperand :: createReg ( Memory . OffsetRegNum ) ) ; Inst . addOperand ( MCOperand :: createImm ( Val ) ) ;


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


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


<s> } const MCConstantExpr * CE = static_cast < const MCConstantExpr * > ( getImm ( ) ) ; int32_t Val = CE -> getValue ( ) ; <STR_LIT> AddSub = Val < <NUM_LIT> ? <STR_LIT> : <STR_LIT> ; if ( Val == INT32_MIN ) Val = <NUM_LIT> ; if ( Val < <NUM_LIT> ) Val = - Val ; Val = <STR_LIT> ( AddSub , Val ) ;

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


<s> int Imm = CE -> getValue ( ) ; bool isAdd = Imm >= <NUM_LIT> ; if ( Imm == INT32_MIN ) Imm = <NUM_LIT> ; Imm = ( Imm < <NUM_LIT> ? - Imm : Imm ) | ( int ) isAdd << <NUM_LIT> ; Inst . addOperand ( MCOperand :: createImm ( Imm ) ) ;


<s> assert ( CE && <STR_LIT> ) ; int Imm = CE -> getValue ( ) ; bool isAdd = Imm >= <NUM_LIT> ; if ( Imm == INT32_MIN ) Imm = <NUM_LIT> ;

Imm = ( Imm < <NUM_LIT> ? - Imm : Imm ) | ( int ) isAdd << <NUM_LIT> ;


<s> assert ( CE && <STR_LIT> ) ; int Imm = CE -> getValue ( ) ; bool isAdd = Imm >= <NUM_LIT> ; if ( Imm == INT32_MIN ) Imm = <NUM_LIT> ; Imm = ( ( Imm < <NUM_LIT> ? - Imm : Imm ) / <NUM_LIT> ) | ( int ) isAdd << <NUM_LIT> ; Inst . addOperand ( MCOperand :: createImm ( Imm ) ) ;


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

Inst . addOperand ( MCOperand :: createImm ( - CE -> getValue ( ) ) ) ;


<s> void addT2SOImmNotOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; Inst . addOperand ( MCOperand :: createImm ( ~ CE -> getValue ( ) ) ) ;


<s> Inst . addOperand ( MCOperand :: createImm ( ~ CE -> getValue ( ) ) ) ;


<s> <ISA_LIT>AsmParser ( const MCSubtargetInfo & STI , MCAsmParser & Parser , const MCInstrInfo & MII , const MCTargetOptions & Options ) : MCTargetAsmParser ( Options , STI ) , MII ( MII ) , UC ( Parser ) { MCAsmParserExtension :: Initialize ( Parser ) ;

MRI = getContext ( ) . getRegisterInfo ( ) ;


<s> KindTy Kind = k_RegisterList ; if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Regs . front ( ) . second ) ) Kind = k_DPRRegisterList ; else if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Regs . front ( ) . second ) ) Kind = k_SPRRegisterList ; array_pod_sort ( Regs . begin ( ) , Regs . end ( ) ) ; auto Op = make_unique < <ISA_LIT>Operand > ( Kind ) ; for ( SmallVectorImpl < std :: pair < unsigned , unsigned > > :: const_iterator I = Regs . begin ( ) , E = Regs . end ( ) ; I != E ; ++ I ) Op -> Registers . push_back ( I -> second ) ;


<s> assert ( Regs . size ( ) > <NUM_LIT> && <STR_LIT> ) ; KindTy Kind = k_RegisterList ; if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Regs . front ( ) . second ) ) Kind = k_DPRRegisterList ; else if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Regs . front ( ) . second ) ) Kind = k_SPRRegisterList ; array_pod_sort ( Regs . begin ( ) , Regs . end ( ) ) ; auto Op = make_unique < <ISA_LIT>Operand > ( Kind ) ; for ( SmallVectorImpl < std :: pair < unsigned , unsigned > > :: const_iterator I = Regs . begin ( ) , E = Regs . end ( ) ; I != E ; ++ I ) Op -> Registers . push_back ( I -> second ) ;


<s> } } else { unsigned Cond = static_cast < <ISA_LIT>Operand & > ( * Operands [ CondOp ] ) . getCondCode ( ) ; switch ( Inst . getOpcode ( ) ) { case <STR_LIT> : case <STR_LIT> : Inst . setOpcode ( Cond == <STR_LIT> ? <STR_LIT> : <STR_LIT> ) ; break ; case <STR_LIT> : case <STR_LIT> : Inst . setOpcode ( Cond == <STR_LIT> ? <STR_LIT> : <STR_LIT> ) ; break ; } } switch ( Inst . getOpcode ( ) ) { case <STR_LIT> : { <ISA_LIT>Operand & op = static_cast < <ISA_LIT>Operand & > ( * Operands [ ImmOp ] ) ; if ( ! op . isSignedOffset < <NUM_LIT> , <NUM_LIT> > ( ) && isThumbTwo ( ) ) Inst . setOpcode ( <STR_LIT> ) ; break ;


<s> } else { unsigned Cond = static_cast < <ISA_LIT>Operand & > ( * Operands [ CondOp ] ) . getCondCode ( ) ; switch ( Inst . getOpcode ( ) ) { case <STR_LIT> : case <STR_LIT> : Inst . setOpcode ( Cond == <STR_LIT> ? <STR_LIT> : <STR_LIT> ) ; break ; case <STR_LIT> : case <STR_LIT> : Inst . setOpcode ( Cond == <STR_LIT> ? <STR_LIT> : <STR_LIT> ) ; break ; } } switch ( Inst . getOpcode ( ) ) { case <STR_LIT> : { <ISA_LIT>Operand & op = static_cast < <ISA_LIT>Operand & > ( * Operands [ ImmOp ] ) ; if ( ! op . isSignedOffset < <NUM_LIT> , <NUM_LIT> > ( ) && isThumbTwo ( ) ) Inst . setOpcode ( <STR_LIT> ) ; break ; } case <STR_LIT> : { <ISA_LIT>Operand & op = static_cast < <ISA_LIT>Operand & > ( * Operands [ ImmOp ] ) ;


<s> return getParser ( ) . Error ( L , Msg , Ranges ) ;


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

if ( hasV6MOps ( ) ) CanAcceptPredicationCode = Mnemonic != <STR_LIT> ;


<s> RegisterMCAsmParser < <ISA_LIT>AsmParser > Y ( The<ISA_LIT>BETarget ) ;

RegisterMCAsmParser < <ISA_LIT>AsmParser > A ( TheThumbLETarget ) ;


<s> RegisterMCAsmParser < <ISA_LIT>AsmParser > A ( TheThumbLETarget ) ; RegisterMCAsmParser < <ISA_LIT>AsmParser > B ( TheThumbBETarget ) ;


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


<s> unsigned Encoding = StringSwitch < unsigned > ( RegName . lower ( ) ) . 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> ) . 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 ( Encoding == ~ <NUM_LIT> ) return MatchOperand_NoMatch ;


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


<s> <ISA_LIT>AsmParser :: OperandMatchResultTy <ISA_LIT>AsmParser :: parseCoprocNumOperand ( OperandVector & Operands ) { MCAsmParser & Parser = getParser ( ) ; 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 ; if ( ( hasV7Ops ( ) || hasV8Ops ( ) ) && ( Num == <NUM_LIT> || Num == <NUM_LIT> ) ) return MatchOperand_NoMatch ; Parser . Lex ( ) ;

Operands . push_back ( <ISA_LIT>Operand :: CreateCoprocNum ( Num , S ) ) ;


<s> 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 ; if ( ( hasV7Ops ( ) || hasV8Ops ( ) ) && ( Num == <NUM_LIT> || Num == <NUM_LIT> ) ) return MatchOperand_NoMatch ; Parser . Lex ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateCoprocNum ( Num , S ) ) ;


<s> SMLoc S = Parser . getTok ( ) . getLoc ( ) ; if ( Parser . getTok ( ) . isNot ( AsmToken :: LCurly ) ) return MatchOperand_NoMatch ; Parser . Lex ( ) ; const MCExpr * Expr ; SMLoc Loc = Parser . getTok ( ) . getLoc ( ) ; if ( getParser ( ) . parseExpression ( Expr ) ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Expr ) ;

if ( ! CE || CE -> getValue ( ) < <NUM_LIT> || CE -> getValue ( ) > <NUM_LIT> ) {


<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 ; Parser . Lex ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateCoprocReg ( Reg , S ) ) ;


<s> 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 parseDirectiveThumbSet ( DirectiveID . getLoc ( ) ) ; if ( ! IsMachO && ! IsCOFF ) { if ( IDVal == <STR_LIT> ) return parseDirectiveArch ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveCPU ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveEabiAttr ( 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 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> ) return parseDirectiveObjectArch ( DirectiveID . getLoc ( ) ) ; else if ( IDVal == <STR_LIT> ) return parseDirectiveTLSDescSeq ( DirectiveID . getLoc ( ) ) ; }


<s> return false ; } Triple T ; MCSubtargetInfo & STI = copySTI ( ) ; STI . setDefaultFeatures ( <STR_LIT> , ( <STR_LIT> + <STR_LIT> ( ID ) ) . str ( ) ) ; setAvailableFeatures ( ComputeAvailableFeatures ( STI . getFeatureBits ( ) ) ) ; getTargetStreamer ( ) . emitArch ( ID ) ;


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


<s> Parser . eatToEndOfStatement ( ) ; return false ; } 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> ) ; } unsigned FeatureKind = <STR_LIT> ( Name ) ;

if ( FeatureKind == <STR_LIT> ) Error ( ExtLoc , <STR_LIT> + Name ) ;


<s> if ( FeatureKind == <STR_LIT> ) Error ( ExtLoc , <STR_LIT> + Name ) ; for ( const auto & Extension : Extensions ) { if ( Extension . Kind != FeatureKind ) continue ; if ( Extension . Features . none ( ) ) report_fatal_error ( <STR_LIT> + Name ) ; if ( ( getAvailableFeatures ( ) & Extension . ArchCheck ) != Extension . ArchCheck ) { Error ( ExtLoc , <STR_LIT> + Name + <STR_LIT> <STR_LIT> ) ; return false ; } MCSubtargetInfo & STI = copySTI ( ) ; FeatureBitset ToggleFeatures = EnableFeature ? ( ~ STI . getFeatureBits ( ) & Extension . Features ) : ( STI . getFeatureBits ( ) & Extension . Features ) ; uint64_t Features = ComputeAvailableFeatures ( STI . ToggleFeature ( ToggleFeatures ) ) ; setAvailableFeatures ( Features ) ; return false ;


<s> bool <ISA_LIT>AsmParser :: parseDirective<ISA_LIT> ( SMLoc L ) { MCAsmParser & Parser = getParser ( ) ;

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


<s> 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> if ( Val == <NUM_LIT> ) { if ( ! hasThumb ( ) ) { Error ( L , <STR_LIT> ) ; return false ; } if ( ! isThumb ( ) ) SwitchMode ( ) ; getParser ( ) . getStreamer ( ) . EmitAssemblerFlag ( MCAF_Code16 ) ; } else { if ( ! has<ISA_LIT> ( ) ) { Error ( L , <STR_LIT> ) ; return false ; } if ( isThumb ( ) ) SwitchMode ( ) ;

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


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


<s> MCAsmParser & Parser = getParser ( ) ; int64_t Tag ; 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 ; else llvm_unreachable ( <STR_LIT> ) ; if ( IsIntegerValue ) { const MCExpr * ValueExpr ; SMLoc ValueExprLoc = Parser . getTok ( ) . getLoc ( ) ; if ( Parser . parseExpression ( ValueExpr ) ) { Parser . eatToEndOfStatement ( ) ; return false ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( ValueExpr ) ; if ( ! CE ) { Error ( ValueExprLoc , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } IntegerValue = CE -> getValue ( ) ; } if ( Tag == <STR_LIT> ) { if ( Parser . getTok ( ) . isNot ( AsmToken :: Comma ) ) IsStringValue = false ; if ( Parser . getTok ( ) . isNot ( AsmToken :: Comma ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ;


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

else getStreamer ( ) . EmitValueToAlignment ( <NUM_LIT> ) ;


<s> const MCSection * Section = getStreamer ( ) . getCurrentSection ( ) . first ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { TokError ( <STR_LIT> ) ; return false ; } if ( ! Section ) { getStreamer ( ) . InitSections ( false ) ; Section = getStreamer ( ) . getCurrentSection ( ) . first ;


<s> std :: vector < const char * > Features ; if ( ! <STR_LIT> ( ID , Features ) ) { Error ( FPUNameLoc , <STR_LIT> ) ; return false ; } MCSubtargetInfo & STI = copySTI ( ) ; for ( auto Feature : Features ) STI . ApplyFeatureFlag ( Feature ) ;

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


<s> Error ( Loc , <STR_LIT> ) ; return false ; } break ; case <NUM_LIT> : if ( Value -> getValue ( ) > <NUM_LIT> ) { Error ( Loc , StringRef ( Suffix ? <STR_LIT> : <STR_LIT> ) + <STR_LIT> ) ; return false ; } break ; default : llvm_unreachable ( <STR_LIT> ) ; } getTargetStreamer ( ) . emitInst ( Value -> getValue ( ) , Suffix ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ; if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) { Error ( Loc , <STR_LIT> ) ; return false ; }


<s> } if ( SPReg == <STR_LIT> || SPReg == <STR_LIT> ) { Parser . eatToEndOfStatement ( ) ; Error ( SPRegLoc , <STR_LIT> ) ; return false ; } int64_t Offset = <NUM_LIT> ; if ( Parser . getTok ( ) . is ( AsmToken :: Comma ) ) { Parser . Lex ( ) ; 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 ( ) ;


<s> SMLoc SPRegLoc = Parser . getTok ( ) . getLoc ( ) ; int SPReg = tryParseRegister ( ) ; if ( SPReg == - <NUM_LIT> ) { Parser . eatToEndOfStatement ( ) ; Error ( SPRegLoc , <STR_LIT> ) ; return false ; } if ( SPReg == <STR_LIT> || SPReg == <STR_LIT> ) { Parser . eatToEndOfStatement ( ) ; Error ( SPRegLoc , <STR_LIT> ) ; return false ; } int64_t Offset = <NUM_LIT> ; if ( Parser . getTok ( ) . is ( AsmToken :: Comma ) ) { Parser . Lex ( ) ; 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> ) ;


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


<s> if ( ! UC . hasFnStart ( ) ) { Error ( L , <STR_LIT> ) ; return false ; } 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 ( ) ;


<s> UC . recordPersonality ( L ) ; if ( ! UC . hasFnStart ( ) ) { Error ( L , <STR_LIT> ) ; return false ; } if ( UC . cantUnwind ( ) ) { Error ( L , <STR_LIT> ) ; UC . emitCantUnwindLocNotes ( ) ; return false ; } if ( UC . hasHandlerData ( ) ) { Error ( L , <STR_LIT> ) ; UC . emitHandlerDataLocNotes ( ) ;


<s> } if ( UC . cantUnwind ( ) ) { 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> ) ;


<s> Error ( L , <STR_LIT> ) ; UC . emitHandlerDataLocNotes ( ) ; return false ; } if ( HasExistingPersonality ) { Parser . eatToEndOfStatement ( ) ; Error ( L , <STR_LIT> ) ; UC . emitPersonalityLocNotes ( ) ; return false ; } const MCExpr * IndexExpression ; SMLoc IndexLoc = Parser . getTok ( ) . getLoc ( ) ; if ( Parser . parseExpression ( IndexExpression ) ) { Parser . eatToEndOfStatement ( ) ; return false ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( IndexExpression ) ; if ( ! CE ) { Parser . eatToEndOfStatement ( ) ; Error ( IndexLoc , <STR_LIT> ) ; return false ; } if ( CE -> getValue ( ) < <NUM_LIT> || CE -> getValue ( ) >= <STR_LIT> :: NUM_PERSONALITY_INDEX ) { Parser . eatToEndOfStatement ( ) ; Error ( IndexLoc , <STR_LIT> ) ; return false ; } getTargetStreamer ( ) . emitPersonalityIndex ( CE -> getValue ( ) ) ; return false ;


<s> if ( parseRegisterList ( Operands ) ) return false ; <ISA_LIT>Operand & Op = ( <ISA_LIT>Operand & ) * Operands [ <NUM_LIT> ] ; if ( ! IsVector && ! Op . isRegList ( ) ) { Error ( L , <STR_LIT> ) ; return false ; } if ( IsVector && ! Op . isDPRRegList ( ) ) {


<s> Parser . eatToEndOfStatement ( ) ; Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return false ; } Parser . Lex ( ) ;

if ( RegisterReqs . insert ( std :: make_pair ( Name , Reg ) ) . first -> second != Reg ) {


<s> return false ; } if ( UC . hasHandlerData ( ) ) { 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> ) { Error ( SPRegLoc , <STR_LIT> ) ;


<s> } 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 ; } Parser . Lex ( ) ; const MCExpr * OffsetExpr ; SMLoc ExLoc = Parser . getTok ( ) . getLoc ( ) ; SMLoc EndLoc ; if ( getParser ( ) . parseExpression ( OffsetExpr , EndLoc ) ) { Error ( ExLoc , <STR_LIT> ) ; return false ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( OffsetExpr ) ; if ( ! CE ) { Error ( ExLoc , <STR_LIT> ) ; return false ; } Offset = CE -> getValue ( ) ; } getTargetStreamer ( ) . emitSetFP ( static_cast < unsigned > ( FPReg ) , static_cast < unsigned > ( SPReg ) , Offset ) ; return false ;


<s> Error ( L , <STR_LIT> ) ; return false ; } else { Error ( L , <STR_LIT> ) ; return false ; } if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) {

Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ;


<s> Error ( L , <STR_LIT> ) ; return false ; } Parser . Lex ( ) ; if ( ! hasThumb ( ) ) {


<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 ) ) { Error ( L , <STR_LIT> ) ; return false ; } MCSymbol * Func = getParser ( ) . getContext ( ) . getOrCreateSymbol ( Tok . getIdentifier ( ) ) ; getParser ( ) . getStreamer ( ) . EmitThumbFunc ( Func ) ; Parser . Lex ( ) ; return false ; } } if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ;


<s> } if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) { TokError ( <STR_LIT> + Name + <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } Lex ( ) ; MCSymbol * Sym ; const MCExpr * Value ; if ( MCParserUtils :: parseAssignmentExpression ( Name , true , Parser , Sym , Value ) ) return true ;

getTargetStreamer ( ) . emitThumbSet ( Sym , Value ) ;


<s> MCAsmParser & Parser = getParser ( ) ; if ( getLexer ( ) . isNot ( AsmToken :: Identifier ) ) { TokError ( <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } 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 ( ) ;


<s> Lex ( ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; Parser . eatToEndOfStatement ( ) ; return false ; } getTargetStreamer ( ) . AnnotateTLSDescriptorSequence ( SRE ) ;


<s> MCAsmParser & Parser = getParser ( ) ; if ( Parser . getTok ( ) . isNot ( AsmToken :: Identifier ) ) { Parser . eatToEndOfStatement ( ) ; Error ( L , <STR_LIT> ) ; return false ; } RegisterReqs . erase ( Parser . getTok ( ) . getIdentifier ( ) . lower ( ) ) ; Parser . Lex ( ) ;


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


<s> <ISA_LIT>Operand & TyOp = static_cast < <ISA_LIT>Operand & > ( * Operands [ <NUM_LIT> ] ) ; 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 ( ) ; Parser . Lex ( ) ; if ( Val > <NUM_LIT> || Val < <NUM_LIT> ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } float RealVal = <STR_LIT> ( Val ) ; Val = APFloat ( RealVal ) . bitcastToAPInt ( ) . getZExtValue ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( MCConstantExpr :: create ( Val , getContext ( ) ) , S , Parser . getTok ( ) . getLoc ( ) ) ) ; return MatchOperand_Success ; } Error ( Loc , <STR_LIT> ) ;


<s> <ISA_LIT>AsmParser :: OperandMatchResultTy <ISA_LIT>AsmParser :: parseInstSyncBarrierOptOperand ( OperandVector & Operands ) { MCAsmParser & Parser = getParser ( ) ; 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> ) ;


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


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


<s> const MCExpr * Value ; if ( getParser ( ) . parseExpression ( Value ) ) { Parser . eatToEndOfStatement ( ) ; return false ; } getParser ( ) . getStreamer ( ) . EmitValue ( Value , Size , L ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ; if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) {


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


<s> SMLoc S , E ; assert ( Parser . getTok ( ) . is ( AsmToken :: LBrac ) && <STR_LIT> ) ; S = Parser . getTok ( ) . getLoc ( ) ; Parser . Lex ( ) ; const AsmToken & BaseRegTok = Parser . getTok ( ) ; int BaseRegNum = tryParseRegister ( ) ; if ( BaseRegNum == - <NUM_LIT> ) return Error ( BaseRegTok . getLoc ( ) , <STR_LIT> ) ; const AsmToken & Tok = Parser . getTok ( ) ; 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 ( ) ;


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


<s> else return Error ( Loc , <STR_LIT> ) ; Parser . Lex ( ) ; Amount = <NUM_LIT> ; if ( St != <STR_LIT> ) { Loc = Parser . getTok ( ) . getLoc ( ) ; const AsmToken & HashTok = Parser . getTok ( ) ; if ( HashTok . isNot ( AsmToken :: Hash ) && HashTok . isNot ( AsmToken :: Dollar ) ) return Error ( HashTok . getLoc ( ) , <STR_LIT> ) ; Parser . Lex ( ) ; const MCExpr * Expr ; if ( getParser ( ) . parseExpression ( Expr ) ) return true ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Expr ) ; if ( ! CE ) return Error ( Loc , <STR_LIT> ) ;


<s> Operands . push_back ( <ISA_LIT>Operand :: CreateModImm ( ( Enc & <NUM_LIT> ) , ( Enc & <NUM_LIT> ) >> <NUM_LIT> , Sx1 , Ex1 ) ) ; return MatchOperand_Success ; } if ( Parser . getTok ( ) . is ( AsmToken :: EndOfStatement ) ) { Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( Imm1Exp , Sx1 , Ex1 ) ) ; return MatchOperand_Success ; } } else { Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( Imm1Exp , Sx1 , Ex1 ) ) ; return MatchOperand_Success ; } if ( Parser . getTok ( ) . isNot ( AsmToken :: Comma ) ) { Error ( Sx1 , <STR_LIT> ) ; return MatchOperand_ParseFail ; } if ( Imm1 & ~ <NUM_LIT> ) { Error ( Sx1 , <STR_LIT> ) ; return MatchOperand_ParseFail ; } Parser . Lex ( ) ; SMLoc Sx2 , Ex2 ; Sx2 = Parser . getTok ( ) . getLoc ( ) ; if ( Parser . getTok ( ) . is ( AsmToken :: Hash ) || Parser . getTok ( ) . is ( AsmToken :: Dollar ) ) Parser . Lex ( ) ; const MCExpr * Imm2Exp ; if ( getParser ( ) . parseExpression ( Imm2Exp , Ex2 ) ) { Error ( Sx2 , <STR_LIT> ) ; return MatchOperand_ParseFail ;


<s> Error ( Sx1 , <STR_LIT> ) ; return MatchOperand_ParseFail ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Imm1Exp ) ; if ( CE ) { Imm1 = CE -> getValue ( ) ; int Enc = <STR_LIT> ( Imm1 ) ; if ( Enc != - <NUM_LIT> && Parser . getTok ( ) . is ( AsmToken :: EndOfStatement ) ) { Operands . push_back ( <ISA_LIT>Operand :: CreateModImm ( ( Enc & <NUM_LIT> ) , ( Enc & <NUM_LIT> ) >> <NUM_LIT> , Sx1 , Ex1 ) ) ; return MatchOperand_Success ; } if ( Parser . getTok ( ) . is ( AsmToken :: EndOfStatement ) ) { Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( Imm1Exp , Sx1 , Ex1 ) ) ; return MatchOperand_Success ; } } else { Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( Imm1Exp , Sx1 , Ex1 ) ) ; return MatchOperand_Success ; }

if ( Parser . getTok ( ) . isNot ( AsmToken :: Comma ) ) {


<s> std :: string LowerOp = Op . lower ( ) ; std :: string UpperOp = Op . upper ( ) ; if ( ShiftName != LowerOp && ShiftName != UpperOp ) { Error ( Parser . getTok ( ) . getLoc ( ) , Op + <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 * ShiftAmount ; SMLoc Loc = Parser . getTok ( ) . getLoc ( ) ; SMLoc EndLoc ; if ( getParser ( ) . parseExpression ( ShiftAmount , EndLoc ) ) { Error ( Loc , <STR_LIT> ) ; return MatchOperand_ParseFail ;


<s> } 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 * ShiftAmount ; SMLoc Loc = Parser . getTok ( ) . getLoc ( ) ; SMLoc EndLoc ; 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 ( ) ;


<s> bool <ISA_LIT>AsmParser :: parsePrefix ( <ISA_LIT>MCExpr :: VariantKind & RefKind ) { MCAsmParser & Parser = getParser ( ) ; RefKind = <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None ; if ( getLexer ( ) . is ( AsmToken :: Hash ) ) Parser . Lex ( ) ; assert ( getLexer ( ) . is ( AsmToken :: Colon ) && <STR_LIT> ) ; Parser . Lex ( ) ; if ( getLexer ( ) . isNot ( AsmToken :: Identifier ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return true ; } enum { COFF = ( <NUM_LIT> << MCObjectFileInfo :: IsCOFF ) , ELF = ( <NUM_LIT> << MCObjectFileInfo :: IsELF ) , MACHO = ( <NUM_LIT> << MCObjectFileInfo :: IsMachO ) } ; static const struct PrefixEntry { const char * Spelling ; <ISA_LIT>MCExpr :: VariantKind VariantKind ; uint8_t SupportedFormats ; } PrefixEntries [ ] = { { <STR_LIT> , <ISA_LIT>MCExpr :: VK_<ISA_LIT>_LO16 , COFF | ELF | MACHO } , { <STR_LIT> , <ISA_LIT>MCExpr :: VK_<ISA_LIT>_HI16 , COFF | ELF | MACHO } , } ; StringRef IDVal = Parser . getTok ( ) . getIdentifier ( ) ; const auto & Prefix = std :: find_if ( std :: begin ( PrefixEntries ) , std :: end ( PrefixEntries ) , [ & IDVal ] ( const PrefixEntry & PE ) { return PE . Spelling == IDVal ; } ) ; if ( Prefix == std :: end ( PrefixEntries ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return true ; } uint8_t CurrentFormat ; switch ( getContext ( ) . getObjectFileInfo ( ) -> getObjectFileType ( ) ) { case MCObjectFileInfo :: IsMachO : CurrentFormat = MACHO ; break ; case MCObjectFileInfo :: IsELF : CurrentFormat = ELF ; break ; case MCObjectFileInfo :: IsCOFF : CurrentFormat = COFF ; break ; } if ( ~ Prefix -> SupportedFormats & CurrentFormat ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return true ; } RefKind = Prefix -> VariantKind ; Parser . Lex ( ) ; if ( getLexer ( ) . isNot ( AsmToken :: Colon ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return true ; }


<s> const char * Spelling ; <ISA_LIT>MCExpr :: VariantKind VariantKind ; uint8_t SupportedFormats ; } PrefixEntries [ ] = { { <STR_LIT> , <ISA_LIT>MCExpr :: VK_<ISA_LIT>_LO16 , COFF | ELF | MACHO } , { <STR_LIT> , <ISA_LIT>MCExpr :: VK_<ISA_LIT>_HI16 , COFF | ELF | MACHO } , } ; StringRef IDVal = Parser . getTok ( ) . getIdentifier ( ) ; const auto & Prefix = std :: find_if ( std :: begin ( PrefixEntries ) , std :: end ( PrefixEntries ) , [ & IDVal ] ( const PrefixEntry & PE ) { return PE . Spelling == IDVal ; } ) ; if ( Prefix == std :: end ( PrefixEntries ) ) {


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


<s> 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 ; } } Parser . Lex ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateProcIFlags ( ( <STR_LIT> ) IFlags , S ) ) ; return MatchOperand_Success ;


<s> MCAsmParser & Parser = getParser ( ) ; const AsmToken & Tok = Parser . getTok ( ) ; SMLoc S = Tok . getLoc ( ) ; if ( Tok . isNot ( AsmToken :: Identifier ) ) return MatchOperand_NoMatch ; StringRef ShiftName = Tok . getString ( ) ; if ( ShiftName != <STR_LIT> && ShiftName != <STR_LIT> ) return MatchOperand_NoMatch ; Parser . Lex ( ) ; if ( Parser . getTok ( ) . isNot ( AsmToken :: Hash ) && Parser . getTok ( ) . isNot ( AsmToken :: Dollar ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } Parser . Lex ( ) ; SMLoc ExLoc = Parser . getTok ( ) . getLoc ( ) ; const MCExpr * ShiftAmount ; SMLoc EndLoc ; if ( getParser ( ) . parseExpression ( ShiftAmount , EndLoc ) ) { Error ( ExLoc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( ShiftAmount ) ;


<s> } Parser . Lex ( ) ; SMLoc ExLoc = Parser . getTok ( ) . getLoc ( ) ; const MCExpr * ShiftAmount ; SMLoc EndLoc ; if ( getParser ( ) . parseExpression ( ShiftAmount , EndLoc ) ) { Error ( ExLoc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( ShiftAmount ) ; if ( ! CE ) { Error ( ExLoc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } int64_t Val = CE -> getValue ( ) ; if ( Val != <NUM_LIT> && Val != <NUM_LIT> && Val != <NUM_LIT> && Val != <NUM_LIT> ) { Error ( ExLoc , <STR_LIT> ) ; return MatchOperand_ParseFail ; } Operands . push_back ( <ISA_LIT>Operand :: CreateRotImm ( Val , S , EndLoc ) ) ;


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


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


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


<s> break ; case k_Memory : OS << <STR_LIT> << <STR_LIT> << Memory . BaseRegNum ; OS << <STR_LIT> ; break ; case k_PostIndexRegister : OS << <STR_LIT> << ( PostIdxReg . isAdd ? <STR_LIT> : <STR_LIT> ) << PostIdxReg . RegNum ; if ( PostIdxReg . ShiftTy != <STR_LIT> ) OS << <STR_LIT> ( PostIdxReg . ShiftTy ) << <STR_LIT> << PostIdxReg . ShiftImm ; OS << <STR_LIT> ; break ; case k_ProcIFlags : { OS << <STR_LIT> ; unsigned IFlags = getProcIFlags ( ) ; for ( int i = <NUM_LIT> ; i >= <NUM_LIT> ; -- i ) if ( IFlags & ( <NUM_LIT> << i ) ) OS << <STR_LIT> ( <NUM_LIT> << i ) ; 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> ; } OS << <STR_LIT> ; break ; } case k_VectorList : OS << <STR_LIT> << VectorList . Count << <STR_LIT> << VectorList . RegNum << <STR_LIT> ; break ; case k_VectorListAllLanes : OS << <STR_LIT> << VectorList . Count << <STR_LIT> << VectorList . RegNum << <STR_LIT> ; break ; case k_VectorListIndexed : OS << <STR_LIT> << VectorList . LaneIndex << <STR_LIT> << VectorList . Count << <STR_LIT> << VectorList . RegNum << <STR_LIT> ; break ; case k_Token : OS << <STR_LIT> << getToken ( ) << <STR_LIT> ; break ; case k_VectorIndex : OS << <STR_LIT> << getVectorIndex ( ) << <STR_LIT> ;


<s> if ( static_cast < <ISA_LIT>Operand & > ( * Operands [ <NUM_LIT> ] ) . isToken ( ) && ( static_cast < <ISA_LIT>Operand & > ( * Operands [ <NUM_LIT> ] ) . getToken ( ) == <STR_LIT> || 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> if ( ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> ) && ( static_cast < <ISA_LIT>Operand & > ( * Operands [ <NUM_LIT> ] ) . getToken ( ) == <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> || 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> PredicationCode = CC ; } } if ( Mnemonic . endswith ( <STR_LIT> ) && ! ( Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || Mnemonic == <STR_LIT> || ( Mnemonic == <STR_LIT> && 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> 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> ) ;


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


<s> 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> Val = <STR_LIT> ( AddSub , Val , <STR_LIT> ) ; } else { Val = <STR_LIT> ( Memory . isNegative ? <STR_LIT> : <STR_LIT> , Memory . ShiftImm , Memory . ShiftType ) ; } Inst . addOperand ( MCOperand :: CreateReg ( Memory . BaseRegNum ) ) ; Inst . addOperand ( MCOperand :: CreateReg ( Memory . OffsetRegNum ) ) ;

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


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; if ( isImm ( ) ) { Inst . addOperand ( MCOperand :: CreateExpr ( getImm ( ) ) ) ; Inst . addOperand ( MCOperand :: CreateReg ( <NUM_LIT> ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ; return ; } int32_t Val = Memory . OffsetImm ? Memory . OffsetImm -> getValue ( ) : <NUM_LIT> ; if ( ! Memory . OffsetRegNum ) { <STR_LIT> AddSub = Val < <NUM_LIT> ? <STR_LIT> : <STR_LIT> ; if ( Val == INT32_MIN ) Val = <NUM_LIT> ; if ( Val < <NUM_LIT> ) Val = - Val ;


<s> Inst . addOperand ( MCOperand :: CreateExpr ( getImm ( ) ) ) ; Inst . addOperand ( MCOperand :: CreateReg ( <NUM_LIT> ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ; return ; } int32_t Val = Memory . OffsetImm ? Memory . OffsetImm -> getValue ( ) : <NUM_LIT> ; if ( ! Memory . OffsetRegNum ) {


<s> Inst . addOperand ( MCOperand :: CreateExpr ( getImm ( ) ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ; return ; } int32_t Val = Memory . OffsetImm ? Memory . OffsetImm -> getValue ( ) / <NUM_LIT> : <NUM_LIT> ; <STR_LIT> AddSub = Val < <NUM_LIT> ? <STR_LIT> : <STR_LIT> ; if ( Val == INT32_MIN ) Val = <NUM_LIT> ; if ( Val < <NUM_LIT> ) Val = - Val ;


<s> return ; } const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; int Val = CE -> getValue ( ) ;


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

Inst . addOperand ( MCOperand :: CreateImm ( Memory . Alignment ) ) ;


<s> void addAM2OffsetImmOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; assert ( CE && <STR_LIT> ) ; int32_t Val = CE -> getValue ( ) ; <STR_LIT> AddSub = Val < <NUM_LIT> ? <STR_LIT> : <STR_LIT> ;

if ( Val == INT32_MIN ) Val = <NUM_LIT> ;


<s> const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; assert ( CE && <STR_LIT> ) ; int32_t Val = CE -> getValue ( ) ; <STR_LIT> AddSub = Val < <NUM_LIT> ? <STR_LIT> : <STR_LIT> ; if ( Val == INT32_MIN ) Val = <NUM_LIT> ; if ( Val < <NUM_LIT> ) Val = - Val ; Val = <STR_LIT> ( AddSub , Val , <STR_LIT> ) ;

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


<s> <STR_LIT> AddSub = Val < <NUM_LIT> ? <STR_LIT> : <STR_LIT> ; if ( Val == INT32_MIN ) Val = <NUM_LIT> ; if ( Val < <NUM_LIT> ) Val = - Val ; Val = <STR_LIT> ( AddSub , Val ) ; Inst . addOperand ( MCOperand :: CreateReg ( <NUM_LIT> ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( Val ) ) ;


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

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


<s> Inst . addOperand ( MCOperand :: CreateImm ( - CE -> getValue ( ) ) ) ;


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


<s> Inst . addOperand ( MCOperand :: CreateImm ( ~ CE -> getValue ( ) ) ) ;


<s> unsigned lsb = Bitfield . LSB ; unsigned width = Bitfield . Width ; uint32_t Mask = ~ ( ( ( uint32_t ) <NUM_LIT> >> lsb ) << ( <NUM_LIT> - width ) >> ( <NUM_LIT> - ( lsb + width ) ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( Mask ) ) ;


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


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


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( unsigned ( getCondCode ( ) ) ) ) ; unsigned RegNum = getCondCode ( ) == <STR_LIT> ? <NUM_LIT> : <STR_LIT> ; Inst . addOperand ( MCOperand :: CreateReg ( RegNum ) ) ;


<s> void addCondCodeOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( unsigned ( getCondCode ( ) ) ) ) ; unsigned RegNum = getCondCode ( ) == <STR_LIT> ? <NUM_LIT> : <STR_LIT> ;

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


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

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


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

Inst . addOperand ( MCOperand :: CreateImm ( CoprocOption . Val ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( CoprocOption . Val ) ) ;


<s> void addCoprocRegOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( getCoproc ( ) ) ) ;


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


<s> void addDPRRegListOperands ( MCInst & Inst , unsigned N ) const { addRegListOperands ( Inst , N ) ;


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


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

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


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

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


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


<s> Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> - CE -> getValue ( ) ) ) ;


<s> const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> - CE -> getValue ( ) ) ) ;


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

Inst . addOperand ( MCOperand :: CreateImm ( CE -> getValue ( ) / <NUM_LIT> ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ;


Inst . addOperand ( MCOperand :: CreateImm ( - CE -> getValue ( ) ) ) ;


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


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


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


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


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


<s> Inst . addOperand ( MCOperand :: CreateImm ( ( Imm == <NUM_LIT> ? <NUM_LIT> : Imm ) ) ) ;


<s> const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; unsigned Imm = CE -> getValue ( ) ;

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


<s> void addInstSyncBarrierOptOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( unsigned ( getInstSyncBarrierOpt ( ) ) ) ) ;


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

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


<s> int32_t Val = Memory . OffsetImm ? Memory . OffsetImm -> getValue ( ) / <NUM_LIT> : <NUM_LIT> ; Inst . addOperand ( MCOperand :: CreateReg ( Memory . BaseRegNum ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( Val ) ) ;


<s> Inst . addOperand ( MCOperand :: CreateReg ( Memory . BaseRegNum ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( Val ) ) ;


<s> int64_t Val = Memory . OffsetImm ? Memory . OffsetImm -> getValue ( ) : <NUM_LIT> ; Inst . addOperand ( MCOperand :: CreateReg ( Memory . BaseRegNum ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( Val ) ) ;


<s> void addMemImm12OffsetOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; if ( isImm ( ) ) { addExpr ( Inst , getImm ( ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ; return ;


int64_t Val = Memory . OffsetImm ? Memory . OffsetImm -> getValue ( ) : <NUM_LIT> ;


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


<s> if ( isImm ( ) ) { Inst . addOperand ( MCOperand :: CreateExpr ( getImm ( ) ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ; return ; } int64_t Val = Memory . OffsetImm ? Memory . OffsetImm -> getValue ( ) : <NUM_LIT> ; Inst . addOperand ( MCOperand :: CreateReg ( Memory . BaseRegNum ) ) ;


<s> Inst . addOperand ( MCOperand :: CreateExpr ( getImm ( ) ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ; return ; } int64_t Val = Memory . OffsetImm ? Memory . OffsetImm -> getValue ( ) : <NUM_LIT> ;

Inst . addOperand ( MCOperand :: CreateReg ( Memory . BaseRegNum ) ) ;


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


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


<s> int32_t Imm = Memory . OffsetImm -> getValue ( ) ;

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


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; int32_t Imm = Memory . OffsetImm -> getValue ( ) ; Inst . addOperand ( MCOperand :: CreateImm ( Imm ) ) ;


<s> void addMemPosImm8OffsetOperands ( MCInst & Inst , unsigned N ) const { addMemImm8OffsetOperands ( Inst , N ) ;


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

unsigned Val = <STR_LIT> ( Memory . isNegative ? <STR_LIT> : <STR_LIT> , Memory . ShiftImm , Memory . ShiftType ) ;


<s> Inst . addOperand ( MCOperand :: CreateReg ( Memory . BaseRegNum ) ) ; Inst . addOperand ( MCOperand :: CreateReg ( Memory . OffsetRegNum ) ) ;

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


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


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

Inst . addOperand ( MCOperand :: CreateReg ( Memory . OffsetRegNum ) ) ;


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


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


<s> int64_t Val = Memory . OffsetImm ? ( Memory . OffsetImm -> getValue ( ) / <NUM_LIT> ) : <NUM_LIT> ; Inst . addOperand ( MCOperand :: CreateReg ( Memory . BaseRegNum ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( Val ) ) ;


<s> int64_t Val = Memory . OffsetImm ? ( Memory . OffsetImm -> getValue ( ) / <NUM_LIT> ) : <NUM_LIT> ; Inst . addOperand ( MCOperand :: CreateReg ( Memory . BaseRegNum ) ) ;


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


<s> void addMemUImm12OffsetOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; if ( isImm ( ) ) { addExpr ( Inst , getImm ( ) ) ;

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


<s> if ( isImm ( ) ) { addExpr ( Inst , getImm ( ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ; return ; } int64_t Val = Memory . OffsetImm ? Memory . OffsetImm -> getValue ( ) : <NUM_LIT> ; Inst . addOperand ( MCOperand :: CreateReg ( Memory . BaseRegNum ) ) ;


<s> unsigned Value = CE -> getValue ( ) ; if ( Value >= <NUM_LIT> ) Value = ( Value >> <NUM_LIT> ) | <NUM_LIT> ; else Value |= <NUM_LIT> ;

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


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

else if ( Value > <NUM_LIT> && Value <= <NUM_LIT> ) Value = ( Value >> <NUM_LIT> ) | <NUM_LIT> ;


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

if ( Value >= <NUM_LIT> && Value <= <NUM_LIT> ) Value = ( Value >> <NUM_LIT> ) | ( ( Value & <NUM_LIT> ) ? <NUM_LIT> : <NUM_LIT> ) ;


<s> if ( Value >= <NUM_LIT> && Value <= <NUM_LIT> ) Value = ( Value >> <NUM_LIT> ) | ( ( Value & <NUM_LIT> ) ? <NUM_LIT> : <NUM_LIT> ) ; else if ( Value > <NUM_LIT> && Value <= <NUM_LIT> ) Value = ( Value >> <NUM_LIT> ) | ( ( Value & <NUM_LIT> ) ? <NUM_LIT> : <NUM_LIT> ) ; else if ( Value > <NUM_LIT> ) Value = ( Value >> <NUM_LIT> ) | <NUM_LIT> ; Inst . addOperand ( MCOperand :: CreateImm ( Value ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; uint64_t Value = CE -> getValue ( ) ; unsigned Imm = <NUM_LIT> ;

for ( unsigned i = <NUM_LIT> ; i < <NUM_LIT> ; ++ i , Value >>= <NUM_LIT> ) {


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; uint64_t Value = CE -> getValue ( ) ;


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


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


<s> int Imm = CE -> getValue ( ) ; bool isAdd = Imm >= <NUM_LIT> ; if ( Imm == INT32_MIN ) Imm = <NUM_LIT> ; Imm = ( Imm < <NUM_LIT> ? - Imm : Imm ) | ( int ) isAdd << <NUM_LIT> ; Inst . addOperand ( MCOperand :: CreateImm ( Imm ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; assert ( CE && <STR_LIT> ) ; int Imm = CE -> getValue ( ) ; bool isAdd = Imm >= <NUM_LIT> ; if ( Imm == INT32_MIN ) Imm = <NUM_LIT> ;

Imm = ( Imm < <NUM_LIT> ? - Imm : Imm ) | ( int ) isAdd << <NUM_LIT> ;


<s> if ( Imm == INT32_MIN ) Imm = <NUM_LIT> ;

Imm = ( ( Imm < <NUM_LIT> ? - Imm : Imm ) / <NUM_LIT> ) | ( int ) isAdd << <NUM_LIT> ;


<s> assert ( CE && <STR_LIT> ) ; int Imm = CE -> getValue ( ) ; bool isAdd = Imm >= <NUM_LIT> ; if ( Imm == INT32_MIN ) Imm = <NUM_LIT> ; Imm = ( ( Imm < <NUM_LIT> ? - Imm : Imm ) / <NUM_LIT> ) | ( int ) isAdd << <NUM_LIT> ;


<s> Inst . addOperand ( MCOperand :: CreateReg ( PostIdxReg . RegNum ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( PostIdxReg . isAdd ) ) ;


<s> <STR_LIT> opc = PostIdxReg . isAdd ? <STR_LIT> : <STR_LIT> ; unsigned Imm = <STR_LIT> ( opc , PostIdxReg . ShiftImm , PostIdxReg . ShiftTy ) ; Inst . addOperand ( MCOperand :: CreateImm ( Imm ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( unsigned ( getProcIFlags ( ) ) ) ) ;


<s> const SmallVectorImpl < unsigned > & RegList = getRegList ( ) ;

for ( SmallVectorImpl < unsigned > :: const_iterator I = RegList . begin ( ) , E = RegList . end ( ) ; I != E ; ++ I ) Inst . addOperand ( MCOperand :: CreateReg ( * I ) ) ;


<s> void addRegListOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; const SmallVectorImpl < unsigned > & RegList = getRegList ( ) ;


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


<s> assert ( isRegShiftedImm ( ) && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateReg ( RegShiftedImm . SrcReg ) ) ;

unsigned Imm = ( RegShiftedImm . ShiftImm == <NUM_LIT> ? <NUM_LIT> : RegShiftedImm . ShiftImm ) ;


<s> void addRegShiftedImmOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; assert ( isRegShiftedImm ( ) && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateReg ( RegShiftedImm . SrcReg ) ) ; unsigned Imm = ( RegShiftedImm . ShiftImm == <NUM_LIT> ? <NUM_LIT> : RegShiftedImm . ShiftImm ) ;

Inst . addOperand ( MCOperand :: CreateImm ( <STR_LIT> ( RegShiftedImm . ShiftTy , Imm ) ) ) ;


<s> Inst . addOperand ( MCOperand :: CreateReg ( RegShiftedReg . ShiftReg ) ) ; Inst . addOperand ( MCOperand :: CreateImm ( <STR_LIT> ( RegShiftedReg . ShiftTy , RegShiftedReg . ShiftImm ) ) ) ;


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

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


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

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


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( ( ShifterImm . isASR << <NUM_LIT> ) | ShifterImm . Imm ) ) ;


<s> Inst . addOperand ( MCOperand :: CreateReg ( Memory . OffsetRegNum ) ) ;

Inst . addOperand ( MCOperand :: CreateImm ( Memory . ShiftImm ) ) ;


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


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


<s> Inst . addOperand ( MCOperand :: CreateImm ( ~ CE -> getValue ( ) ) ) ;


<s> if ( CE ) { Inst . addOperand ( MCOperand :: CreateImm ( CE -> getValue ( ) ) ) ; return ; } const MCSymbolRefExpr * SR = dyn_cast < MCSymbolRefExpr > ( Imm . Val ) ; assert ( SR && <STR_LIT> ) ;

Inst . addOperand ( MCOperand :: CreateExpr ( SR ) ) ;


<s> } const MCSymbolRefExpr * SR = dyn_cast < MCSymbolRefExpr > ( Imm . Val ) ; assert ( SR && <STR_LIT> ) ;


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

Inst . addOperand ( MCOperand :: CreateImm ( VectorList . LaneIndex ) ) ;


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


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


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


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


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

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


<s> MCAsmParserExtension :: Initialize ( _Parser ) ; MRI = getContext ( ) . getRegisterInfo ( ) ; setAvailableFeatures ( ComputeAvailableFeatures ( STI . getFeatureBits ( ) ) ) ;


<s> break ; case k_Token : Tok = o . Tok ; break ; 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 ;


<s> return ! CantUnwindLocs . empty ( ) ;


<s> for ( unsigned i = OpNo ; i < Inst . getNumOperands ( ) ; ++ i ) { unsigned OpReg = Inst . getOperand ( i ) . getReg ( ) ; if ( OpReg == Reg ) containsReg = true ; if ( ! is<ISA_LIT>LowRegister ( OpReg ) && ( ! HiReg || OpReg != HiReg ) ) return true ; }


<s> if ( OpReg == Reg ) containsReg = true ; if ( ! is<ISA_LIT>LowRegister ( OpReg ) && ( ! HiReg || OpReg != HiReg ) ) return true ; } return false ;


<s> 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> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_BitfieldDescriptor ) ; Op -> Bitfield . LSB = LSB ;


<s> static <ISA_LIT>Operand * CreateCCOut ( unsigned RegNum , SMLoc S ) {

<ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_CCOut ) ;


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


<s> static <ISA_LIT>Operand * CreateCoprocNum ( unsigned CopVal , SMLoc S ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_CoprocNum ) ;


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


<s> static <ISA_LIT>Operand * CreateCoprocOption ( unsigned Val , SMLoc S , SMLoc E ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_CoprocOption ) ; Op -> Cop . Val = Val ;


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


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


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


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_ITCondMask ) ; Op -> ITMask . Mask = Mask ; Op -> StartLoc = S ; Op -> EndLoc = S ;


<s> Op -> Memory . ShiftImm = ShiftImm ; Op -> Memory . Alignment = Alignment ; Op -> Memory . isNegative = isNegative ; Op -> StartLoc = S ; Op -> EndLoc = E ; return Op ;


<s> static <ISA_LIT>Operand * CreateMemBarrierOpt ( <STR_LIT> Opt , SMLoc S ) {

<ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_MemBarrierOpt ) ;


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_MSRMask ) ; Op -> MMask . Val = MMask ; Op -> StartLoc = S ;


<s> Op -> PostIdxReg . ShiftTy = ShiftTy ; Op -> PostIdxReg . ShiftImm = ShiftImm ; Op -> StartLoc = S ; Op -> EndLoc = E ; return Op ;


<s> static <ISA_LIT>Operand * CreatePostIdxReg ( unsigned RegNum , bool isAdd , <STR_LIT> ShiftTy , unsigned ShiftImm , SMLoc S , SMLoc E ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_PostIndexRegister ) ; Op -> PostIdxReg . RegNum = RegNum ; Op -> PostIdxReg . isAdd = isAdd ; Op -> PostIdxReg . ShiftTy = ShiftTy ; Op -> PostIdxReg . ShiftImm = ShiftImm ; Op -> StartLoc = S ; Op -> EndLoc = E ; return Op ;


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


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


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( Kind ) ; for ( SmallVectorImpl < std :: pair < unsigned , unsigned > > :: const_iterator I = Regs . begin ( ) , E = Regs . end ( ) ; I != E ; ++ I ) Op -> Registers . push_back ( I -> second ) ; Op -> StartLoc = StartLoc ; Op -> EndLoc = EndLoc ;


<s> if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Regs . front ( ) . second ) ) Kind = k_DPRRegisterList ; else if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Regs . front ( ) . second ) ) Kind = k_SPRRegisterList ; array_pod_sort ( Regs . begin ( ) , Regs . end ( ) ) ; <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( Kind ) ; for ( SmallVectorImpl < std :: pair < unsigned , unsigned > > :: const_iterator I = Regs . begin ( ) , E = Regs . end ( ) ; I != E ; ++ I ) Op -> Registers . push_back ( I -> second ) ; Op -> StartLoc = StartLoc ; Op -> EndLoc = EndLoc ; return Op ;


<s> static <ISA_LIT>Operand * CreateRotImm ( unsigned Imm , SMLoc S , SMLoc E ) {

<ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_RotateImmediate ) ;


<s> static <ISA_LIT>Operand * CreateShiftedImmediate ( <STR_LIT> ShTy , unsigned SrcReg , unsigned ShiftImm , SMLoc S , SMLoc E ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_ShiftedImmediate ) ; Op -> RegShiftedImm . ShiftTy = ShTy ; Op -> RegShiftedImm . SrcReg = SrcReg ; Op -> RegShiftedImm . ShiftImm = ShiftImm ; Op -> StartLoc = S ; Op -> EndLoc = E ;


<s> static <ISA_LIT>Operand * CreateShiftedRegister ( <STR_LIT> ShTy , unsigned SrcReg , unsigned ShiftReg , unsigned ShiftImm , SMLoc S , SMLoc E ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_ShiftedRegister ) ; Op -> RegShiftedReg . ShiftTy = ShTy ; Op -> RegShiftedReg . SrcReg = SrcReg ; Op -> RegShiftedReg . ShiftReg = ShiftReg ; Op -> RegShiftedReg . ShiftImm = ShiftImm ; Op -> StartLoc = S ;


<s> static <ISA_LIT>Operand * CreateShiftedRegister ( <STR_LIT> ShTy , unsigned SrcReg , unsigned ShiftReg , unsigned ShiftImm , SMLoc S , SMLoc E ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_ShiftedRegister ) ; Op -> RegShiftedReg . ShiftTy = ShTy ;


<s> static <ISA_LIT>Operand * CreateVectorIndex ( unsigned Idx , SMLoc S , SMLoc E , MCContext & Ctx ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_VectorIndex ) ;


<s> Op -> VectorList . isDoubleSpaced = isDoubleSpaced ; Op -> StartLoc = S ; Op -> EndLoc = E ; return Op ;


<s> Op -> VectorList . RegNum = RegNum ; Op -> VectorList . Count = Count ; Op -> VectorList . isDoubleSpaced = isDoubleSpaced ;


<s> Op -> VectorList . Count = Count ; Op -> VectorList . LaneIndex = Index ; Op -> VectorList . isDoubleSpaced = isDoubleSpaced ; Op -> StartLoc = S ; Op -> EndLoc = E ;


<s> case <STR_LIT> : case <STR_LIT> : Inst . setOpcode ( Cond == <STR_LIT> ? <STR_LIT> : <STR_LIT> ) ; break ; case <STR_LIT> : case <STR_LIT> : Inst . setOpcode ( Cond == <STR_LIT> ? <STR_LIT> : <STR_LIT> ) ; break ; } } switch ( Inst . getOpcode ( ) ) { case <STR_LIT> : { <ISA_LIT>Operand * op = static_cast < <ISA_LIT>Operand * > ( Operands [ ImmOp ] ) ; if ( ! op -> isSignedOffset < <NUM_LIT> , <NUM_LIT> > ( ) && isThumbTwo ( ) ) Inst . setOpcode ( <STR_LIT> ) ; break ; } case <STR_LIT> : { <ISA_LIT>Operand * op = static_cast < <ISA_LIT>Operand * > ( Operands [ ImmOp ] ) ; if ( ! op -> isSignedOffset < <NUM_LIT> , <NUM_LIT> > ( ) && isThumbTwo ( ) ) Inst . setOpcode ( <STR_LIT> ) ;


<s> cvtThumbMultiply ( MCInst & Inst , const SmallVectorImpl < MCParsedAsmOperand * > & Operands ) { ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> addRegOperands ( Inst , <NUM_LIT> ) ; ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> addCCOutOperands ( Inst , <NUM_LIT> ) ; unsigned RegOp = <NUM_LIT> ; if ( Operands . size ( ) == <NUM_LIT> && ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> getReg ( ) == ( ( <ISA_LIT>Operand * ) Operands [ <NUM_LIT> ] ) -> getReg ( ) ) RegOp = <NUM_LIT> ; ( ( <ISA_LIT>Operand * ) Operands [ RegOp ] ) -> addRegOperands ( Inst , <NUM_LIT> ) ; Inst . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ;

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


<s> return Mnemonic . startswith ( <STR_LIT> ) || Mnemonic . startswith ( <STR_LIT> ) ;


<s> void emitCantUnwindLocNotes ( ) const { for ( Locs :: const_iterator UI = CantUnwindLocs . begin ( ) , UE = CantUnwindLocs . end ( ) ; UI != UE ; ++ UI ) Parser . Note ( * UI , <STR_LIT> ) ;


<s> void emitCantUnwindLocNotes ( ) const {

for ( Locs :: const_iterator UI = CantUnwindLocs . begin ( ) , UE = CantUnwindLocs . end ( ) ; UI != UE ; ++ UI ) Parser . Note ( * UI , <STR_LIT> ) ;


<s> FI != FE ; ++ FI ) Parser . Note ( * FI , <STR_LIT> ) ;


<s> void emitHandlerDataLocNotes ( ) const {

for ( Locs :: const_iterator HI = HandlerDataLocs . begin ( ) , HE = HandlerDataLocs . end ( ) ; HI != HE ; ++ HI ) Parser . Note ( * HI , <STR_LIT> ) ;


<s> for ( Locs :: const_iterator HI = HandlerDataLocs . begin ( ) , HE = HandlerDataLocs . end ( ) ; HI != HE ; ++ HI ) Parser . Note ( * HI , <STR_LIT> ) ;


<s> else if ( PII != PIE && ( PI == PE || PII -> getPointer ( ) < PI -> getPointer ( ) ) ) Parser . Note ( * PII ++ , <STR_LIT> ) ; else llvm_unreachable ( <STR_LIT> <STR_LIT> ) ;


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


<s> bool Error ( SMLoc L , const Twine & Msg , ArrayRef < SMRange > Ranges = None ) {

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


<s> unsigned TZ = countTrailingZeros ( ITState . Mask ) ; if ( ++ ITState . CurPosition == <NUM_LIT> - TZ ) ITState . CurPosition = ~ <NUM_LIT> ;


<s> <STR_LIT> getCondCode ( ) const { assert ( Kind == k_CondCode && <STR_LIT> ) ; return CC . Val ;


<s> assert ( Kind == k_CondCode && <STR_LIT> ) ; return CC . Val ;


<s> unsigned getCoproc ( ) const { assert ( ( Kind == k_CoprocNum || Kind == k_CoprocReg ) && <STR_LIT> ) ; return Cop . Val ;


<s> static unsigned getDRegFromQReg ( unsigned QReg ) { switch ( QReg ) { default : llvm_unreachable ( <STR_LIT> ) ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ;


<s> case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; }


<s> int getFPReg ( ) const { return FPReg ;


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


<s> return SMRange ( StartLoc , EndLoc ) ;


<s> <STR_LIT> getMemBarrierOpt ( ) const {

assert ( Kind == k_MemBarrierOpt && <STR_LIT> ) ;


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


<s> <STR_LIT> getProcIFlags ( ) const { assert ( Kind == k_ProcIFlags && <STR_LIT> ) ;


<s> assert ( ( Kind == k_Register || Kind == k_CCOut ) && <STR_LIT> ) ;


<s> SMLoc getStartLoc ( ) const override { return StartLoc ;


<s> <ISA_LIT>TargetStreamer & getTargetStreamer ( ) { MCTargetStreamer & TS = * getParser ( ) . getStreamer ( ) . getTargetStreamer ( ) ;

return static_cast < <ISA_LIT>TargetStreamer & > ( TS ) ;


assert ( Kind == k_Token && <STR_LIT> ) ;


<s> assert ( Kind == k_VectorIndex && <STR_LIT> ) ; return VectorIndex . Val ;


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


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


<s> bool hasFnStart ( ) const { return ! FnStartLocs . empty ( ) ;


<s> bool hasHandlerData ( ) const { return ! HandlerDataLocs . empty ( ) ;


return STI . getFeatureBits ( ) & <STR_LIT> ;


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


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


<s> bool inITBlock ( ) { return ITState . CurPosition != ~ <NUM_LIT> ;


<s> return ITState . CurPosition != ~ <NUM_LIT> ;


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


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

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


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

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


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

if ( ! Memory . OffsetImm ) return true ;


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


<s> bool isAlignedMemory ( ) const { return isMemNoOffset ( true ) ;


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


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


<s> if ( Kind != k_Immediate && Kind != k_PostIndexRegister ) return false ;

if ( Kind == k_PostIndexRegister ) return PostIdxReg . ShiftTy == <STR_LIT> ;


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


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

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


<s> bool is<ISA_LIT>SOImmNeg ( ) 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> ;


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


<s> bool is<ISA_LIT>SOImmNot ( ) const { if ( ! isImm ( ) ) return false ;


<s> bool isCoprocReg ( ) const { return Kind == k_CoprocReg ;


<s> static bool isDataTypeToken ( StringRef Tok ) {

return Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> ;


<s> return Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> || Tok == <STR_LIT> ;


<s> bool isDoubleSpacedVectorAllLanes ( ) const {

return Kind == k_VectorListAllLanes && VectorList . isDoubleSpaced ;


<s> bool isDoubleSpacedVectorIndexed ( ) const {

return Kind == k_VectorListIndexed && VectorList . isDoubleSpaced ;


<s> bool isDoubleSpacedVectorList ( ) const {

return Kind == k_VectorList && VectorList . isDoubleSpaced ;


<s> bool isDoubleSpacedVectorList ( ) const { return Kind == k_VectorList && VectorList . isDoubleSpaced ;


<s> bool isDPRRegList ( ) const { return Kind == k_DPRRegisterList ;


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


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


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

int Val = <STR_LIT> ( APInt ( <NUM_LIT> , CE -> getValue ( ) ) ) ;


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


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


<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> int64_t Value = CE -> getValue ( ) ;

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


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


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


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


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


<s> bool isImm0_31 ( ) const { 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 ( ) ;


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


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

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


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


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


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


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


<s> bool isImm1_16 ( ) const { if ( ! isImm ( ) ) 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> int64_t Value = CE -> getValue ( ) ; return Value > <NUM_LIT> && Value < <NUM_LIT> ;


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


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


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


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


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


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


<s> return Kind == k_InstSyncBarrierOpt ;


<s> bool isITCondCode ( ) const { return Kind == k_CondCode ;


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


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


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

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


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

if ( ! Memory . OffsetImm ) return true ;